68#if defined(I2C_SERCOM)
75void i2c_device_init(uint8_t address);
80void i2c_device_enable(
void);
86bool i2c_device_is_enabled(
void);
96void i2c_device_set_callbacks(
106void 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:108
void(* i2c_device_stop_cb_t)(uint8_t sercom)
Called when the controller sends a stop condition, ending the transaction.
Definition i2cd.h:62
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:58
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:112
void(* i2c_device_error_cb_t)(uint8_t sercom)
Called when a bus error occurs.
Definition i2cd.h:66
void(* i2c_device_address_cb_t)(uint8_t sercom, bool direction)
Called when a controller addresses this device.
Definition i2cd.h:48
void i2c_device_enable_instance(uint8_t sercom)
Enables I2C device mode on the given SERCOM.
Definition i2cd.c:104
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:53
void i2c_device_disable_instance(uint8_t sercom)
Disables I2C device mode on the given SERCOM.
Definition i2cd.c:127
void i2c_device_irq_handler(uint8_t sercom)
I2C device mode IRQ handler.
Definition i2cd.c:132
void i2c_device_init_instance(uint8_t sercom, uint8_t address)
Initializes I2C device mode on the given SERCOM.
Definition i2cd.c:68