18.6.3.2.3 Function i2c_slave_init()
Initializes the requested I2C hardware module.
enum status_code i2c_slave_init( struct i2c_slave_module *const module, Sercom *const hw, const struct i2c_slave_config *const config)
Initializes the SERCOM I2C Slave device requested and sets the provided software module struct. Run this function before any further use of the driver.
| Data direction | Parameter name | Description |
|---|---|---|
|
[out] |
module |
Pointer to software module struct |
|
[in] |
hw |
Pointer to the hardware instance |
|
[in] |
config |
Pointer to the configuration struct |
Returns
Status of initialization.
| Return value | Description |
|---|---|
|
STATUS_OK |
Module initiated correctly |
|
STATUS_ERR_DENIED |
If module is enabled |
|
STATUS_BUSY |
If module is busy resetting |
|
STATUS_ERR_ALREADY_INITIALIZED |
If setting other GCLK generator than previously set |
