The I2C hal provides a low level interface to the I2C interface of a target. More...
Modules | |
I2C hal tests | |
The I2C test validate proper implementation of the I2C hal. | |
I2C Events Macros | |
I2C Configuration Functions | |
Defined behavior | |
Synchronous I2C Hardware Abstraction Layer for slave | |
Asynchronous I2C Hardware Abstraction Layer | |
Data Structures | |
struct | i2c_async_event |
Structure describing the status of async transfer. More... | |
struct | i2c |
I2C HAL structure. More... | |
struct | i2c_capabilities_t |
Typedefs | |
typedef struct i2c_async_event | i2c_async_event_t |
Structure describing the status of async transfer. More... | |
typedef void(* | i2c_async_handler_f) (i2c_t *obj, i2c_async_event_t *event, void *ctx) |
Asynchronous transfer callback. More... | |
Enumerations |
The I2C hal provides a low level interface to the I2C interface of a target.
is_slave
is false, initializes the peripheral in slave mode if is_slave
is true and supports_slave_mode
is true - Verified by test fpga_i2c_test_init_free.i2c_capabilities_t
parameter - Verified by test fpga_i2c_test_get_capabilities.length
number of symbols to the bus, returns the number of symbols sent to the bus, returns an error code if the transfer fails, generates a stop condition on the bus at the end of the transfer if stop
parameter is true, and handles transfer collisions and loss of arbitration if the platform supports multimaster in hardware. The transfer times out and returns I2C_ERROR_TIMEOUT
if the transfer takes longer than the configured timeout duration - Verified by test fpga_i2c_test_blocking_write_read.length
symbols from the bus, returns the number of symbols received from the bus, returns an error code if the transfer fails, generates a stop condition on the bus at the end of the transfer if stop
parameter is true and handles transfer collisions and loss of arbitration if the platform supports multimaster in hardware. The transfer times out and returns I2C_ERROR_TIMEOUT
if the transfer takes longer than the configured timeout duration - Verified by test fpga_i2c_test_blocking_write_read.address
parameter and does nothing if called in master mode.bool
indicating whether the transfer was successfully scheduled. The callback given to i2c_transfer_async
is invoked when the transfer finishes or an error occurs and must save the handler and context pointers inside the obj
pointer. The context pointer is passed to the callback on transfer completion. The callback must be invoked on completion unless the transfer is aborted and may handle transfer collisions and loss of arbitration if the platform supports multimaster in hardware and enabled in API. i2c_async_event_t
must be filled with the number of symbols sent to the bus during transfer - Verified by test fpga_i2c_test_async_write_read.null
pointer as an argument to any function.I2C
function before calling i2c_init or after calling i2c_free.I2C
peripheral with invalid SDA
and SCL
pins.I2C
reserved value.supports_multimaster_mode
is false.read
or write
functions.handler
to i2c_transfer_async.typedef struct i2c_async_event i2c_async_event_t |
Structure describing the status of async transfer.
typedef void(* i2c_async_handler_f) (i2c_t *obj, i2c_async_event_t *event, void *ctx) |