Configuration
Informative
A worked UART channel configuration, using the YAML configuration model (the toolchain and file format are implementation-defined). The full property tables are in Configuration Reference; the binding rule is CHI-UART-MUST-23.
Channels
The configuration is a list of channels; each fixes the frame format, bitrate, event-handling mode,
and — importantly — the transmission-notification style (transmission_callback_type).
general:
enable_development_error_reporting: true
config_set:
- config_set_name: "UartCfg"
channel:
- channel_id: 0
hw_channel: 0
event_handling_mode: "Interrupt" # or "Polling"
transmission_callback_type: "HwCompletion" # Uart_Callout_OnTransmission
clock_divider: 16 # derives the baudrate
data_bit_width: 8 # [5, 8]
stop_bit_width: "1.0" # 1.0 | 1.5 | 2.0
parity: "None" # None | Odd | Even
bit_order: "LsbFirst" # LsbFirst | MsbFirst
hw_flow_control: false
- channel_id: 1
hw_channel: 1
event_handling_mode: "Polling"
transmission_callback_type: "Streaming" # Uart_Callout_OnStreamingDataRequest
clock_divider: 8
data_bit_width: 8
stop_bit_width: "1.0"
parity: "Even"
bit_order: "LsbFirst"
hw_flow_control: true
Notes
Pick one TX callback style per channel.
HwCompletionusesUart_Callout_OnTransmission(fires when the bus is idle);StreamingusesUart_Callout_OnStreamingDataRequest(fires when the software buffer empties). The driver never uses both for one channel.Frame format —
data_bit_width[5, 8],stop_bit_width1.0 / 1.5 / 2.0, andparityNone / Odd / Even. Restrict ranges to what the hardware supports.Event handling is per channel:
Pollingevents are serviced byUart_PollFunction,Interruptevents byUart_Interrupt.Hardware flow control may be enabled only where the hardware provides it (CHI-UART-SHOULD-01).