LP55231 driver
Diff: LP55231.h
- Revision:
- 1:4ab9f195e998
- Parent:
- 0:4ff4e0b7f25c
- Child:
- 2:79b94bf1cf59
diff -r 4ff4e0b7f25c -r 4ab9f195e998 LP55231.h --- a/LP55231.h Wed Aug 22 06:32:51 2018 +0000 +++ b/LP55231.h Wed Aug 22 08:59:37 2018 +0000 @@ -3,13 +3,33 @@ #ifndef LP55231_h #define LP55231_h - - #define REG_ENGINE_CNTRL1 (0x00) #define REG_MISC (0x36) + #define REG_D1_PWM (0x16) /* GREEN1 */ #define REG_D2_PWM (0x17) /* BLUE1 */ +#define REG_D3_PWM (0x18) /* GREEN2 */ +#define REG_D4_PWM (0x19) /* BLUE2 */ +#define REG_D5_PWM (0x1A) /* GREEN3 */ +#define REG_D6_PWM (0x1B) /* BLUE3 */ #define REG_D7_PWM (0x1C) /* RED1 */ +#define REG_D8_PWM (0x1D) /* RED2 */ +#define REG_D9_PWM (0x1E) /* RED3 */ + +enum LP55231_leds +{ + LP55231_LED1 = 0, + LP55231_LED2, + LP55231_LED3 +}; + +struct LP55231_colors +{ + uint8_t red; + uint8_t green; + uint8_t blue; +}; + class LP55231 { @@ -33,7 +53,7 @@ /** * */ - void LP55231_SetLed(uint8_t led, uint8_t brightness); + void LP55231_SetLed(LP55231_leds led, LP55231_colors color); private: I2C m_i2c;