Hi. I am working through some I2C code, and we would like to be able to trigger reads and writes from/to the I2C interface and use interrupts to handle completed events. We don't wish to have I2C interrupts on all the time, nor do we wish to deal with all the various interrupts (Tx Empty, Rx Over, etc.)--just Rx Full, mostly.
For instance, we would like to trigger 30 reads (that number could change) and get an I2C interrupt when the receive FIFO exceeds the threshold (Rx full condition).
I can't get the R_RX_FULL interrupt to fire, however.
Here's what I've tried so far:
SetWord16(I2C_INTR_MASK_REG, 0x0000);
SetBits16(I2C_INTR_MASK_REG, R_RX_FULL, 1);
NVIC_ClearPendingIRQ(I2C_IRQn);
SetWord16(I2C_RX_TL_REG, numBytesToRx - 1)
. NVIC_EnableIRQ(I2C_IRQn)
and NVIC_ClearPendingIRQ(I2C_IRQn)
.Any thoughts? Am I doing something wrong here?