71#if defined(I2C_SERCOM)
78void i2c_device_init(uint8_t address);
83void i2c_device_enable(
void);
89bool i2c_device_is_enabled(
void);
99void i2c_device_set_callbacks(
109void i2c_device_disable(
void);
bool i2c_device_is_enabled_instance(uint8_t sercom)
Checks if I2C device mode is enabled on the given SERCOM.
Definition i2cd.c:110
void(* i2c_device_stop_cb_t)(uint8_t sercom)
Called when the controller sends a stop condition, ending the transaction.
Definition i2cd.h:65
uint8_t(* i2c_device_data_requested_cb_t)(uint8_t sercom)
Called when the controller wants to read a byte from this device.
Definition i2cd.h:61
void i2c_device_set_callbacks_instance(uint8_t sercom, i2c_device_address_cb_t on_address_match, i2c_device_data_received_cb_t on_data_received, i2c_device_data_requested_cb_t on_data_requested, i2c_device_stop_cb_t on_stop, i2c_device_error_cb_t on_error)
Sets callbacks for I2C device mode events on the given SERCOM.
Definition i2cd.c:114
void(* i2c_device_error_cb_t)(uint8_t sercom)
Called when a bus error occurs.
Definition i2cd.h:69
void(* i2c_device_address_cb_t)(uint8_t sercom, bool direction)
Called when a controller addresses this device.
Definition i2cd.h:51
void i2c_device_enable_instance(uint8_t sercom)
Enables I2C device mode on the given SERCOM.
Definition i2cd.c:106
void(* i2c_device_data_received_cb_t)(uint8_t sercom, uint8_t data)
Called when the controller has written a byte to this device.
Definition i2cd.h:56
void i2c_device_disable_instance(uint8_t sercom)
Disables I2C device mode on the given SERCOM.
Definition i2cd.c:129
void i2c_device_irq_handler(uint8_t sercom)
I2C device mode IRQ handler.
Definition i2cd.c:136
void i2c_device_init_instance(uint8_t sercom, uint8_t address)
Initializes I2C device mode on the given SERCOM.
Definition i2cd.c:68