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

Internal RIIC bus-device registry and board-device models. More...

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

Go to the source code of this file.

Data Structures

struct  riic_device_t
 One device registered on the modelled RIIC bus. More...

Functions

riic_device_tpriv_riic_device_find (uint8_t addr_7b)
 Find the registered RIIC device answering one 7-bit address.
void priv_riic_devices_reset (void)
 Reset and repopulate the board's RIIC device registry.
void priv_riic_devices_report (void)
 Report activity observed by the registered board devices.

Detailed Description

Internal RIIC bus-device registry and board-device models.

Declares the bounded bus registry shared with the RIIC controller and owns lifecycle/reporting seams for the PI4IOE5V6408 expander and OV5640 SCCB sensor that populate the EK-RA8D2 system bus.

Since
0.1.0

Definition in file board_periph_riic_devices_internal.h.

Function Documentation

◆ priv_riic_device_find()

riic_device_t * priv_riic_device_find ( uint8_t addr_7b)

Find the registered RIIC device answering one 7-bit address.

Searches the fixed-capacity board-device registry without changing transfer state or acquiring storage.

Parameters
[in]addr_7bSeven-bit bus address to resolve.
Returns
Pointer to the matching registry entry, or nullptr when unclaimed.
Return values
nullptrNo registered device claims addr_7b; otherwise the returned pointer identifies the matching entry.
Precondition
addr_7b is limited to the seven-bit I2C address domain.
The RIIC device registry has been reset for the current emulator run.
Postcondition
The registry and all device states are unchanged.
Ownership of the returned module-owned entry remains with the model.
Note
The returned pointer stays valid until the next device reset.
Since
0.1.0

Definition at line 258 of file board_periph_riic_devices.c.

References k_riic_dev_max, RA8_PRIV, and s_riic_dev.

Referenced by internal_riic_address_phase(), internal_riic_close_transfer(), and internal_riic_icdrt_write().

◆ priv_riic_devices_report()

void priv_riic_devices_report ( void )

Report activity observed by the registered board devices.

Emits one diagnostic line for an active expander or camera model, including accepted writes and OV5640 identity-register reads.

Precondition
The injected emulator diagnostic sink is initialized.
The call executes on the emulator's single owning thread.
Postcondition
Device and registry state are unchanged.
Diagnostic output contains only devices with observed activity.
Note
Sink failures follow the emulator's existing diagnostic policy.
Since
0.1.0

Definition at line 291 of file board_periph_riic_devices.c.

References k_ov5640_addr_7b, k_pi4ioe_addr_7b, priv_emu_io_errf(), RA8_PRIV, s_ov5640, and s_pi4ioe.

Referenced by internal_riic_report().

◆ priv_riic_devices_reset()

void priv_riic_devices_reset ( void )

Reset and repopulate the board's RIIC device registry.

Clears all registry and device state, seeds the expander identity register, and installs the PI4IOE5V6408 and OV5640 callback entries.

Precondition
No RIIC device callback is executing during the reset.
The call executes on the emulator's single owning thread.
Postcondition
Only the two board devices occupy registry entries.
Both device models reflect their documented reset values.
Note
The operation uses only fixed-capacity module storage.
Since
0.1.0

Definition at line 268 of file board_periph_riic_devices.c.

References internal_ov5640_read(), internal_ov5640_stop(), internal_ov5640_write(), internal_pi4ioe_read(), internal_pi4ioe_stop(), internal_pi4ioe_write(), internal_riic_device_register(), k_ov5640_addr_7b, k_pi4ioe_addr_7b, k_pi4ioe_devid_val, k_pi4ioe_reg_devid, k_riic_dev_max, RA8_PRIV, s_ov5640, s_pi4ioe, and s_riic_dev.

Referenced by internal_riic_reset().