CFBD_I2C_IORequestParams¶
Helper structure used by convenience read/write helpers. More...
#include <iic.h>
Public Attributes¶
| Name | |
|---|---|
| uint16_t | addr7 |
| uint32_t | mem_addr |
| uint8_t | mem_addr_size |
| uint8_t * | data |
| uint16_t | len |
| uint32_t | timeout_ms |
Detailed Description¶
Helper structure used by convenience read/write helpers.
Par: Example - Register Read
uint8_t register_value[4];
CFBD_I2C_IORequestParams req = {
.addr7 = 0x50, // Device address
.mem_addr = 0x0100, // Register/memory address in device
.mem_addr_size = 2, // 2-byte register address
.data = register_value,
.len = sizeof(register_value),
.timeout_ms = 1000
};
if (CFBD_I2CRead(bus, &req) == I2C_OK) {
// register_value now contains data from address 0x0100
}
Simplifies high-level I2C read/write operations by bundling common parameters (address, register offset, buffer, timeout) into a single structure.
Public Attributes Documentation¶
variable addr7¶
7-bit I2C address.
variable mem_addr¶
Optional device memory/register address.
variable mem_addr_size¶
Size in bytes of mem_addr.
variable data¶
Pointer to data buffer.
variable len¶
Length of data in bytes.
variable timeout_ms¶
Operation timeout in milliseconds.
Updated on 2026-02-03 at 13:21:55 +0000