[FL-1506, FL-2197] Power, USB, LED driver improvements (#966)

* Power, USB, LED driver improvements
* u2f hid descriptor fix
* variable_item_list: value alignment fix
* InputTypeRepeat handling in menu/submenu/var_item_list
* lp5562: fix bugs on 400khz i2c
* Scripts: lint in parallel.
* FuriHal: rename some USB structure to match naming convention. Drivers: update magic values in LP5562.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-01-21 19:55:44 +03:00
committed by GitHub
parent d4d87aa6a8
commit d4787e859e
35 changed files with 968 additions and 182 deletions

View File

@@ -10,19 +10,6 @@ uint8_t bit_reverse(uint8_t b) {
return b;
}
bool bq25896_read(FuriHalI2cBusHandle* handle, uint8_t address, uint8_t* data, size_t size) {
return furi_hal_i2c_trx(handle, BQ25896_ADDRESS, &address, 1, data, size, BQ25896_I2C_TIMEOUT);
}
bool bq25896_read_reg(FuriHalI2cBusHandle* handle, uint8_t address, uint8_t* data) {
return bq25896_read(handle, address, data, 1);
}
bool bq25896_write_reg(FuriHalI2cBusHandle* handle, uint8_t address, uint8_t* data) {
uint8_t buffer[2] = {address, *data};
return furi_hal_i2c_tx(handle, BQ25896_ADDRESS, buffer, 2, BQ25896_I2C_TIMEOUT);
}
typedef struct {
REG00 r00;
REG01 r01;
@@ -51,60 +38,101 @@ static bq25896_regs_t bq25896_regs;
void bq25896_init(FuriHalI2cBusHandle* handle) {
bq25896_regs.r14.REG_RST = 1;
bq25896_write_reg(handle, 0x14, (uint8_t*)&bq25896_regs.r14);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x14, *(uint8_t*)&bq25896_regs.r14, BQ25896_I2C_TIMEOUT);
// Readout all registers
bq25896_read(handle, 0x00, (uint8_t*)&bq25896_regs, sizeof(bq25896_regs));
furi_hal_i2c_read_mem(
handle,
BQ25896_ADDRESS,
0x00,
(uint8_t*)&bq25896_regs,
sizeof(bq25896_regs),
BQ25896_I2C_TIMEOUT);
// Poll ADC forever
bq25896_regs.r02.CONV_START = 1;
bq25896_regs.r02.CONV_RATE = 1;
bq25896_write_reg(handle, 0x02, (uint8_t*)&bq25896_regs.r02);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x02, *(uint8_t*)&bq25896_regs.r02, BQ25896_I2C_TIMEOUT);
bq25896_regs.r07.WATCHDOG = WatchdogDisable;
bq25896_write_reg(handle, 0x07, (uint8_t*)&bq25896_regs.r07);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x07, *(uint8_t*)&bq25896_regs.r07, BQ25896_I2C_TIMEOUT);
bq25896_read(handle, 0x00, (uint8_t*)&bq25896_regs, sizeof(bq25896_regs));
// OTG power configuration
bq25896_regs.r0A.BOOSTV = 0x8; // BOOST Voltage: 5.062V
bq25896_regs.r0A.BOOST_LIM = BOOST_LIM_1400; // BOOST Current limit: 1.4A
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x0A, *(uint8_t*)&bq25896_regs.r0A, BQ25896_I2C_TIMEOUT);
furi_hal_i2c_read_mem(
handle,
BQ25896_ADDRESS,
0x00,
(uint8_t*)&bq25896_regs,
sizeof(bq25896_regs),
BQ25896_I2C_TIMEOUT);
}
void bq25896_poweroff(FuriHalI2cBusHandle* handle) {
bq25896_regs.r09.BATFET_DIS = 1;
bq25896_write_reg(handle, 0x09, (uint8_t*)&bq25896_regs.r09);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x09, *(uint8_t*)&bq25896_regs.r09, BQ25896_I2C_TIMEOUT);
}
bool bq25896_is_charging(FuriHalI2cBusHandle* handle) {
bq25896_read(handle, 0x00, (uint8_t*)&bq25896_regs, sizeof(bq25896_regs));
bq25896_read_reg(handle, 0x0B, (uint8_t*)&bq25896_regs.r0B);
furi_hal_i2c_read_mem(
handle,
BQ25896_ADDRESS,
0x00,
(uint8_t*)&bq25896_regs,
sizeof(bq25896_regs),
BQ25896_I2C_TIMEOUT);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x0B, (uint8_t*)&bq25896_regs.r0B, BQ25896_I2C_TIMEOUT);
return bq25896_regs.r0B.CHRG_STAT != ChrgStatNo;
}
void bq25896_enable_charging(FuriHalI2cBusHandle* handle) {
bq25896_regs.r03.CHG_CONFIG = 1;
bq25896_write_reg(handle, 0x03, (uint8_t*)&bq25896_regs.r03);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x03, *(uint8_t*)&bq25896_regs.r03, BQ25896_I2C_TIMEOUT);
}
void bq25896_disable_charging(FuriHalI2cBusHandle* handle) {
bq25896_regs.r03.CHG_CONFIG = 0;
bq25896_write_reg(handle, 0x03, (uint8_t*)&bq25896_regs.r03);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x03, *(uint8_t*)&bq25896_regs.r03, BQ25896_I2C_TIMEOUT);
}
void bq25896_enable_otg(FuriHalI2cBusHandle* handle) {
bq25896_regs.r03.OTG_CONFIG = 1;
bq25896_write_reg(handle, 0x03, (uint8_t*)&bq25896_regs.r03);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x03, *(uint8_t*)&bq25896_regs.r03, BQ25896_I2C_TIMEOUT);
}
void bq25896_disable_otg(FuriHalI2cBusHandle* handle) {
bq25896_regs.r03.OTG_CONFIG = 0;
bq25896_write_reg(handle, 0x03, (uint8_t*)&bq25896_regs.r03);
furi_hal_i2c_write_reg_8(
handle, BQ25896_ADDRESS, 0x03, *(uint8_t*)&bq25896_regs.r03, BQ25896_I2C_TIMEOUT);
}
bool bq25896_is_otg_enabled(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x03, (uint8_t*)&bq25896_regs.r03);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x03, (uint8_t*)&bq25896_regs.r03, BQ25896_I2C_TIMEOUT);
return bq25896_regs.r03.OTG_CONFIG;
}
bool bq25896_check_otg_fault(FuriHalI2cBusHandle* handle) {
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x0C, (uint8_t*)&bq25896_regs.r0C, BQ25896_I2C_TIMEOUT);
return bq25896_regs.r0C.BOOST_FAULT;
}
uint16_t bq25896_get_vbus_voltage(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x11, (uint8_t*)&bq25896_regs.r11);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x11, (uint8_t*)&bq25896_regs.r11, BQ25896_I2C_TIMEOUT);
if(bq25896_regs.r11.VBUS_GD) {
return (uint16_t)bq25896_regs.r11.VBUSV * 100 + 2600;
} else {
@@ -113,21 +141,25 @@ uint16_t bq25896_get_vbus_voltage(FuriHalI2cBusHandle* handle) {
}
uint16_t bq25896_get_vsys_voltage(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x0F, (uint8_t*)&bq25896_regs.r0F);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x0F, (uint8_t*)&bq25896_regs.r0F, BQ25896_I2C_TIMEOUT);
return (uint16_t)bq25896_regs.r0F.SYSV * 20 + 2304;
}
uint16_t bq25896_get_vbat_voltage(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x0E, (uint8_t*)&bq25896_regs.r0E);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x0E, (uint8_t*)&bq25896_regs.r0E, BQ25896_I2C_TIMEOUT);
return (uint16_t)bq25896_regs.r0E.BATV * 20 + 2304;
}
uint16_t bq25896_get_vbat_current(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x12, (uint8_t*)&bq25896_regs.r12);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x12, (uint8_t*)&bq25896_regs.r12, BQ25896_I2C_TIMEOUT);
return (uint16_t)bq25896_regs.r12.ICHGR * 50;
}
uint32_t bq25896_get_ntc_mpct(FuriHalI2cBusHandle* handle) {
bq25896_read_reg(handle, 0x10, (uint8_t*)&bq25896_regs.r10);
furi_hal_i2c_read_reg_8(
handle, BQ25896_ADDRESS, 0x10, (uint8_t*)&bq25896_regs.r10, BQ25896_I2C_TIMEOUT);
return (uint32_t)bq25896_regs.r10.TSPCT * 465 + 21000;
}

