Dispatcher
UART Command Line Exercise
Task
An operator types commands on USART1 while your program runs, fixing typos with Backspace. Run each line as corrected at Enter, for as long as the board runs:
line PA5 reply LED ON high OK LED OFF low OK STATUS unchanged LED:1 if PA5 is high, LED:0 if low LED ONN unchanged ERR other unchanged ERR empty unchanged none
The registers and bit fields are on the Datasheet tab.
Circuit
Pass condition
Send only the replies, each ending in \n. The terminal shows the typing itself. The replies and PA5's changes are compared in order.
Notes
Each key arrives as one byte:
Enter \r Backspace 0x7F or 0x08, by terminal
A command must match exactly. A longer line gets ERR. The given code sets up USART1 and PA5, low at reset.