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

A device on the modelled I2C bus: 7-bit address + read/write callbacks. More...

Data Fields

bool present
 Slot occupied.
uint8_t addr_7b
 7-bit address.
void(* write )(void *ctx, uint8_t byte)
 Controller->device.
uint32_t(* read )(void *ctx, uint8_t *buf, uint32_t max)
 Device->controller.
void(* stop )(void *ctx)
 STOP/transfer end.
void * ctx
 Device state.

Detailed Description

A device on the modelled I2C bus: 7-bit address + read/write callbacks.

The write callback receives each byte the controller transmits after the address (register pointers, then payload). The read callback fills buf with up to max response bytes for the device's current state and returns the count; the bus model serves them to the controller one NTDTBP0 read at a time. present false means no device answers that address (the bus NACKs).

Definition at line 255 of file board_periph_i2c.c.

Field Documentation

◆ addr_7b

uint8_t i2c_device_t::addr_7b

7-bit address.

Definition at line 257 of file board_periph_i2c.c.

◆ ctx

void* i2c_device_t::ctx

◆ present

bool i2c_device_t::present

Slot occupied.

Definition at line 256 of file board_periph_i2c.c.

◆ read

uint32_t(* i2c_device_t::read) (void *ctx, uint8_t *buf, uint32_t max)

Device->controller.

Definition at line 259 of file board_periph_i2c.c.

Referenced by internal_i3c_address_phase().

◆ stop

void(* i2c_device_t::stop) (void *ctx)

STOP/transfer end.

Definition at line 260 of file board_periph_i2c.c.

Referenced by internal_i3c_close_transfer().

◆ write

void(* i2c_device_t::write) (void *ctx, uint8_t byte)

Controller->device.

Definition at line 258 of file board_periph_i2c.c.

Referenced by internal_i3c_ntdtbp0_write().


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