View File

@@ -28,6 +28,9 @@ void bq25896_disable_otg(FuriHalI2cBusHandle* handle);
/** Is otg enabled */
bool bq25896_is_otg_enabled(FuriHalI2cBusHandle* handle);
/** Check OTG BOOST Fault status */
bool bq25896_check_otg_fault(FuriHalI2cBusHandle* handle);
/** Get VBUS Voltage in mV */
uint16_t bq25896_get_vbus_voltage(FuriHalI2cBusHandle* handle);

View File

@@ -8,24 +8,17 @@
#define TAG "Gauge"
uint16_t bq27220_read_word(FuriHalI2cBusHandle* handle, uint8_t address) {
uint8_t buffer[2] = {address};
uint16_t ret = 0;
uint16_t buf = 0;
if(furi_hal_i2c_trx(handle, BQ27220_ADDRESS, buffer, 1, buffer, 2, BQ27220_I2C_TIMEOUT)) {
ret = *(uint16_t*)buffer;
}
furi_hal_i2c_read_mem(
handle, BQ27220_ADDRESS, address, (uint8_t*)&buf, 2, BQ27220_I2C_TIMEOUT);
return ret;
return buf;
}
bool bq27220_control(FuriHalI2cBusHandle* handle, uint16_t control) {
bool ret = false;
uint8_t buffer[3];
buffer[0] = CommandControl;
buffer[1] = control & 0xFF;
buffer[2] = (control >> 8) & 0xFF;
ret = furi_hal_i2c_tx(handle, BQ27220_ADDRESS, buffer, 3, BQ27220_I2C_TIMEOUT);
bool ret = furi_hal_i2c_write_mem(
handle, BQ27220_ADDRESS, CommandControl, (uint8_t*)&control, 2, BQ27220_I2C_TIMEOUT);
return ret;
}
@@ -40,22 +33,22 @@ uint8_t bq27220_get_checksum(uint8_t* data, uint16_t len) {
bool bq27220_set_parameter_u16(FuriHalI2cBusHandle* handle, uint16_t address, uint16_t value) {
bool ret;
uint8_t buffer[5];
uint8_t buffer[4];
buffer[0] = CommandSelectSubclass;
buffer[1] = address & 0xFF;
buffer[2] = (address >> 8) & 0xFF;
buffer[3] = (value >> 8) & 0xFF;
buffer[4] = value & 0xFF;
ret = furi_hal_i2c_tx(handle, BQ27220_ADDRESS, buffer, 5, BQ27220_I2C_TIMEOUT);
buffer[0] = address & 0xFF;
buffer[1] = (address >> 8) & 0xFF;
buffer[2] = (value >> 8) & 0xFF;
buffer[3] = value & 0xFF;
ret = furi_hal_i2c_write_mem(
handle, BQ27220_ADDRESS, CommandSelectSubclass, buffer, 4, BQ27220_I2C_TIMEOUT);
delay_us(10000);
uint8_t checksum = bq27220_get_checksum(&buffer[1], 4);
buffer[0] = CommandMACDataSum;
buffer[1] = checksum;
buffer[2] = 6;
ret = furi_hal_i2c_tx(handle, BQ27220_ADDRESS, buffer, 3, BQ27220_I2C_TIMEOUT);
buffer[0] = checksum;
buffer[1] = 6;
ret = furi_hal_i2c_write_mem(
handle, BQ27220_ADDRESS, CommandMACDataSum, buffer, 2, BQ27220_I2C_TIMEOUT);
delay_us(10000);
return ret;

View File

@@ -1,21 +1,17 @@
#include "lp5562.h"
#include "lp5562_reg.h"
#include <furi_hal.h>
#include <stdio.h>
static bool lp5562_write_reg(FuriHalI2cBusHandle* handle, uint8_t address, uint8_t* data) {
uint8_t buffer[2] = {address, *data};
return furi_hal_i2c_tx(handle, LP5562_ADDRESS, buffer, 2, LP5562_I2C_TIMEOUT);
}
void lp5562_reset(FuriHalI2cBusHandle* handle) {
Reg0D_Reset reg = {.value = 0xFF};
lp5562_write_reg(handle, 0x0D, (uint8_t*)&reg);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x0D, *(uint8_t*)&reg, LP5562_I2C_TIMEOUT);
}
void lp5562_configure(FuriHalI2cBusHandle* handle) {
Reg08_Config config = {.INT_CLK_EN = true, .PS_EN = true, .PWM_HF = true};
lp5562_write_reg(handle, 0x08, (uint8_t*)&config);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x08, *(uint8_t*)&config, LP5562_I2C_TIMEOUT);
Reg70_LedMap map = {
.red = EngSelectI2C,
@@ -23,42 +19,178 @@ void lp5562_configure(FuriHalI2cBusHandle* handle) {
.blue = EngSelectI2C,
.white = EngSelectI2C,
};
lp5562_write_reg(handle, 0x70, (uint8_t*)&map);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x70, *(uint8_t*)&map, LP5562_I2C_TIMEOUT);
}
void lp5562_enable(FuriHalI2cBusHandle* handle) {
Reg00_Enable reg = {.CHIP_EN = true, .LOG_EN = true};
lp5562_write_reg(handle, 0x00, (uint8_t*)&reg);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x00, *(uint8_t*)&reg, LP5562_I2C_TIMEOUT);
//>488μs delay is required after writing to 0x00 register, otherwise program engine will not work
delay_us(500);
}
void lp5562_set_channel_current(FuriHalI2cBusHandle* handle, LP5562Channel channel, uint8_t value) {
uint8_t reg_no;
if(channel == LP5562ChannelRed) {
reg_no = 0x07;
reg_no = LP5562_CHANNEL_RED_CURRENT_REGISTER;
} else if(channel == LP5562ChannelGreen) {
reg_no = 0x06;
reg_no = LP5562_CHANNEL_GREEN_CURRENT_REGISTER;
} else if(channel == LP5562ChannelBlue) {
reg_no = 0x05;
reg_no = LP5562_CHANNEL_BLUE_CURRENT_REGISTER;
} else if(channel == LP5562ChannelWhite) {
reg_no = 0x0F;
reg_no = LP5562_CHANNEL_WHITE_CURRENT_REGISTER;
} else {
return;
}
lp5562_write_reg(handle, reg_no, &value);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, reg_no, value, LP5562_I2C_TIMEOUT);
}
void lp5562_set_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel, uint8_t value) {
uint8_t reg_no;
if(channel == LP5562ChannelRed) {
reg_no = 0x04;
reg_no = LP5562_CHANNEL_RED_VALUE_REGISTER;
} else if(channel == LP5562ChannelGreen) {
reg_no = 0x03;
reg_no = LP5562_CHANNEL_GREEN_VALUE_REGISTER;
} else if(channel == LP5562ChannelBlue) {
reg_no = 0x02;
reg_no = LP5562_CHANNEL_BLUE_VALUE_REGISTER;
} else if(channel == LP5562ChannelWhite) {
reg_no = 0x0E;
reg_no = LP5562_CHANNEL_WHITE_VALUE_REGISTER;
} else {
return;
}
lp5562_write_reg(handle, reg_no, &value);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, reg_no, value, LP5562_I2C_TIMEOUT);
}
uint8_t lp5562_get_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel) {
uint8_t reg_no;
uint8_t value;
if(channel == LP5562ChannelRed) {
reg_no = LP5562_CHANNEL_RED_VALUE_REGISTER;
} else if(channel == LP5562ChannelGreen) {
reg_no = LP5562_CHANNEL_GREEN_VALUE_REGISTER;
} else if(channel == LP5562ChannelBlue) {
reg_no = LP5562_CHANNEL_BLUE_VALUE_REGISTER;
} else if(channel == LP5562ChannelWhite) {
reg_no = LP5562_CHANNEL_WHITE_VALUE_REGISTER;
} else {
return 0;
}
furi_hal_i2c_read_reg_8(handle, LP5562_ADDRESS, reg_no, &value, LP5562_I2C_TIMEOUT);
return value;
}
static void
lp5562_set_channel_src(FuriHalI2cBusHandle* handle, LP5562Channel channel, LP5562Engine src) {
uint8_t reg_val = 0;
uint8_t bit_offset = 0;
if(channel == LP5562ChannelRed) {
bit_offset = 4;
} else if(channel == LP5562ChannelGreen) {
bit_offset = 2;
} else if(channel == LP5562ChannelBlue) {
bit_offset = 0;
} else if(channel == LP5562ChannelWhite) {
bit_offset = 6;
} else {
return;
}
furi_hal_i2c_read_reg_8(handle, LP5562_ADDRESS, 0x70, &reg_val, LP5562_I2C_TIMEOUT);
reg_val &= ~(0x3 << bit_offset);
reg_val |= ((src & 0x03) << bit_offset);
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x70, reg_val, LP5562_I2C_TIMEOUT);
}
void lp5562_execute_program(
FuriHalI2cBusHandle* handle,
LP5562Engine eng,
LP5562Channel ch,
uint16_t* program) {
if((eng < LP5562Engine1) || (eng > LP5562Engine3)) return;
uint8_t reg_val = 0;
uint8_t bit_offset = 0;
uint8_t enable_reg = 0;
// Read old value of enable register
furi_hal_i2c_read_reg_8(handle, LP5562_ADDRESS, 0x00, &enable_reg, LP5562_I2C_TIMEOUT);
// Engine configuration
bit_offset = (3 - eng) * 2;
furi_hal_i2c_read_reg_8(handle, LP5562_ADDRESS, 0x01, &reg_val, LP5562_I2C_TIMEOUT);
reg_val &= ~(0x3 << bit_offset);
reg_val |= (0x01 << bit_offset); // load
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x01, reg_val, LP5562_I2C_TIMEOUT);
delay_us(100);
// Program load
for(uint8_t i = 0; i < 16; i++) {
// Program words are big-endian, so reverse byte order before loading
program[i] = __REV16(program[i]);
}
furi_hal_i2c_write_mem(
handle,
LP5562_ADDRESS,
0x10 + (0x20 * (eng - 1)),
(uint8_t*)program,
16 * 2,
LP5562_I2C_TIMEOUT);
// Program start
bit_offset = (3 - eng) * 2;
furi_hal_i2c_read_reg_8(handle, LP5562_ADDRESS, 0x01, &reg_val, LP5562_I2C_TIMEOUT);
reg_val &= ~(0x3 << bit_offset);
reg_val |= (0x02 << bit_offset); // run
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x01, reg_val, LP5562_I2C_TIMEOUT);
// Switch output to Execution Engine
lp5562_set_channel_src(handle, ch, eng);
enable_reg &= ~(0x3 << bit_offset);
enable_reg |= (0x02 << bit_offset); // run
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x00, enable_reg, LP5562_I2C_TIMEOUT);
}
void lp5562_execute_ramp(
FuriHalI2cBusHandle* handle,
LP5562Engine eng,
LP5562Channel ch,
uint8_t val_start,
uint8_t val_end,
uint16_t time) {
if(val_start == val_end) return;
// Temporary switch to constant value from register
lp5562_set_channel_src(handle, ch, LP5562Direct);
// Prepare command sequence
uint16_t program[16];
uint8_t diff = (val_end > val_start) ? (val_end - val_start) : (val_start - val_end);
uint16_t time_step = time * 2 / diff;
uint8_t prescaller = 0;
if(time_step > 0x3F) {
time_step /= 32;
prescaller = 1;
}
if(time_step == 0) {
time_step = 1;
} else if(time_step > 0x3F)
time_step = 0x3F;
program[0] = 0x4000 | val_start; // Set PWM
if(val_end > val_start) {
program[1] = (prescaller << 14) | (time_step << 8) | ((diff / 2) & 0x7F); // Ramp Up
} else {
program[1] = (prescaller << 14) | (time_step << 8) | 0x80 |
((diff / 2) & 0x7F); // Ramp Down
}
program[2] = 0xA001 | ((2 - 1) << 7); // Loop to step 1, repeat twice to get full 8-bit scale
program[3] = 0xC000; // End
// Execute program
lp5562_execute_program(handle, eng, LP5562ChannelWhite, program);
// Write end value to register
lp5562_set_channel_value(handle, ch, val_end);
}

