4 #ifdef USE_BINARY_SENSOR 13 #ifdef USE_TEXT_SENSOR 23 namespace seeed_mr60fda2 {
25 static const uint8_t DATA_BUF_MAX_SIZE = 28;
26 static const uint8_t FRAME_BUF_MAX_SIZE = 37;
27 static const uint8_t LEN_TO_HEAD_CKSUM = 8;
28 static const uint8_t LEN_TO_DATA_FRAME = 9;
30 static const uint8_t FRAME_HEADER_BUFFER = 0x01;
31 static const uint16_t IS_FALL_TYPE_BUFFER = 0x0E02;
32 static const uint16_t PEOPLE_EXIST_TYPE_BUFFER = 0x0F09;
33 static const uint16_t RESULT_INSTALL_HEIGHT = 0x0E04;
34 static const uint16_t RESULT_PARAMETERS = 0x0E06;
35 static const uint16_t RESULT_HEIGHT_THRESHOLD = 0x0E08;
36 static const uint16_t RESULT_SENSITIVITY = 0x0E0A;
52 static const float INSTALL_HEIGHT[7] = {2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.0f};
53 static const float HEIGHT_THRESHOLD[7] = {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f};
54 static const float SENSITIVITY[3] = {3, 15, 30};
56 static const char *
const INSTALL_HEIGHT_STR[7] = {
"2.4m",
"2.5m",
"2.6",
"2.7m",
"2.8",
"2.9m",
"3.0m"};
57 static const char *
const HEIGHT_THRESHOLD_STR[7] = {
"0.0m",
"0.1m",
"0.2m",
"0.3m",
"0.4m",
"0.5m",
"0.6m"};
58 static const char *
const SENSITIVITY_STR[3] = {
"1",
"2",
"3"};
62 #ifdef USE_BINARY_SENSOR 63 SUB_BINARY_SENSOR(people_exist)
64 SUB_BINARY_SENSOR(fall_detected)
71 SUB_SELECT(install_height)
72 SUB_SELECT(height_threshold)
73 SUB_SELECT(sensitivity)
77 uint8_t current_frame_locate_;
78 uint8_t current_frame_buf_[FRAME_BUF_MAX_SIZE];
79 uint8_t current_data_buf_[DATA_BUF_MAX_SIZE];
80 uint16_t current_frame_id_;
81 size_t current_frame_len_;
82 size_t current_data_frame_len_;
83 uint16_t current_frame_type_;
85 void split_frame_(uint8_t buffer);
86 void process_frame_();
90 void setup()
override;
void set_sensitivity(uint8_t index)
void set_install_height(uint8_t index)
void set_height_threshold(uint8_t index)
const float LATE
For components that should be initialized at the very end of the setup process.
void dump_config() override
float get_setup_priority() const override
void get_radar_parameters()
Implementation of SPI Controller mode.