NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
|
Structure describing a single I2C message segment within a transaction. More...
#include <nhal_i2c_types.h>
Data Fields | ||
nhal_i2c_address | address | |
7-bit or 10-bit address for this message segment. | ||
uint16_t | flags | |
Combination of nhal_i2c_transfer_bit_flags_t for this segment. | ||
union { | ||
struct { | ||
uint8_t * buffer | ||
Pointer to buffer for received data (must be writable). More... | ||
size_t length | ||
Number of bytes to read into the buffer. More... | ||
} read | ||
Parameters for I2C read operations. More... | ||
struct { | ||
const uint8_t * bytes | ||
Pointer to data to send (must be readable). More... | ||
size_t length | ||
Number of bytes to write from the bytes. More... | ||
} write | ||
Parameters for I2C write operations. More... | ||
}; | ||
Union to hold data specific to either a read or a write operation. | ||
Structure describing a single I2C message segment within a transaction.
A full I2C transaction can consist of one or more such messages.
Definition at line 52 of file nhal_i2c_types.h.
union { ... } nhal_i2c_transfer_op_t |
Union to hold data specific to either a read or a write operation.
Only one of these members should be accessed based on the flags.
nhal_i2c_address nhal_i2c_transfer_op_t::address |
7-bit or 10-bit address for this message segment.
The high bit (0x80) is not used for 7-bit addresses here; it's strictly the 7-bit address (0-127).
Definition at line 53 of file nhal_i2c_types.h.
uint8_t* nhal_i2c_transfer_op_t::buffer |
Pointer to buffer for received data (must be writable).
Definition at line 67 of file nhal_i2c_types.h.
const uint8_t* nhal_i2c_transfer_op_t::bytes |
Pointer to data to send (must be readable).
Definition at line 74 of file nhal_i2c_types.h.
uint16_t nhal_i2c_transfer_op_t::flags |
Combination of nhal_i2c_transfer_bit_flags_t for this segment.
Definition at line 56 of file nhal_i2c_types.h.
size_t nhal_i2c_transfer_op_t::length |
Number of bytes to read into the buffer.
Number of bytes to write from the bytes.
Definition at line 68 of file nhal_i2c_types.h.
struct { ... } nhal_i2c_transfer_op_t::read |
Parameters for I2C read operations.
struct { ... } nhal_i2c_transfer_op_t::write |
Parameters for I2C write operations.