View File

@@ -12,6 +12,13 @@ typedef enum {
LP5562ChannelWhite,
} LP5562Channel;
typedef enum {
LP5562Direct = 0,
LP5562Engine1 = 1,
LP5562Engine2 = 2,
LP5562Engine3 = 3,
} LP5562Engine;
/** Initialize Driver */
void lp5562_reset(FuriHalI2cBusHandle* handle);
@@ -24,5 +31,24 @@ void lp5562_enable(FuriHalI2cBusHandle* handle);
/** Set channel current */
void lp5562_set_channel_current(FuriHalI2cBusHandle* handle, LP5562Channel channel, uint8_t value);
/** Set channel current */
/** Set channel PWM value */
void lp5562_set_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel, uint8_t value);
/** Get channel PWM value */
uint8_t lp5562_get_channel_value(FuriHalI2cBusHandle* handle, LP5562Channel channel);
/** Execute program sequence */
void lp5562_execute_program(
FuriHalI2cBusHandle* handle,
LP5562Engine eng,
LP5562Channel ch,
uint16_t* program);
/** Execute ramp program sequence */
void lp5562_execute_ramp(
FuriHalI2cBusHandle* handle,
LP5562Engine eng,
LP5562Channel ch,
uint8_t val_start,
uint8_t val_end,
uint16_t time);

View File

@@ -7,6 +7,16 @@
#define LP5562_ADDRESS 0x60
#define LP5562_I2C_TIMEOUT 50
#define LP5562_CHANNEL_RED_CURRENT_REGISTER 0x07
#define LP5562_CHANNEL_GREEN_CURRENT_REGISTER 0x06
#define LP5562_CHANNEL_BLUE_CURRENT_REGISTER 0x05
#define LP5562_CHANNEL_WHITE_CURRENT_REGISTER 0x0F
#define LP5562_CHANNEL_RED_VALUE_REGISTER 0x04
#define LP5562_CHANNEL_GREEN_VALUE_REGISTER 0x03
#define LP5562_CHANNEL_BLUE_VALUE_REGISTER 0x02
#define LP5562_CHANNEL_WHITE_VALUE_REGISTER 0x0E
typedef enum {
EngExecHold = 0b00,
EngExecStep = 0b01,