Hi,
I am using I2C Master HAL Module on r_riic SSP 1.2.1 on S7G2SK board.
The slave device is AD5241 digital potentiometer. The transfer is started by code:
void set_voltage_and_fire(uint8_t voltage)
{
static uint8_t command[2];
ssp_err_t err;
command[0] = 0x18;
command[1] = (uint8_t)voltage_mv;
err = g_i2c0.p_api->write(g_i2c0.p_ctrl, &command[0], 2 , false);
if(err != SSP_SUCCESS) while(1);
}
The write() call returns SSP_SUCCESS even if there is no slave device attached to the I2C bus!
I expect that in this case the NACK should be detected and the transmission should aborted. This is what I2C specification says clearly.
However using logic analyser I see that all 3 bytes are transmitted by the MCU ignoring the NACK received after the slave address.
The callback function gets event I2C_EVENT_TX_COMPLETE and number of transmitted bytes is 2.
So nor the status of write() call, nor the callback args informs the application about failing I2C transfer!
I can not believe that Synergy I2C driver is completely ignoring one of the main features of the I2C bus (the acknowledge).
Does anyone know how to get from the Synergy I2C driver the ACK/NACK status of a I2C transaction?