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

Injected I2C-bus seam consumed by Ring-3 I2C device drivers. More...

#include <stdint.h>
#include "ra8_err.h"
Include dependency graph for ra8_i2c_bus_ops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_i2c_bus_ops_t
 Caller-filled I2C controller-transfer seam (write / read / write-then-read). More...

Detailed Description

Injected I2C-bus seam consumed by Ring-3 I2C device drivers.

Tag
[Ring 3 / HAL] {World: NS}

The RA8D2 implements I2C twice: the classic RIIC block (ra8_i2c.h, three channels) and the I3C block's I2C-compatibility mode (ra8_i3c.h, one channel). Device drivers at [Ring 3 / HAL] (the GT911 touch driver in ra8_touch.h, the SMBus 3.2 layer in ra8_smbus.h) must not care which of the two electrically-equivalent peripherals a board revision wires their device to, so they take this small function-pointer seam in their config instead of naming ra8_i2c_* or ra8_i3c_* directly.

The seam deliberately lives at Ring 3, NOT in the ra8_io fabric: the peripheral-agnostic bus facade ra8_io_i2c_bus.h sits at [Ring 4 / PAL], and a Ring-3 driver depending on it would invert ring ordering (see docs/RING_AND_WORLD.md and the identical ra8_vsource / ra8_io_blockdev split). The sanctioned bridge is the Ring-4 adapter ra8_io_i2c_bus_as_ops(), which fills this struct with trampolines into a bound ra8_io_i2c_bus_t; the app owns the bus, binds a backend, and hands the filled seam to the device driver's _init()/_open() cfg.

The seam is transfer-only by design: bus bring-up (peripheral init, bit-rate) and teardown are the app's responsibility, because only the app knows which peripheral the board wires to the device and which other devices share that bus.

Since
0.1.0

Definition in file ra8_i2c_bus_ops.h.