Mbed OS Reference
Loading...
Searching...
No Matches
I2C Events Macros

Macros

#define I2C_EVENT_ERROR   (1 << 1)
 Indicates that an unspecified error has occurred in the transfer. More...
 
#define I2C_EVENT_ERROR_NO_SLAVE   (1 << 2)
 Indicates that the slave did not respond to the address byte of the transfer. More...
 
#define I2C_EVENT_TRANSFER_COMPLETE   (1 << 3)
 Indicates that the transfer completed successfully. More...
 
#define I2C_EVENT_TRANSFER_EARLY_NACK   (1 << 4)
 Indicates that a NACK was received after the address byte, but before the requested number of bytes could be transferred. More...
 
#define I2C_EVENT_ALL   (I2C_EVENT_ERROR | I2C_EVENT_TRANSFER_COMPLETE | I2C_EVENT_ERROR_NO_SLAVE | I2C_EVENT_TRANSFER_EARLY_NACK)
 Use this macro to request all possible I2C events. More...
 

Detailed Description

Macro Definition Documentation

◆ I2C_EVENT_ERROR

#define I2C_EVENT_ERROR   (1 << 1)

Indicates that an unspecified error has occurred in the transfer.

This usually means either an internal error in the Mbed MCU's I2C module, or something like an arbitration loss. Does not indicate a NACK.

Definition at line 44 of file i2c_api.h.

◆ I2C_EVENT_ERROR_NO_SLAVE

#define I2C_EVENT_ERROR_NO_SLAVE   (1 << 2)

Indicates that the slave did not respond to the address byte of the transfer.

Definition at line 49 of file i2c_api.h.

◆ I2C_EVENT_TRANSFER_COMPLETE

#define I2C_EVENT_TRANSFER_COMPLETE   (1 << 3)

Indicates that the transfer completed successfully.

Definition at line 54 of file i2c_api.h.

◆ I2C_EVENT_TRANSFER_EARLY_NACK

#define I2C_EVENT_TRANSFER_EARLY_NACK   (1 << 4)

Indicates that a NACK was received after the address byte, but before the requested number of bytes could be transferred.

Note: Not every manufacturer HAL is able to make a distinction between this flag and I2C_EVENT_ERROR_NO_SLAVE. On a NACK, you might conceivably get one or both of these flags.

Definition at line 63 of file i2c_api.h.

◆ I2C_EVENT_ALL

Use this macro to request all possible I2C events.

Definition at line 68 of file i2c_api.h.