Writing and reading register via I2C using HAL library
Hi, I have to write the value ADC_CONFIG_REG = 0x9FFF in a register with dimension of 16 bit. I write the following line of code but I receive a warning because the fuction want an uint8_t pointer but in my case the register and the &ADC_CONFIG_REG is 16 bit. Can I ignore the warning or I have to modify my code? Moreover can I read a register with the function HAL_I2C_Mem_Read or there are best function to use?
HAL_I2C_Mem_Write(&hi2c1, addr_dut1_V, ADDR_ADC_CONFIG_REG, I2C_MEMADD_SIZE_8BIT, &ADC_CONFIG_REG, sizeof(ADC_CONFIG_REG), HAL_MAX_DELAY);
