Add firmware nanopb protocol core
This commit is contained in:
@@ -32,11 +32,6 @@ Design notes:
|
||||
|
||||
## Planned next nodes
|
||||
|
||||
- keyboard split logic uses `function_bitmap_event`
|
||||
- CDC transport module
|
||||
- GATT transport module
|
||||
- nanopb integration and generated protocol code
|
||||
|
||||
### Node 2: keyboard split point
|
||||
|
||||
Files updated in this step:
|
||||
@@ -59,3 +54,43 @@ Implemented behavior:
|
||||
- for consumer usages marked as function keys:
|
||||
- stop normal HID reporting
|
||||
- emit `function_key_event`
|
||||
|
||||
### Node 3: nanopb build integration and protocol core
|
||||
|
||||
Files updated in this step:
|
||||
|
||||
- `CMakeLists.txt`
|
||||
- `prj.conf`
|
||||
- `app.overlay`
|
||||
- `inc/keyboard_proto.h`
|
||||
- `src/modules/keyboard_proto.c`
|
||||
|
||||
Design notes:
|
||||
|
||||
- use NCS built-in nanopb instead of a hand-written protobuf runtime
|
||||
- generate protocol code from the shared `.proto`
|
||||
- keep one firmware-side protocol helper that:
|
||||
- encodes and decodes `CdcPacketBody`
|
||||
- encodes and decodes `CdcFrame`
|
||||
- validates checksum
|
||||
- routes host commands back into existing modules
|
||||
|
||||
Implemented behavior:
|
||||
|
||||
- enable CDC ACM class in Zephyr USB device-next stack
|
||||
- add a CDC ACM UART node in devicetree
|
||||
- wire `zephyr_nanopb_sources()` into the build
|
||||
- add protocol helper functions for:
|
||||
- body encode/decode
|
||||
- CDC frame encode
|
||||
- CDC frame stream extraction
|
||||
- hello response build
|
||||
- ack/error build
|
||||
- function key event build
|
||||
- LED state build
|
||||
- host command dispatch
|
||||
|
||||
## Planned next nodes
|
||||
|
||||
- CDC transport module
|
||||
- GATT transport module
|
||||
|
||||
Reference in New Issue
Block a user