expression
Calculate ideal UART payload throughput
UART transmits asynchronously framed serial data. In binary 8N1 mode, a frame has one start bit, eight data bits and one stop bit. At 9600 bits per second the ideal upper bound is 960 bytes per second before gaps, flow control or software overhead. This function calculates a bound, not a measured baud rate. Expected host stdout (not executed): ideal bytes/s: 960 Common mistake: Equating baud directly to payload bytes per second.
Formal Syntax & Structure
rust syntaxrust
baud / bits_per_frameWorking Example
Example Snippetrust
#![no_std]pub fn bytes_per_second_8n1(baud: u32) -> u32 { baud / 10 }