25 I2C_RESULT_SUCCESS = 0,
26 I2C_RESULT_ERR_ADDR_NACK = -1,
27 I2C_RESULT_ERR_BUSSTATE = -2,
28 I2C_RESULT_ERR_BUSERR = -3,
29 I2C_RESULT_ERR_DATA_NACK = -4,
52i2c_result_t
i2c_write(uint8_t address, uint8_t* data,
size_t len);
60i2c_result_t
i2c_read(uint8_t address, uint8_t* data,
size_t len);
90i2c_result_t
i2c_write_instance(uint8_t sercom, uint8_t address, uint8_t* data,
size_t len);
99i2c_result_t
i2c_read_instance(uint8_t sercom, uint8_t address, uint8_t* data,
size_t len);
i2c_result_t i2c_write_instance(uint8_t sercom, uint8_t address, uint8_t *data, size_t len)
Writes data to an I2C device on the given SERCOM at the provided address.
Definition i2c.c:91
void i2c_init(void)
Initializes the I2C peripheral for a board with a defined I2C_SERCOM.
void i2c_enable(void)
Enables the I2C peripheral for a board with a defined I2C_SERCOM.
i2c_result_t i2c_write(uint8_t address, uint8_t *data, size_t len)
Writes data to an I2C device at the provided address.
i2c_result_t i2c_read_instance(uint8_t sercom, uint8_t address, uint8_t *data, size_t len)
Reads data from an I2C device on the given SERCOM at the provided address.
Definition i2c.c:144
void i2c_enable_instance(uint8_t sercom)
Enables the I2C peripheral on the given SERCOM.
Definition i2c.c:83
void i2c_disable_instance(uint8_t sercom)
Disables the I2C peripheral on the given SERCOM.
Definition i2c.c:190
void i2c_disable(void)
Disables the I2C peripheral for a board with defined SDA/SCL pins.
void i2c_init_instance(uint8_t sercom, uint32_t baud)
Initializes an I2C peripheral on the given SERCOM.
Definition i2c.c:44
i2c_result_t i2c_read(uint8_t address, uint8_t *data, size_t len)
Reads data from an I2C device at the provided address.