Hi @Marconi_
In I2C protocol, the LSB of the address byte is used to determine whether the command is a read or write operation. If the LSB is 0, it's a write operation; if it's 1, it's a read operation.
When you receive an interrupt indicating that data has been received, you can check the LSB of the address byte to determine whether it's a read or write operation.
Here's a simple example:
void I2C0_IRQHandler(void)
{
// Address match event occurred
uint8_t address = I2C0->ADDR;
// Check the LSB to determine read (1) or write (0)
if (address & 0x01)
{
// Read command (LSB is 1)
// Perform actions for read command
}
else
{
// Write command (LSB is 0)
// Perform actions for write command
}
}
Hope this will help you.
BR
Hang