Add firmware CDC protocol module

This commit is contained in:
2026-04-11 12:54:51 +08:00
parent 1b2fe79b5d
commit 9ba44586b3
2 changed files with 246 additions and 1 deletions

View File

@@ -92,5 +92,30 @@ Implemented behavior:
## Planned next nodes
- CDC transport module
- GATT transport module
### Node 4: CDC transport module
Files added in this step:
- `src/modules/usb_cdc_proto_module.c`
Design notes:
- use the CDC ACM UART abstraction from Zephyr
- keep CDC transport separate from protocol details by delegating encode/decode
to `keyboard_proto`
- report private outgoing events back to host over CDC
Implemented behavior:
- receive raw CDC bytes by UART IRQ
- accumulate bytes into a stream buffer
- extract protobuf `CdcFrame`
- decode host messages and dispatch them
- send:
- `HelloRsp`
- `Ack`
- `Error`
- `FunctionKeyEvent`
- `LedState`