32.6.4.2 Interrupts

The I2C client has the following interrupt sources. These are asynchronous interrupts. The DRDY, AMATCH, AND PREC will wake the device from any sleep mode.

  • Error (ERROR)
  • Data Ready (DRDY)
  • Address Match (AMATCH)
  • Stop Received (PREC)

The I2C host has the following interrupt sources. These are asynchronous interrupts. The SB and MB interrupts can wake the device from any sleep mode.

  • Error (ERROR)
  • Client on Bus (SB)
  • Host on Bus (MB)

Each interrupt source has its own interrupt flag. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) will be set when the interrupt condition is meet. Each interrupt can be individually enabled by writing ‘1’ to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing ‘1’ to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). As both INTENSET and INTENCLR always reflect the same value, the status of interrupt enablement can be read from either register.

An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request active until the interrupt flag is cleared, the interrupt is disabled or the I2C is reset. See the INTFLAG register for details on how to clear interrupt flags.

The value of INTFLAG indicates which interrupt is executed. Note that interrupts must be globally enabled for interrupt requests. Refer to the 9.2 Nested Vector Interrupt Controller for details.