主题中讨论的其他器件: LP5813
我尝试到 LP5569的调光
如何进行调光?
我希望通过仅发送一个命令来调暗 LED、
请在我的代码下面进行检查。
HAL_StatusTypeDef ret;
uint8_t tValue = 0;
//初始化
for (uint8_t i = 0;i < 9;i++){
tValue = 0x30;I2C_Write_LED_driver (LP5569_ADDR、LP5569_LED0_CNTRL + I、&tValue、1);
tValue = 0x10;I2C_Write_LED_driver (LP5569_ADDR、LP5569_LED0_CURRENT_CNTRL + I、&tValue、1);
tValue = 0x64;I2C_Write_LED_driver (LP5569_ADDR、LP5569_LED0_PWM + I、&tValue、1);
}
tValue = 0x3;I2C_Write_LED_driver (LP5569_ADDR、LP5569_ENGINE1_MAPPIG1、&tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_ENGINE1_MAPPIG2、&tValue、1);
tValue = 0x3;I2C_Write_LED_driver (LP5569_ADDR、LP5569_ENGINE2_MAPPIG1、&tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_ENGINE2_MAPPIG2、&tValue、1);
tValue = 0x3;I2C_Write_LED_driver (LP5569_ADDR、LP5569_Engine3_MAPPING1、&tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_Engine3_MAPPING2、&tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_MASTER_fader_1、tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_MASTER_fader_2、tValue、1);
tValue = 0xff;I2C_Write_LED_driver (LP5569_ADDR、LP5569_MASTER_fader_3、tValue、1);