14#ifndef PIO_TX_RX_DRIVER_H
15#define PIO_TX_RX_DRIVER_H
23#include "hardware/pio.h"
bool tx_put(uint8_t data)
Queue one byte to the TX PIO FIFO.
void tx_clock_init(PIO pio, uint pio_sm, V24_CONFIG_T *config)
Initialize TX clock/data PIO state machine.
bool tx_poll(void)
Poll TX completion/holdoff state and manage RTS release.
bool rx_get(uint8_t *data)
Read one received byte from RX PIO FIFO.
bool rx_clock_poll_stall(void)
Poll RX FIFO stall events and update the provided event counter.
void reinit_v24_config(V24_CONFIG_T *config, V24_BAUDRATE_T baudrate)
Reinitialize V.24 runtime configuration and derived timing values.
void tx_clock_hard_reset(void)
Hard-reset TX SM state to discard queued/in-flight bytes.
const v24_runtime_t * get_v24_runtime(void)
Returns a pointer to the v24 runtime.
uint32_t tx_clock_get_cts_toggle_seq(void)
Read current CTS edge sequence counter.
void led_mirror_init(void)
Initialize optional LED activity mirror PIO program.
void rx_clock_hard_reset(void)
Disable RX Path, clear fifos, restart SMs and CLKDIV and enable again.
void rx_clock_update_settings(V24_RX_POLARITIES_T *polarities)
Apply RX runtime settings to an already configured RX PIO SM. Take note that this function relies on ...
void tx_clock_update_settings(V24_CONFIG_T *config)
Apply TX runtime settings to an already configured TX PIO SM. Take note that this function relies on ...
void rx_clock_init(PIO pio, uint pio_sm, V24_RX_POLARITIES_T *polarities)
Initialize RX clock/data PIO state machine.
void init_v24_config(V24_CONFIG_T *config, V24_BAUDRATE_T baudrate)
Initialize V.24 runtime configuration structure.
Runtime V.24 configuration and TX holdoff state.
RX/input polarity configuration.
volatile uint32_t cts_toggle_seq
uint32_t tx_rts_holdoff_us
V24_BAUDRATE_T
Supported synchronous V.24 baudrates.