LD2410Async
Asynchronous Arduino ESP32 library for the LD2410 mmWave radar sensor
Loading...
Searching...
No Matches
LD2410Defs.h
Go to the documentation of this file.
1#pragma once
2#include "Arduino.h"
3#include "LD2410Async.h" // for enums like LightControl, DistanceResolution
4
5// LD2410Defs.h
6// Internal protocol constants and command templates.
7// Not part of the public API - subject to change.
8
9namespace LD2410Defs
10{
11 constexpr size_t LD2410_Buffer_Size = 0x40;
12
13 constexpr byte headData[4]{ 0xF4, 0xF3, 0xF2, 0xF1 };
14 constexpr byte tailData[4]{ 0xF8, 0xF7, 0xF6, 0xF5 };
15 constexpr byte headConfig[4]{ 0xFD, 0xFC, 0xFB, 0xFA };
16 constexpr byte tailConfig[4]{ 4, 3, 2, 1 };
17
18 constexpr byte configEnableCommand = 0xff;
19 constexpr byte configEnableCommandData[6]{ 4, 0, configEnableCommand, 0, 1, 0 };
20
21 constexpr byte configDisableCommand = 0xFE;
22 constexpr byte configDisableCommandData[4]{ 2, 0, configDisableCommand, 0 };
23
24 constexpr byte requestMacAddressCommand = 0xA5;
25 constexpr byte requestMacAddressCommandData[6]{ 4, 0, requestMacAddressCommand, 0, 1, 0 };
26
27 constexpr byte requestFirmwareCommand = 0xA0;
29
30 constexpr byte requestDistanceResolutionCommand = 0xAB;
32
33 constexpr byte setDistanceResolutionCommand = 0xAA;
36
37 constexpr byte setBaudRateCommand = 0xA1;
38 constexpr byte setBaudRateCommandData[6]{ 4, 0, setBaudRateCommand, 0, 7, 0 };
39
42
43 constexpr byte rebootCommand = 0xA3;
44 constexpr byte rebootCommandData[4]{ 2, 0, rebootCommand, 0 };
45
46 constexpr byte bluetoothSettingsCommand = 0xA4;
47 constexpr byte bluetoothSettingsOnCommandData[6]{ 4, 0, bluetoothSettingsCommand, 0, 1, 0 };
48 constexpr byte bluetoothSettingsOffCommandData[6]{ 4, 0, bluetoothSettingsCommand, 0, 0, 0 };
49
50 constexpr byte getBluetoothPermissionsCommand = 0xA8;
51
52 constexpr byte setBluetoothPasswordCommand = 0xA9;
53 constexpr byte setBluetoothPasswordCommandData[10]{ 8, 0, setBluetoothPasswordCommand, 0, 0x48, 0x69, 0x4C, 0x69, 0x6E, 0x6B };
54
55 constexpr byte requestParamsCommand = 0x61;
56 constexpr byte requestParamsCommandData[4]{ 2, 0, requestParamsCommand, 0 };
57
58 constexpr byte engineeringModeEnableComand = 0x62;
60
61 constexpr byte engineeringModeDisableComand = 0x63;
63
64 constexpr byte requestAuxControlSettingsCommand = 0xAE;
66
67 constexpr byte setAuxControlSettingsCommand = 0xAD;
68 constexpr byte setAuxControlSettingCommandData[8]{ 6, 0, setAuxControlSettingsCommand, 0, 0, 0x80, 0, 0 };
69
70 constexpr byte beginAutoConfigCommand = 0x0B;
71 constexpr byte beginAutoConfigCommandData[6]{ 4, 0, beginAutoConfigCommand, 0, 0x0A, 0 };
72
73 constexpr byte requestAutoConfigStatusCommand = 0x1B;
75
78 0x14, 0, distanceGateSensitivityConfigCommand, 0, 0, 0, 0, 0, 0, 0,
79 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0
80 };
81
82 constexpr byte maxGateCommand = 0x60;
83 constexpr byte maxGateCommandData[0x16]{
84 0x14, 0, maxGateCommand, 0, 0, 0, 8, 0, 0, 0,
85 1, 0, 8, 0, 0, 0, 2, 0, 5, 0, 0, 0
86 };
87}
constexpr byte requestAutoConfigStatusCommandData[4]
Definition LD2410Defs.h:74
constexpr byte setAuxControlSettingCommandData[8]
Definition LD2410Defs.h:68
constexpr byte configDisableCommand
Definition LD2410Defs.h:21
constexpr byte requestDistanceResolutionCommandData[4]
Definition LD2410Defs.h:31
constexpr byte setDistanceResolutionCommand
Definition LD2410Defs.h:33
constexpr byte configEnableCommandData[6]
Definition LD2410Defs.h:19
constexpr byte engineeringModeDisableComand
Definition LD2410Defs.h:61
constexpr byte requestMacAddressCommandData[6]
Definition LD2410Defs.h:25
constexpr byte setAuxControlSettingsCommand
Definition LD2410Defs.h:67
constexpr byte distanceGateSensitivityConfigCommand
Definition LD2410Defs.h:76
constexpr byte bluetoothSettingsCommand
Definition LD2410Defs.h:46
constexpr byte restoreFactorSettingsCommandData[4]
Definition LD2410Defs.h:41
constexpr byte requestAuxControlSettingsCommandData[4]
Definition LD2410Defs.h:65
constexpr byte distanceGateSensitivityConfigCommandData[0x16]
Definition LD2410Defs.h:77
constexpr byte setBluetoothPasswordCommandData[10]
Definition LD2410Defs.h:53
constexpr byte setDistanceResolution20cmCommandData[6]
Definition LD2410Defs.h:35
constexpr byte maxGateCommandData[0x16]
Definition LD2410Defs.h:83
constexpr byte setBaudRateCommand
Definition LD2410Defs.h:37
constexpr byte tailConfig[4]
Definition LD2410Defs.h:16
constexpr byte headConfig[4]
Definition LD2410Defs.h:15
constexpr byte setBluetoothPasswordCommand
Definition LD2410Defs.h:52
constexpr byte requestAutoConfigStatusCommand
Definition LD2410Defs.h:73
constexpr byte engineeringModeDisableCommandData[4]
Definition LD2410Defs.h:62
constexpr byte rebootCommandData[4]
Definition LD2410Defs.h:44
constexpr byte requestAuxControlSettingsCommand
Definition LD2410Defs.h:64
constexpr byte setBaudRateCommandData[6]
Definition LD2410Defs.h:38
constexpr byte restoreFactorySettingsAsyncCommand
Definition LD2410Defs.h:40
constexpr byte bluetoothSettingsOnCommandData[6]
Definition LD2410Defs.h:47
constexpr byte requestParamsCommand
Definition LD2410Defs.h:55
constexpr byte bluetoothSettingsOffCommandData[6]
Definition LD2410Defs.h:48
constexpr byte requestMacAddressCommand
Definition LD2410Defs.h:24
constexpr byte headData[4]
Definition LD2410Defs.h:13
constexpr byte setDistanceResolution75cmCommandData[6]
Definition LD2410Defs.h:34
constexpr byte rebootCommand
Definition LD2410Defs.h:43
constexpr byte requestFirmwareCommand
Definition LD2410Defs.h:27
constexpr byte beginAutoConfigCommandData[6]
Definition LD2410Defs.h:71
constexpr size_t LD2410_Buffer_Size
Definition LD2410Defs.h:11
constexpr byte maxGateCommand
Definition LD2410Defs.h:82
constexpr byte beginAutoConfigCommand
Definition LD2410Defs.h:70
constexpr byte configDisableCommandData[4]
Definition LD2410Defs.h:22
constexpr byte getBluetoothPermissionsCommand
Definition LD2410Defs.h:50
constexpr byte configEnableCommand
Definition LD2410Defs.h:18
constexpr byte tailData[4]
Definition LD2410Defs.h:14
constexpr byte requestFirmwareCommandData[4]
Definition LD2410Defs.h:28
constexpr byte engineeringModeEnableCommandData[4]
Definition LD2410Defs.h:59
constexpr byte engineeringModeEnableComand
Definition LD2410Defs.h:58
constexpr byte requestDistanceResolutionCommand
Definition LD2410Defs.h:30
constexpr byte requestParamsCommandData[4]
Definition LD2410Defs.h:56