SAM SERCOM I2C Master Driver.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | i2c_master_config |
Configuration structure for the I2C Master device. More... | |
struct | i2c_master_module |
SERCOM I2C Master driver software device instance structure. More... | |
struct | i2c_master_packet |
I2C master packet for read/write. More... | |
Macros | |
#define | PINMUX_DEFAULT 0 |
Functions | |
Lock/Unlock | |
static enum status_code | i2c_master_lock (struct i2c_master_module *const module) |
Attempt to get lock on driver instance. More... | |
static void | i2c_master_unlock (struct i2c_master_module *const module) |
Unlock driver instance. More... | |
Configuration and Initialization | |
static bool | i2c_master_is_syncing (const struct i2c_master_module *const module) |
Returns the synchronization status of the module. More... | |
static void | i2c_master_get_config_defaults (struct i2c_master_config *const config) |
Gets the I2C master default configurations. More... | |
enum status_code | i2c_master_init (struct i2c_master_module *const module, Sercom *const hw, const struct i2c_master_config *const config) |
Initializes the requested I2C hardware module. More... | |
static void | i2c_master_enable (const struct i2c_master_module *const module) |
Enables the I2C module. More... | |
static void | i2c_master_disable (const struct i2c_master_module *const module) |
Disable the I2C module. More... | |
void | i2c_master_reset (struct i2c_master_module *const module) |
Resets the hardware module. More... | |
Read and Write | |
enum status_code | i2c_master_read_packet_wait (struct i2c_master_module *const module, struct i2c_master_packet *const packet) |
Reads data packet from slave. More... | |
enum status_code | i2c_master_read_packet_wait_no_stop (struct i2c_master_module *const module, struct i2c_master_packet *const packet) |
Reads data packet from slave without sending a stop condition when done. More... | |
enum status_code | i2c_master_write_packet_wait (struct i2c_master_module *const module, struct i2c_master_packet *const packet) |
Writes data packet to slave. More... | |
enum status_code | i2c_master_write_packet_wait_no_stop (struct i2c_master_module *const module, struct i2c_master_packet *const packet) |
Writes data packet to slave without sending a stop condition when done. More... | |
void | i2c_master_send_stop (struct i2c_master_module *const module) |
Sends stop condition on bus. More... | |
void | i2c_master_send_nack (struct i2c_master_module *const module) |
Sends nack signal on bus. More... | |
enum status_code | i2c_master_read_byte (struct i2c_master_module *const module, uint8_t *byte) |
Reads one byte data from slave. More... | |
enum status_code | i2c_master_write_byte (struct i2c_master_module *const module, uint8_t byte) |
Write one byte data to slave. More... | |
enum status_code | i2c_master_read_packet_wait_no_nack (struct i2c_master_module *const module, struct i2c_master_packet *const packet) |
Reads data packet from slave without sending a nack signal and a stop condition when done. More... | |
#define PINMUX_DEFAULT 0 |
Referenced by i2c_master_get_config_defaults().