34static const char*
const s_tag =
"ra8_io_i2c_bus_riic";
69 return ra8_i2c_write((uint8_t)(uintptr_t)ctx, addr, data, len, send_stop);
103 return ra8_i2c_read((uint8_t)(uintptr_t)ctx, addr, data, len);
143 return ra8_i2c_transfer((uint8_t)(uintptr_t)ctx, addr, wr, wr_len, rd, rd_len);
160 bus->
ctx = (
void*)(uintptr_t)channel;
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
I2C Bus Interface (IIC) controller driver – polling mode.
ra8_err_t ra8_i2c_write(uint8_t channel, uint8_t peripheral_7b, const uint8_t *data, uint32_t len, bool send_stop)
Polling write of len bytes to a 7-bit peripheral address.
ra8_err_t ra8_i2c_read(uint8_t channel, uint8_t peripheral_7b, uint8_t *data, uint32_t len)
Polling read of len bytes from a 7-bit peripheral.
ra8_err_t ra8_i2c_transfer(uint8_t channel, uint8_t peripheral_7b, const uint8_t *wr, uint32_t wr_len, uint8_t *rd, uint32_t rd_len)
Combined write-then-RESTART-then-read in one bus transaction.
I2C Bus Interface (IIC) register layout for the Renesas RA8D2.
@ k_ra8_i2c_channel_count
HUM Ch 39.1, p 2367 (3 channels).
ra8_io I2C-bus facade – one controller-transfer vtable over thechip's two I2C implementations.
struct ra8_io_i2c_bus_iface ra8_io_i2c_bus_iface_t
Internal vtable type for the ra8_io I2C-bus facade.
static ra8_err_t internal_riic_read(void *ctx, uint8_t addr, uint8_t *data, uint32_t len)
RIIC backend: controller read.
static const ra8_io_i2c_bus_iface_t s_riic_iface
RIIC backend vtable – every row forwards to ra8_i2c_*.
ra8_err_t ra8_io_i2c_bus_bind_riic(ra8_io_i2c_bus_t *bus, uint8_t channel)
Bind bus to RIIC channel channel.
static ra8_err_t internal_riic_transfer(void *ctx, uint8_t addr, const uint8_t *wr, uint32_t wr_len, uint8_t *rd, uint32_t rd_len)
RIIC backend: write-then-RESTART-then-read.
static ra8_err_t internal_riic_write(void *ctx, uint8_t addr, const uint8_t *data, uint32_t len, bool send_stop)
RIIC backend: controller write.
RIIC backend binder for the ra8_io I2C-bus facade.
Caller-allocated I2C-bus handle binding a backend to its context.
const ra8_io_i2c_bus_iface_t * iface
Bound backend vtable (private).
void * ctx
Backend-private context (private).