#ifndef LAMP_H #define LAMP_H #include #define RANDOM_COLOR 0x00000001 #define RANDOM_COLOR_SPEED 0x00000002 #define RANDOM_FADE_SPEED 0x00000004 #define FADE_MULTIPLER 100 //XXX * 100 mS for fade speed input #define COLOR_SPEED_MULTIPLER 1000 //XXX * 1000 mS for color rotation speed input #define FLICKER_TIMER_MULTIPLIER 10 #define FADE_COLOR 0 #define FADE_BLACK 1 //Lamp modes typedef enum { lamp_off = 0, lamp_solid, lamp_flicker, lamp_rotate } lamp_mode_t; //Struct with all current lamp settings typedef struct { int32_t addr; //Address of lamp on the network lamp_mode_t mode; //Current lamp mode int32_t brightness_hi_min; //High flicker range values, flickers between high and low ranges int32_t brightness_hi_max; int32_t brightness_lo_min; //Low flicker range values int32_t brightness_lo_max; int32_t hold_hi_min; //Hold time range for flickering (in mS) int32_t hold_hi_max; int32_t hold_lo_min; int32_t hold_lo_max; int32_t G2R_slope; //Green 2 red ratio int32_t base_green_value; //Minimum green value int32_t brightness; //Brightness of flickering, used to control lamp brightness not flickering effect int32_t num_of_colors; //Number of colors to switch between in fade mode int32_t randomize; //Random value for fade mode, radomizes color and fade info int32_t rotate_speed; //How long to hold at each color int32_t fade_speed; //How lont to fade between colors int32_t fade_2_black; //Fade from one color to the other, or fade to black inbetween colors uint8_t red[128]; //Color info uint8_t green[128]; uint8_t blue[128]; }lamp_t; #endif