Expand description
LD2410 Rust Driver
A no_std compatible driver for the HLK-LD2410 human presence radar sensor.
Communicates over UART (default 256000 baud, 8N1) using a binary framed protocol.
§Protocol overview (very important)
-
Sensor report frames (radar -> host):
- Header:
F4 F3 F2 F1 - Length:
u16LE (length of frame data) - Frame data: starts with
type, then0xAA, ends with0x55 0x00 - Footer:
F8 F7 F6 F5
- Header:
-
Command / ACK frames (host <-> radar):
- Header:
FD FC FB FA - Length:
u16LE (length of intra-frame data) - Intra-frame data:
cmd_word: u16 LE+ payload bytes - Footer:
04 03 02 01
- Header:
There is no CRC16 in the vendor protocol. Integrity is via framing + length + footer.
This crate implements:
- Robust parsing of continuous normal-mode reports (type
0x02) - Basic command framing + a few common commands (enter/exit config, firmware version, engineering mode enable/disable, restart, baud set)
Modules§
Structs§
- Ack
- A parsed command ACK
- LD2410
- LD2410 driver for UART communication
- Presence
Data - Presence detection data from the LD2410 sensor (normal working mode report type
0x02)
Enums§
- Error
- Error types for LD2410 driver operations
- Target
State - Normal-mode target state (from vendor docs)