Tool/software:
I'm using LP5018 LED driver , I'm able to read the IC reg. but I don't know why I'm unable write any reg. even device_config0 reg(0x00) to enable the chip(0x40).
Here I have atteched some pice of code
#define LP5018_ADDR 0x28 //(ADD0 & ADD1 connected to GND)
Note:
- EN PIN directly connected to 3.3V
-
This check is passed
if(HAL_I2C_IsDeviceReady(&hi2c1,(LP5018_ADDR <<1),5,100)!=HAL_OK){
while(1);
}
Unable to write the Chep_Enable:
uint8_t device_config0 = 0x40;
HAL_StatusTypeDef ret = HAL_I2C_Mem_Write(&hi2c1, (uint16_t)(LP5018_ADDR<<1),0x00, 1, &device_config0, 1, 100);
if(ret != HAL_OK){
return LP_ERR_ENABLE;// every time my contro reched here only
}
Thanks in Advance!!