NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ledstrip.h File Reference
#include "../common/color.h"
Include dependency graph for ledstrip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  led_spc_color_indices
 
struct  led_mode_color_indices
 
struct  led_config
 
struct  ledstrip_config
 

Macros

#define LED_SPECIAL_COLOR_COUNT   8
 
#define LED_DIRECTION_COUNT   6
 
#define LED_MAX_STRIP_LENGTH   32
 
#define LED_CONFIGURABLE_COLOR_COUNT   16
 
#define LED_MODE_COUNT   6
 
#define LED_FUNCTION_COUNT   10
 
#define LED_DIRECTION_BIT_OFFSET   0
 
#define LED_FUNCTION_BIT_OFFSET   LED_DIRECTION_COUNT
 
#define LED_X_BIT_OFFSET   4
 
#define LED_Y_BIT_OFFSET   0
 
#define LED_XY_MASK   0x0F
 
#define CALCULATE_LED_XY(x, y)   ((((x) & LED_XY_MASK) << LED_X_BIT_OFFSET) | (((y) & LED_XY_MASK) << LED_Y_BIT_OFFSET))
 
#define LED_FLAG_DIRECTION(directionId)   (1 << (LED_DIRECTION_BIT_OFFSET + (directionId)))
 
#define LED_FLAG_DIRECTION_MASK   (((1 << LED_DIRECTION_COUNT) - 1) << LED_DIRECTION_BIT_OFFSET)
 
#define LED_FLAG_FUNCTION(functionId)   (1 << (LED_FUNCTION_BIT_OFFSET + (functionId)))
 
#define LED_FLAG_FUNCTION_MASK   (((1 << LED_FUNCTION_COUNT) - 1) << LED_FUNCTION_BIT_OFFSET)
 

Enumerations

enum  ledModeIndex_e {
  LED_MODE_ORIENTATION = 0, LED_MODE_HEADFREE, LED_MODE_HORIZON, LED_MODE_ANGLE,
  LED_MODE_MAG, LED_MODE_BARO, LED_SPECIAL
}
 
enum  ledSpecialColorIds_e {
  LED_SCOLOR_DISARMED = 0, LED_SCOLOR_ARMED, LED_SCOLOR_ANIMATION, LED_SCOLOR_BACKGROUND,
  LED_SCOLOR_BLINKBACKGROUND, LED_SCOLOR_GPSNOSATS, LED_SCOLOR_GPSNOLOCK, LED_SCOLOR_GPSLOCKED
}
 
enum  colorId_e {
  COLOR_BLACK = 0, COLOR_WHITE, COLOR_RED, COLOR_ORANGE,
  COLOR_YELLOW, COLOR_LIME_GREEN, COLOR_GREEN, COLOR_MINT_GREEN,
  COLOR_CYAN, COLOR_LIGHT_BLUE, COLOR_BLUE, COLOR_DARK_VIOLET,
  COLOR_MAGENTA, COLOR_DEEP_PINK
}
 
enum  ledDirectionId_e {
  LED_DIRECTION_NORTH = 0, LED_DIRECTION_EAST, LED_DIRECTION_SOUTH, LED_DIRECTION_WEST,
  LED_DIRECTION_UP, LED_DIRECTION_DOWN
}
 
enum  ledFunctionId_e {
  LED_FUNCTION_INDICATOR, LED_FUNCTION_WARNING, LED_FUNCTION_FLIGHT_MODE, LED_FUNCTION_ARM_STATE,
  LED_FUNCTION_THROTTLE, LED_FUNCTION_THRUST_RING, LED_FUNCTION_COLOR, LED_FUNCTION_GPS,
  LED_FUNCTION_RSSI, LED_FUNCTION_BLINK
}
 

Functions

struct led_spc_color_indices __attribute__ ((packed))
 
bool ledstrip_config_set_color (struct ledstrip_config *self, int index, const char *colorConfig)
 

Variables

typedef __attribute__
 
uint8_t color [LED_SPECIAL_COLOR_COUNT]
 
uint8_t xy
 
