The set of callbacks the implementation supports.
Public Attributes#
Callback to transfer messages in full duplex mode.
Callback to transfer messages in half duplex mode.
Register an asynchronous RX callback.
Callback to delete the serial bus interface.
Public Attribute Documentation#
xfer#
sid_error_t(* sid_pal_serial_bus_iface::xfer) (const struct sid_pal_serial_bus_iface *iface, const struct sid_pal_serial_bus_client *client, uint8_t *tx, uint8_t *rx, size_t xfer_size)
Callback to transfer messages in full duplex mode.
Returns
sid_error_t error code indicating the result of the operation.
xfer_hd#
sid_error_t(* sid_pal_serial_bus_iface::xfer_hd) (const struct sid_pal_serial_bus_iface *iface, const struct sid_pal_serial_bus_client *client, uint8_t *tx, uint8_t *rx, size_t tx_size, size_t rx_size)
Callback to transfer messages in half duplex mode.
Returns
sid_error_t error code indicating the result of the operation.
set_rx_callback#
sid_error_t(* sid_pal_serial_bus_iface::set_rx_callback) (const struct sid_pal_serial_bus_iface *iface, sid_pal_serial_bus_rx_cb_t cb, void *context)
Register an asynchronous RX callback.
Backends that support push-style RX deliver received bytes to cb as they arrive, in place of the caller draining them via xfer_hd(). The callback runs in the backend's receive context (ISR on UART) – see the sid_pal_serial_bus_rx_cb_t doc for what that implies.
Pass cb == NULL to unregister and return the bus to polled RX (the next xfer_hd() will drain whatever the hardware has since accumulated).
Optional: backends without an async RX path leave this slot NULL, and callers must check for that before registering.
destroy#
sid_error_t(* sid_pal_serial_bus_iface::destroy) (const struct sid_pal_serial_bus_iface *iface)
Callback to delete the serial bus interface.
Returns
sid_error_t error code indicating the result of the operation.