Filtering i2c interrupts by i2c module
I'm working with the STM32U575 and using all four i2c blocks. My i2c code is interrupt driven.
I can't find the right way to check which i2c block trigered the interrupt, suggestions please?
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t direction, uint16_t addrMatchCode) {
if(direction == I2C_DIRECTION_TRANSMIT) {
// master is sending, start first receive
// if the master is writing, it always writes the address first
HAL_I2C_Slave_Seq_Receive_IT(hi2c, &word_addr_byte, 1, I2C_NEXT_FRAME);
} else {
// master is receiving, start first transmit
word_addr = EEPROM_OFFSET(word_addr);
HAL_I2C_Slave_Seq_Transmit_IT(hi2c, &ram[word_addr], 1, I2C_NEXT_FRAME);
}
}
