ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_i2c_state_t Struct Reference

Per-channel driver state shared by both I2C translation units. More...

#include <ra8_i2c_internal.h>

Data Fields

bool initialized
 Tracks ra8_i2c_init / ra8_i2c_deinit.
bool bus_held
 True when the previous write returned with send_stop=false so the next call must inject a repeated-START instead of a fresh START.
bool peripheral_active
 True between ra8_i2c_peripheral_init and ra8_i2c_peripheral_deinit – own-address matching is armed and the target transfer calls may run.
ra8_i2c_peripheral_event_fn_t peripheral_handler
 Address-match callback fired by ra8_i2c_peripheral_dispatch; NULL when no handler is attached.
void * peripheral_ctx
 Opaque context passed to peripheral_handler.

Detailed Description

Per-channel driver state shared by both I2C translation units.

Tracks initialization and bus-held ownership for each RIIC channel. The data-transfer plane sets bus_held after a send_stop = false write and the configuration plane clears both fields on ra8_i2c_init / ra8_i2c_deinit. The target plane owns peripheral_active and the attached address-match callback (peripheral_handler / peripheral_ctx) that ra8_i2c_peripheral_dispatch fires.

Invariant
bus_held is only true between a held write and its chained transfer; cleared on every STOP path and on (de)init.
peripheral_handler is NULL unless a caller attached one.
See also
s_i2c_state
Since
0.1.0

Definition at line 93 of file ra8_i2c_internal.h.

Field Documentation

◆ bus_held

bool ra8_i2c_state_t::bus_held

True when the previous write returned with send_stop=false so the next call must inject a repeated-START instead of a fresh START.

Definition at line 95 of file ra8_i2c_internal.h.

◆ initialized

bool ra8_i2c_state_t::initialized

Tracks ra8_i2c_init / ra8_i2c_deinit.

Definition at line 94 of file ra8_i2c_internal.h.

◆ peripheral_active

bool ra8_i2c_state_t::peripheral_active

True between ra8_i2c_peripheral_init and ra8_i2c_peripheral_deinit – own-address matching is armed and the target transfer calls may run.

Definition at line 98 of file ra8_i2c_internal.h.

◆ peripheral_ctx

void* ra8_i2c_state_t::peripheral_ctx

Opaque context passed to peripheral_handler.

Definition at line 104 of file ra8_i2c_internal.h.

◆ peripheral_handler

ra8_i2c_peripheral_event_fn_t ra8_i2c_state_t::peripheral_handler

Address-match callback fired by ra8_i2c_peripheral_dispatch; NULL when no handler is attached.

Definition at line 101 of file ra8_i2c_internal.h.


The documentation for this struct was generated from the following file: