ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
ld2412.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  esphome
 Providing packet encoding functions for exchanging data with a remote host.
 
namespace  esphome::ld2412
 

Enumerations

enum  esphome::ld2412::BaudRate : uint8_t {
  esphome::ld2412::BAUD_RATE_9600 = 1 , esphome::ld2412::BAUD_RATE_19200 = 2 , esphome::ld2412::BAUD_RATE_38400 = 3 , esphome::ld2412::BAUD_RATE_57600 = 4 ,
  esphome::ld2412::BAUD_RATE_115200 = 5 , esphome::ld2412::BAUD_RATE_230400 = 6 , esphome::ld2412::BAUD_RATE_256000 = 7 , esphome::ld2412::BAUD_RATE_460800 = 8
}
 
enum  esphome::ld2412::DistanceResolution : uint8_t { esphome::ld2412::DISTANCE_RESOLUTION_0_2 = 0x03 , esphome::ld2412::DISTANCE_RESOLUTION_0_5 = 0x01 , esphome::ld2412::DISTANCE_RESOLUTION_0_75 = 0x00 }
 
enum  esphome::ld2412::LightFunction : uint8_t { esphome::ld2412::LIGHT_FUNCTION_OFF = 0x00 , esphome::ld2412::LIGHT_FUNCTION_BELOW = 0x01 , esphome::ld2412::LIGHT_FUNCTION_ABOVE = 0x02 }
 
enum  esphome::ld2412::OutPinLevel : uint8_t { esphome::ld2412::OUT_PIN_LEVEL_LOW = 0x01 , esphome::ld2412::OUT_PIN_LEVEL_HIGH = 0x00 }
 
enum  esphome::ld2412::PeriodicData : uint8_t {
  esphome::ld2412::DATA_TYPES = 6 , esphome::ld2412::TARGET_STATES = 8 , esphome::ld2412::MOVING_TARGET_LOW = 9 , esphome::ld2412::MOVING_TARGET_HIGH = 10 ,
  esphome::ld2412::MOVING_ENERGY = 11 , esphome::ld2412::STILL_TARGET_LOW = 12 , esphome::ld2412::STILL_TARGET_HIGH = 13 , esphome::ld2412::STILL_ENERGY = 14 ,
  esphome::ld2412::MOVING_SENSOR_START = 17 , esphome::ld2412::STILL_SENSOR_START = 31 , esphome::ld2412::LIGHT_SENSOR = 45 , esphome::ld2412::OUT_PIN_SENSOR = 38
}
 
enum  esphome::ld2412::PeriodicDataValue : uint8_t { esphome::ld2412::HEADER = 0XAA , esphome::ld2412::FOOTER = 0x55 , esphome::ld2412::CHECK = 0x00 }
 
enum  esphome::ld2412::AckData : uint8_t { esphome::ld2412::COMMAND = 6 , esphome::ld2412::COMMAND_STATUS = 7 }
 

Functions

template<size_t N>
uint8_t esphome::ld2412::find_uint8 (const StringToUint8(&arr)[N], const std::string &str)
 
template<size_t N>
const char * esphome::ld2412::find_str (const Uint8ToString(&arr)[N], uint8_t value)
 
std::function< void(void)> esphome::ld2412::set_number_value (number::Number *n, float value)
 

Variables

constexpr StringToUint8 esphome::ld2412::BAUD_RATES_BY_STR []
 
constexpr StringToUint8 esphome::ld2412::DISTANCE_RESOLUTIONS_BY_STR []
 
constexpr Uint8ToString esphome::ld2412::DISTANCE_RESOLUTIONS_BY_UINT []
 
constexpr StringToUint8 esphome::ld2412::LIGHT_FUNCTIONS_BY_STR []
 
constexpr Uint8ToString esphome::ld2412::LIGHT_FUNCTIONS_BY_UINT []
 
constexpr StringToUint8 esphome::ld2412::OUT_PIN_LEVELS_BY_STR []
 
constexpr Uint8ToString esphome::ld2412::OUT_PIN_LEVELS_BY_UINT []