62typedef enum : uint32_t {
86typedef enum : uint8_t {
261ra8_i3c_i2c_read(uint8_t channel, uint8_t target_7b, uint8_t* buf, uint32_t len,
bool restart);
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_i3c_i2c_init(uint8_t channel, const ra8_i3c_i2c_cfg_t *cfg)
Initialise the IIC_B channel and bring the bus up.
ra8_err_t ra8_i3c_i2c_abort(uint8_t channel)
Cancel any in-flight transaction and return the channel to idle.
ra8_err_t ra8_i3c_i2c_get_errors(uint8_t channel, uint8_t *out_mask)
Read latched error flags from BST (AL / NACKDF / TODF).
ra8_err_t ra8_i3c_i2c_read(uint8_t channel, uint8_t target_7b, uint8_t *buf, uint32_t len, bool restart)
Polling read of len bytes from a 7-bit target.
ra8_err_t ra8_i3c_i2c_transfer(uint8_t channel, uint8_t target_7b, const uint8_t *tx, uint32_t tx_len, uint8_t *rx, uint32_t rx_len)
Combined write-then-RESTART-then-read in a single bus transaction.
ra8_err_t ra8_i3c_i2c_deinit(uint8_t channel)
Tear down the IIC_B channel.
ra8_err_t ra8_i3c_i2c_attach_handler(uint8_t channel, ra8_i3c_i2c_complete_fn_t fn, void *ctx)
Attach a completion / error callback for the channel.
ra8_err_t ra8_i3c_i2c_set_clock(uint8_t channel, uint32_t bus_hz, uint32_t pclka_hz)
Update the bus clock without tearing the channel down.
ra8_err_t ra8_i3c_i2c_clear_errors(uint8_t channel)
Clear latched error flags in BST.
ra8_i3c_i2c_speed_t
Supported bus speeds (I2C compatibility mode).
@ k_ra8_i3c_i2c_speed_standard
100 kHz Sm.
@ k_ra8_i3c_i2c_speed_fast_plus
1 MHz Fm+.
@ k_ra8_i3c_i2c_speed_fast
400 kHz Fm.
void ra8_i3c_i2c_dispatch_eri(uint8_t channel)
Dispatch the bus-error IRQ source.
ra8_err_t ra8_i3c_i2c_scan(uint8_t channel, uint8_t target_7b, bool *out_acked)
Probe whether a 7-bit address ACKs.
ra8_err_t ra8_i3c_i2c_write(uint8_t channel, uint8_t target_7b, const uint8_t *data, uint32_t len, bool restart)
Polling write of len bytes to a 7-bit target address.
ra8_i3c_i2c_err_mask_t
Error-mask bits returned by ra8_i3c_i2c_get_errors.
@ k_ra8_i3c_i2c_err_timeout
BST.TODF set.
@ k_ra8_i3c_i2c_err_nack
BST.NACKDF set.
@ k_ra8_i3c_i2c_err_none
No latched error.
@ k_ra8_i3c_i2c_err_arb_lost
BST.ALF set.
void(* ra8_i3c_i2c_complete_fn_t)(void *ctx, uint8_t err_mask)
Transfer-complete / error callback signature.
Configuration descriptor for ra8_i3c_i2c_init.
uint32_t bus_hz
Target I2C clock rate in Hz.
uint32_t pclka_hz
Current PCLKA / I3CCLK frequency for STDBR calc.