70typedef enum : uint8_t {
80typedef enum : uint8_t {
89typedef enum : uint8_t {
116typedef enum : uint8_t {
150typedef enum : uint8_t {
701 uint8_t* out_dma_channel);
744 uint8_t* out_dma_channel);
Generic DMA transfer substrate (DMAC engine).
void(* ra8_dma_complete_fn_t)(void *ctx)
Caller-supplied completion callback.
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_sci_exit_stop(uint8_t channel)
Exit MSTP-gated stop state; the channel must be re-init'd.
ra8_err_t ra8_sci_write_dma(uint8_t channel, const uint8_t *data, uint16_t len, ra8_dma_complete_fn_t on_complete, void *ctx, uint8_t *out_dma_channel)
Kick off a DMA-backed TX transfer.
ra8_err_t ra8_sci_write_polling(uint8_t channel, const uint8_t *data, uint32_t len)
Send len bytes by polling (convenience wrapper).
ra8_err_t ra8_sci_attach_rx_handler(uint8_t channel, ra8_sci_rx_fn_t fn, void *ctx)
Install the RX interrupt callback + context.
bool(* ra8_sci_tx_fn_t)(void *ctx, uint8_t *byte)
TX-empty interrupt callback signature.
ra8_err_t ra8_sci_set_baud(uint8_t channel, uint32_t baud, uint32_t pclk_hz)
Change the baud rate without tearing down the channel.
ra8_sci_stop_bits_t
Stop-bit count.
@ k_ra8_sci_stop_2
RA8 SCI stop 2.
@ k_ra8_sci_stop_1
RA8 SCI stop 1.
ra8_err_t ra8_sci_baud_calculate(uint32_t baud, uint32_t pclk_hz, uint16_t *brr_out, uint8_t *clk_div_out)
Pure-math conversion from a target baud rate to BRR + clock divider settings.
ra8_err_t ra8_sci_abort(uint8_t channel, ra8_sci_dir_t direction)
Cancel an in-flight async TX or RX.
void ra8_sci_dispatch_eri(uint8_t channel)
ERI dispatch – clear SSR error flags, invoke optional error callback (none in reserved for 3....
ra8_sci_err_mask_t
Bit mask of SCI error flags.
@ k_ra8_sci_err_overrun
ORER set.
@ k_ra8_sci_err_parity
PER set.
@ k_ra8_sci_err_framing
FER set.
@ k_ra8_sci_err_none
RA8 SCI error none.
ra8_err_t ra8_sci_clear_errors(uint8_t channel)
Clear the SSR error flags via write-zero.
void(* ra8_sci_rx_fn_t)(void *ctx, uint8_t byte)
RX interrupt callback signature.
ra8_err_t ra8_sci_read(uint8_t channel, uint8_t *buf, uint32_t len)
Arm an interrupt-driven RX of len bytes into buf.
ra8_err_t ra8_sci_read_dma(uint8_t channel, uint8_t *out_buf, uint16_t len, ra8_dma_complete_fn_t on_complete, void *ctx, uint8_t *out_dma_channel)
Kick off a DMA-backed RX transfer.
ra8_sci_parity_t
Parity mode for ra8_sci_cfg_t::parity.
@ k_ra8_sci_parity_even
RA8 SCI parity even.
@ k_ra8_sci_parity_odd
RA8 SCI parity odd.
@ k_ra8_sci_parity_none
RA8 SCI parity none.
ra8_err_t ra8_sci_init(uint8_t channel, const ra8_sci_cfg_t *cfg)
Initialise an SCI channel using the descriptor.
ra8_err_t ra8_sci_enter_stop(uint8_t channel)
Put the channel into MSTP-gated stop state.
ra8_err_t ra8_sci_attach_tx_handler(uint8_t channel, ra8_sci_tx_fn_t fn, void *ctx)
Install the TX interrupt callback + context.
ra8_err_t ra8_sci_getc_polling(uint8_t channel, uint8_t *out_byte)
Poll-receive one byte (blocking, bounded spin).
ra8_sci_data_bits_t
Data-bit count.
@ k_ra8_sci_data_8
RA8 SCI data 8.
@ k_ra8_sci_data_7
RA8 SCI data 7.
ra8_err_t ra8_sci_receive_resume(uint8_t channel)
Resume reception by setting CCR0.RE.
ra8_err_t ra8_sci_receive_suspend(uint8_t channel)
Suspend reception by clearing CCR0.RE.
ra8_err_t ra8_sci_putc_polling(uint8_t channel, uint8_t byte)
Poll-send one byte (blocking, bounded by ra8_hw_err spin budget).
ra8_err_t ra8_sci_read_stop(uint8_t channel, uint32_t *remaining)
Stop an in-flight RX and report how many bytes were not yet consumed.
void ra8_sci_dispatch_rxi(uint8_t channel)
RXI dispatch – hand a received byte to the RX callback.
ra8_err_t ra8_sci_write(uint8_t channel, const uint8_t *data, uint32_t len)
Arm an interrupt-driven TX of len bytes from data.
ra8_err_t ra8_sci_flush(uint8_t channel)
Block until the channel's transmit shift register is empty.
ra8_sci_dir_t
Direction selector for ra8_sci_abort.
@ k_ra8_sci_dir_tx
Cancel an in-flight TX.
@ k_ra8_sci_dir_both
Cancel both directions.
@ k_ra8_sci_dir_rx
Cancel an in-flight RX.
void ra8_sci_dispatch_txi(uint8_t channel)
TXI dispatch – advance the TX callback.
ra8_err_t ra8_sci_deinit(uint8_t channel)
Tear down a channel – disable TX/RX, release MSTP.
ra8_err_t ra8_sci_get_errors(uint8_t channel, uint8_t *out_mask)
Read the SSR error bits (ORER, FER, PER).
Configuration descriptor for ra8_sci_init.
uint32_t pclk_hz
PCLKB frequency in Hz (used for BRR calculation).
ra8_sci_parity_t parity
Parity mode.
ra8_sci_stop_bits_t stop_bits
1 or 2 stop bits.
uint32_t baud
Target baud rate in bps.
ra8_sci_data_bits_t data_bits
7 or 8 data bits.