------------------------write 27 bytes to LDC_REG_CHAN_EN (0x0c):-------------------------------------------------- uint8_t configbuf[]={ 0xFF, 0x03, 0x3F, 0x00, //0x0C ~0x0F 0x3F, 0x01, 0x3F, 0x07, 0x3F, 0x07, 0x00, 0x02, //0x10 ~0x17 0x03, 0x00, 0xff, 0x00, 0xFF, 0x00, 0x00, 0x00, //0x18 ~0x1F 0xA7, 0x00, 0xA7, 0x00, 0xA7, 0x00, 0xA7}; //0x20 uint8_t cfgcomp[32]; k_sleep(K_MSEC(2)); error = i2c_burst_write(dev_i2c,i2c_dt_ldc2114.addr,LDC_REG_CHAN_EN,configbuf, 27); if(error!=0){ printk("\n--ERROR: LDC_REG_CHAN_EN: Failed to write data at address 0x0%x.-- \n\r", LDC_REG_CHAN_EN); return; } k_sleep(K_MSEC(2)); error = i2c_burst_read(dev_i2c,i2c_dt_ldc2114.addr,LDC_REG_CHAN_EN,cfgcomp, 27); if(error!=0){ printk("\n--ERROR: LDC_REG_CHAN_EN: Failed to read data at address 0x0%x.-- \n\r", LDC_REG_CHAN_EN); return; } for(i=0;i<27;i++){ printk("configbuf[%d] = %x ", i, configbuf[i]); printk("cfgcomp[%d] = %x\n", i, cfgcomp[i]); if(cfgcomp[i] != configbuf[i]){ printk("\n--ERROR: LDC_REG_CHAN_EN--\n"); //return; } } ------------------------output:------------------------------------------- --ERROR: LDC_REG_CHAN_EN: Failed to write data at address 0x0c.-- --------------------------After reducing the buff to 15 bytes:------------------------------ uint8_t configbuf[]={ 0xFF, 0x03, 0x3F, 0x00, //0x0C ~0x0F 0x3F, 0x01, 0x3F, 0x07, 0x3F, 0x07, 0x00, 0x02, //0x10 ~0x17 0x03, 0x00, 0xff, 0x00, 0xFF, 0x00, 0x00, 0x00, //0x18 ~0x1F 0xA7, 0x00, 0xA7, 0x00, 0xA7, 0x00, 0xA7}; //0x20 uint8_t cfgcomp[32]; k_sleep(K_MSEC(2)); error = i2c_burst_write(dev_i2c,i2c_dt_ldc2114.addr,LDC_REG_CHAN_EN,configbuf, 15); if(error!=0){ printk("\n--ERROR: LDC_REG_CHAN_EN: Failed to write data at address 0x0%x.-- \n\r", LDC_REG_CHAN_EN); return; } k_sleep(K_MSEC(2)); error = i2c_burst_read(dev_i2c,i2c_dt_ldc2114.addr,LDC_REG_CHAN_EN,cfgcomp, 15); if(error!=0){ printk("\n--ERROR: LDC_REG_CHAN_EN: Failed to read data at address 0x0%x.-- \n\r", LDC_REG_CHAN_EN); return; } for(i=0;i<15;i++){ printk("configbuf[%d] = %x ", i, configbuf[i]); printk("cfgcomp[%d] = %x\n", i, cfgcomp[i]); if(cfgcomp[i] != configbuf[i]){ printk("\n--ERROR: LDC_REG_CHAN_EN--\n"); //return; } } ------------------output:---------------- configbuf[0] = ff cfgcomp[0] = ff configbuf[1] = 3 cfgcomp[1] = 3 configbuf[2] = 3f cfgcomp[2] = 3f configbuf[3] = 0 cfgcomp[3] = 0 configbuf[4] = 3f cfgcomp[4] = 3f configbuf[5] = 1 cfgcomp[5] = 1 configbuf[6] = 3f cfgcomp[6] = 3f configbuf[7] = 7 cfgcomp[7] = 7 configbuf[8] = 3f cfgcomp[8] = 3f configbuf[9] = 7 cfgcomp[9] = 7 configbuf[10] = 0 cfgcomp[10] = 0 configbuf[11] = 2 cfgcomp[11] = 2 configbuf[12] = 3 cfgcomp[12] = 3 configbuf[13] = 0 cfgcomp[13] = 0 configbuf[14] = ff cfgcomp[14] = ff