uint16_t flags
 
struct led_config leds [LED_MAX_STRIP_LENGTH]
 
struct hsvColor_s colors [LED_CONFIGURABLE_COLOR_COUNT]
 
struct led_mode_color_indices modeColors [LED_MODE_COUNT]
 
struct led_spc_color_indices spcColors [1]
 

Macro Definition Documentation

#define CALCULATE_LED_XY (   x,
 
)    ((((x) & LED_XY_MASK) << LED_X_BIT_OFFSET) | (((y) & LED_XY_MASK) << LED_Y_BIT_OFFSET))
#define LED_CONFIGURABLE_COLOR_COUNT   16
#define LED_DIRECTION_BIT_OFFSET   0
#define LED_DIRECTION_COUNT   6
#define LED_FLAG_DIRECTION (   directionId)    (1 << (LED_DIRECTION_BIT_OFFSET + (directionId)))
#define LED_FLAG_DIRECTION_MASK   (((1 << LED_DIRECTION_COUNT) - 1) << LED_DIRECTION_BIT_OFFSET)
#define LED_FLAG_FUNCTION (   functionId)    (1 << (LED_FUNCTION_BIT_OFFSET + (functionId)))
#define LED_FLAG_FUNCTION_MASK   (((1 << LED_FUNCTION_COUNT) - 1) << LED_FUNCTION_BIT_OFFSET)
#define LED_FUNCTION_BIT_OFFSET   LED_DIRECTION_COUNT
#define LED_FUNCTION_COUNT   10
#define LED_MAX_STRIP_LENGTH   32
#define LED_MODE_COUNT   6
#define LED_SPECIAL_COLOR_COUNT   8
#define LED_X_BIT_OFFSET   4
#define LED_XY_MASK   0x0F
#define LED_Y_BIT_OFFSET   0

Enumeration Type Documentation

enum colorId_e
Enumerator
COLOR_BLACK 
COLOR_WHITE 
COLOR_RED 
COLOR_ORANGE 
COLOR_YELLOW 
COLOR_LIME_GREEN 
COLOR_GREEN 
COLOR_MINT_GREEN 
COLOR_CYAN 
COLOR_LIGHT_BLUE 
COLOR_BLUE 
COLOR_DARK_VIOLET 
COLOR_MAGENTA 
COLOR_DEEP_PINK 
Enumerator
LED_DIRECTION_NORTH 
LED_DIRECTION_EAST 
LED_DIRECTION_SOUTH 
LED_DIRECTION_WEST 
LED_DIRECTION_UP 
LED_DIRECTION_DOWN 
Enumerator
LED_FUNCTION_INDICATOR 
LED_FUNCTION_WARNING 
LED_FUNCTION_FLIGHT_MODE 
LED_FUNCTION_ARM_STATE 
LED_FUNCTION_THROTTLE 
LED_FUNCTION_THRUST_RING 
LED_FUNCTION_COLOR 
LED_FUNCTION_GPS 
LED_FUNCTION_RSSI 
LED_FUNCTION_BLINK 
Enumerator
LED_MODE_ORIENTATION 
LED_MODE_HEADFREE 
LED_MODE_HORIZON 
LED_MODE_ANGLE 
LED_MODE_MAG 
LED_MODE_BARO 
LED_SPECIAL 
Enumerator
LED_SCOLOR_DISARMED 
LED_SCOLOR_ARMED 
LED_SCOLOR_ANIMATION 
LED_SCOLOR_BACKGROUND 
LED_SCOLOR_BLINKBACKGROUND 
LED_SCOLOR_GPSNOSATS 
LED_SCOLOR_GPSNOLOCK 
LED_SCOLOR_GPSLOCKED 

Function Documentation

struct led_spc_color_indices __attribute__ ( (packed)  )
bool ledstrip_config_set_color ( struct ledstrip_config self,
int  index,
const char *  colorConfig 
)

Variable Documentation

typedef __attribute__
uint8_t color
uint16_t flags
struct led_spc_color_indices spcColors[1]
uint8_t xy