|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
HLK-LD2410 24 GHz mmWave presence / motion radar codec (PROTOCORE_ENABLE_LD2410). More...
#include "protocore_config.h"Go to the source code of this file.
HLK-LD2410 24 GHz mmWave presence / motion radar codec (PROTOCORE_ENABLE_LD2410).
The LD2410 streams a framed serial report at 256000 baud: header F4 F3 F2 F1, a little-endian intra-frame length, the payload, and footer F8 F7 F6 F5. The payload carries the target state (none / moving / stationary / both), the moving and stationary target distance (cm) and energy (0-100), the overall detection distance, and - in "engineering
mode" - the per-gate energy of all nine range gates. Configuration is a second frame kind (header FD FC FB FA, footer 04 03 02 01) carrying a 2-byte command word.
This codec is pure and host-tested: ::protocore_ld2410_parse_report decodes one report frame, and ::Ld2410Stream reassembles frames byte-by-byte from a UART with resync on noise (no heap, fixed buffer). The command encoders build the config frames. Where a bus seam exists the binding pumps a UART through uart.h and keeps the latest report; only that read/write reaches the seam.
A cheap solder-and-bench-test breakout: wire it to a UART, wave a hand, watch presence.
Definition in file ld2410.h.