ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
vl53l1x.cpp
Go to the documentation of this file.
1// VL53L1X time-of-flight distance sensor, ported from ST's VL53L1X Ultra Lite Driver (ULD).
2
3#include "vl53l1x.h"
5#include "esphome/core/hal.h"
7#include "esphome/core/log.h"
9
10#include <iterator>
11
13
14ESPHOME_LOG_TAG(TAG, "vl53l1x");
15
16static constexpr uint8_t DEFAULT_ADDRESS = 0x29;
17static constexpr uint16_t MODEL_ID = 0xEACC;
18
19static constexpr uint16_t I2C_DEVICE_ADDRESS = 0x0001;
20static constexpr uint16_t VHV_CONFIG_TIMEOUT_MACROP_LOOP_BOUND = 0x0008;
21static constexpr uint16_t VHV_CONFIG_INIT = 0x000B;
22static constexpr uint16_t ALGO_PART_TO_PART_RANGE_OFFSET_MM = 0x001E;
23static constexpr uint16_t MM_CONFIG_INNER_OFFSET_MM = 0x0020;
24static constexpr uint16_t MM_CONFIG_OUTER_OFFSET_MM = 0x0022;
25static constexpr uint16_t DEFAULT_CONFIG_START = 0x002D;
26static constexpr uint16_t GPIO_TIO_HV_STATUS = 0x0031;
27static constexpr uint16_t PHASECAL_CONFIG_TIMEOUT_MACROP = 0x004B;
28static constexpr uint16_t RANGE_CONFIG_TIMEOUT_MACROP_A_HI = 0x005E;
29static constexpr uint16_t RANGE_CONFIG_VCSEL_PERIOD_A = 0x0060;
30static constexpr uint16_t RANGE_CONFIG_TIMEOUT_MACROP_B_HI = 0x0061;
31static constexpr uint16_t RANGE_CONFIG_VCSEL_PERIOD_B = 0x0063;
32static constexpr uint16_t RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT_MCPS = 0x0066;
33static constexpr uint16_t RANGE_CONFIG_VALID_PHASE_HIGH = 0x0069;
34static constexpr uint16_t SD_CONFIG_WOI_SD0 = 0x0078;
35static constexpr uint16_t SD_CONFIG_INITIAL_PHASE_SD0 = 0x007A;
36static constexpr uint16_t ROI_CONFIG_USER_ROI_CENTRE_SPAD = 0x007F;
37static constexpr uint16_t ROI_CONFIG_USER_ROI_REQUESTED_GLOBAL_XY_SIZE = 0x0080;
38static constexpr uint16_t SYSTEM_INTERRUPT_CLEAR = 0x0086;
39static constexpr uint16_t SYSTEM_MODE_START = 0x0087;
40static constexpr uint16_t RESULT_RANGE_STATUS = 0x0089;
41static constexpr uint16_t FIRMWARE_SYSTEM_STATUS = 0x00E5;
42static constexpr uint16_t IDENTIFICATION_MODEL_ID = 0x010F;
43static constexpr uint16_t ROI_CONFIG_MODE_ROI_CENTRE_SPAD = 0x013E;
44
45static constexpr uint8_t MODE_START_SINGLE_SHOT = 0x10;
46// ROI centre for a ROI wider or taller than 10 SPADs (ULD SetROI)
47static constexpr uint8_t ROI_CENTER_LARGE = 199;
48// RESULT_RANGE_STATUS through RESULT_FINAL_CROSSTALK_CORRECTED_RANGE_MM_SD0 (0x0096)
49static constexpr size_t RESULT_LENGTH = 15;
50// Raw range status that the ULD reports as a valid range
51static constexpr uint8_t RANGE_STATUS_VALID = 9;
52
53// ULD VL51L1X_DEFAULT_CONFIGURATION, registers 0x2D to 0x87
54static const uint8_t DEFAULT_CONFIG[] PROGMEM = {
55 0x00, // 0x2D: reserved
56 0x01, // 0x2E: I2C pads, bit 0 set for pull-up at AVDD
57 0x01, // 0x2F: GPIO pads, bit 0 set for pull-up at AVDD
58 0x01, // 0x30: GPIO_HV_MUX_CTRL (bit 4 clear: data ready reads high)
59 0x02, // 0x31: reserved
60 0x00, // 0x32: reserved
61 0x02, // 0x33: reserved
62 0x08, // 0x34: reserved
63 0x00, // 0x35: reserved
64 0x08, // 0x36: reserved
65 0x10, // 0x37: reserved
66 0x01, // 0x38: reserved
67 0x01, // 0x39: reserved
68 0x00, // 0x3A: reserved
69 0x00, // 0x3B: reserved
70 0x00, // 0x3C: reserved
71 0x00, // 0x3D: reserved
72 0xFF, // 0x3E: reserved
73 0x00, // 0x3F: reserved
74 0x0F, // 0x40: reserved
75 0x00, // 0x41: reserved
76 0x00, // 0x42: reserved
77 0x00, // 0x43: reserved
78 0x00, // 0x44: reserved
79 0x00, // 0x45: reserved
80 0x20, // 0x46: CAL_CONFIG_SPAD_DC_TARGET_COUNT
81 0x0B, // 0x47: CAL_CONFIG_VCSEL_START
82 0x00, // 0x48: reserved
83 0x00, // 0x49: reserved
84 0x02, // 0x4A: reserved
85 0x14, // 0x4B: PHASECAL_CONFIG_TIMEOUT_MACROP
86 0x21, // 0x4C: reserved
87 0x00, // 0x4D: PHASECAL_CONFIG_OVERRIDE
88 0x00, // 0x4E: reserved
89 0x05, // 0x4F: DSS_CONFIG_ROI_MODE_CONTROL
90 0x00, // 0x50: SYSTEM_THRESH_RATE_HIGH
91 0x00, // 0x51: SYSTEM_THRESH_RATE_HIGH
92 0x00, // 0x52: SYSTEM_THRESH_RATE_LOW
93 0x00, // 0x53: SYSTEM_THRESH_RATE_LOW
94 0xC8, // 0x54: DSS_CONFIG_MANUAL_EFFECTIVE_SPADS_SELECT (200 << 8)
95 0x00, // 0x55: DSS_CONFIG_MANUAL_EFFECTIVE_SPADS_SELECT
96 0x00, // 0x56: reserved
97 0x38, // 0x57: DSS_CONFIG_APERTURE_ATTENUATION
98 0xFF, // 0x58: reserved
99 0x01, // 0x59: reserved
100 0x00, // 0x5A: reserved
101 0x08, // 0x5B: reserved
102 0x00, // 0x5C: reserved
103 0x00, // 0x5D: reserved
104 0x01, // 0x5E: RANGE_CONFIG_TIMEOUT_MACROP_A_HI
105 0xCC, // 0x5F: RANGE_CONFIG_TIMEOUT_MACROP_A_LO
106 0x0F, // 0x60: RANGE_CONFIG_VCSEL_PERIOD_A
107 0x01, // 0x61: RANGE_CONFIG_TIMEOUT_MACROP_B_HI
108 0xF1, // 0x62: RANGE_CONFIG_TIMEOUT_MACROP_B_LO
109 0x0D, // 0x63: RANGE_CONFIG_VCSEL_PERIOD_B
110 0x01, // 0x64: RANGE_CONFIG_SIGMA_THRESH
111 0x68, // 0x65: RANGE_CONFIG_SIGMA_THRESH (360)
112 0x00, // 0x66: RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT_MCPS
113 0x80, // 0x67: RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT_MCPS (1.0 MCPS)
114 0x08, // 0x68: reserved
115 0xB8, // 0x69: RANGE_CONFIG_VALID_PHASE_HIGH
116 0x00, // 0x6A: reserved
117 0x00, // 0x6B: reserved
118 0x00, // 0x6C: SYSTEM_INTERMEASUREMENT_PERIOD
119 0x00, // 0x6D: SYSTEM_INTERMEASUREMENT_PERIOD
120 0x0F, // 0x6E: SYSTEM_INTERMEASUREMENT_PERIOD
121 0x89, // 0x6F: SYSTEM_INTERMEASUREMENT_PERIOD
122 0x00, // 0x70: reserved
123 0x00, // 0x71: SYSTEM_THRESH_HIGH
124 0x00, // 0x72: SYSTEM_THRESH_HIGH
125 0x00, // 0x73: SYSTEM_THRESH_LOW
126 0x00, // 0x74: SYSTEM_THRESH_LOW
127 0x00, // 0x75: reserved
128 0x00, // 0x76: reserved
129 0x01, // 0x77: reserved
130 0x0F, // 0x78: SD_CONFIG_WOI_SD0
131 0x0D, // 0x79: SD_CONFIG_WOI_SD1
132 0x0E, // 0x7A: SD_CONFIG_INITIAL_PHASE_SD0
133 0x0E, // 0x7B: SD_CONFIG_INITIAL_PHASE_SD1
134 0x00, // 0x7C: reserved
135 0x00, // 0x7D: reserved
136 0x02, // 0x7E: reserved
137 0xC7, // 0x7F: ROI_CONFIG_USER_ROI_CENTRE_SPAD
138 0xFF, // 0x80: ROI_CONFIG_USER_ROI_REQUESTED_GLOBAL_XY_SIZE
139 0x9B, // 0x81: SYSTEM_SEQUENCE_CONFIG
140 0x00, // 0x82: reserved
141 0x00, // 0x83: reserved
142 0x00, // 0x84: reserved
143 0x01, // 0x85: reserved
144 0x00, // 0x86: SYSTEM_INTERRUPT_CLEAR
145 0x00, // 0x87: SYSTEM_MODE_START
146};
147
148// ULD SetDistanceMode values, indexed by DistanceMode. The ULD only knows short and long; the
149// medium row is the standard ranging preset of ST's full VL53L1 API.
150struct DistanceModeConfig {
151 uint8_t phasecal_timeout;
152 uint8_t vcsel_period_a;
153 uint8_t vcsel_period_b;
154 uint8_t valid_phase_high;
155 uint16_t woi_sd0;
156 uint16_t initial_phase_sd0;
157};
158static const DistanceModeConfig DISTANCE_MODE_CONFIGS[] PROGMEM = {
159 {0x14, 0x07, 0x05, 0x38, 0x0705, 0x0606}, // short
160 {0x0B, 0x0B, 0x09, 0x78, 0x0B09, 0x0A0A}, // medium
161 {0x0A, 0x0F, 0x0D, 0xB8, 0x0F0D, 0x0E0E}, // long
162};
163
164// ULD SetTimingBudgetInMs values
165struct TimingBudgetConfig {
166 uint16_t budget_ms;
167 uint16_t macrop_a;
168 uint16_t macrop_b;
169};
170static const TimingBudgetConfig SHORT_TIMING_BUDGETS[] PROGMEM = {
171 {15, 0x001D, 0x0027}, {20, 0x0051, 0x006E}, {33, 0x00D6, 0x006E}, {50, 0x01AE, 0x01E8},
172 {100, 0x02E1, 0x0388}, {200, 0x03E1, 0x0496}, {500, 0x0591, 0x05C1},
173};
174static const TimingBudgetConfig LONG_TIMING_BUDGETS[] PROGMEM = {
175 {20, 0x001E, 0x0022}, {33, 0x0060, 0x006E}, {50, 0x00AD, 0x00C6},
176 {100, 0x01CC, 0x01EA}, {200, 0x02D9, 0x02F8}, {500, 0x048F, 0x04A4},
177};
178// The ULD has no medium table: these are the long values scaled by the VCSEL period ratio
179// (16/12 for A, 14/10 for B), since the macro period grows with the period and the timeouts
180// count macro periods. The data-ready poll tolerates the small error this leaves.
181static const TimingBudgetConfig MEDIUM_TIMING_BUDGETS[] PROGMEM = {
182 {20, 0x0028, 0x0030}, {33, 0x0080, 0x009A}, {50, 0x00E7, 0x018B},
183 {100, 0x0288, 0x02A4}, {200, 0x0390, 0x03AD}, {500, 0x04BE, 0x04E5},
184};
185
186// Copies the entry for budget_ms out of flash; false when the mode has no such budget.
187static bool find_timing_budget(DistanceMode mode, uint16_t budget_ms, TimingBudgetConfig *out) {
188 const TimingBudgetConfig *table = LONG_TIMING_BUDGETS;
189 size_t count = std::size(LONG_TIMING_BUDGETS);
190 if (mode == DISTANCE_MODE_SHORT) {
191 table = SHORT_TIMING_BUDGETS;
192 count = std::size(SHORT_TIMING_BUDGETS);
193 } else if (mode == DISTANCE_MODE_MEDIUM) {
194 table = MEDIUM_TIMING_BUDGETS;
195 count = std::size(MEDIUM_TIMING_BUDGETS);
196 }
197 for (size_t i = 0; i < count; i++) {
198 progmem_memcpy(out, &table[i], sizeof(TimingBudgetConfig));
199 if (out->budget_ms == budget_ms)
200 return true;
201 }
202 return false;
203}
204
205VL53L1XSensor *VL53L1XSensor::first_sensor = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
206
209 VL53L1XSensor::first_sensor = this;
210}
211
213 // The first sensor to set up holds every sensor with an enable pin in reset, so each one
214 // comes back at the default address only when its own setup() releases it.
215 if (VL53L1XSensor::first_sensor != nullptr) {
216 for (auto *other = VL53L1XSensor::first_sensor; other != nullptr; other = other->next_) {
217 if (other->enable_pin_ != nullptr) {
218 other->enable_pin_->setup();
219 other->enable_pin_->digital_write(false);
220 }
221 }
223 }
224
225 const uint8_t final_address = this->address_;
226 if (this->enable_pin_ != nullptr) {
227 this->enable_pin_->digital_write(true);
228 delay(2);
229 }
230 this->set_i2c_address(DEFAULT_ADDRESS);
231
232 if (!this->wait_for_boot_()) {
233 this->fail_at_default_address_(LOG_STR("Boot timeout"));
234 return;
235 }
236
237 uint16_t model_id;
238 if (!this->read_word16_(IDENTIFICATION_MODEL_ID, &model_id)) {
239 this->fail_at_default_address_(LOG_STR(ESP_LOG_MSG_COMM_FAIL));
240 return;
241 }
242 if (model_id != MODEL_ID) {
243 ESP_LOGE(TAG, "Wrong model ID 0x%04X", model_id);
244 this->fail_at_default_address_(LOG_STR("Wrong model ID"));
245 return;
246 }
247
248 if (final_address != DEFAULT_ADDRESS) {
249 if (!this->write_byte16_(I2C_DEVICE_ADDRESS, final_address & 0x7F)) {
250 this->fail_at_default_address_(LOG_STR("Setting address failed"));
251 return;
252 }
253 this->set_i2c_address(final_address);
254 }
255
256 if (!this->configure_()) {
257 this->mark_failed(LOG_STR(ESP_LOG_MSG_COMM_FAIL));
258 return;
259 }
260
261 // The ULD ranges once during init to calibrate; loop() finishes that from the first result.
262 if (!this->start_ranging_()) {
263 this->mark_failed(LOG_STR(ESP_LOG_MSG_COMM_FAIL));
264 return;
265 }
266 this->measurement_start_ = millis();
267}
268
269// A sensor that failed before it was re-addressed is still answering at 0x29, which would
270// collide with the next sibling's bring-up, so hold it in reset.
272 if (this->enable_pin_ != nullptr)
273 this->enable_pin_->digital_write(false);
274 this->mark_failed(message);
275}
276
278 for (uint8_t i = 0; i < 100; i++) {
279 uint8_t status;
280 if (this->read_byte16_(FIRMWARE_SYSTEM_STATUS, &status) && (status & 0x01))
281 return true;
282 delay(1);
283 }
284 return false;
285}
286
288 TimingBudgetConfig budget;
289 if (!find_timing_budget(this->distance_mode_, this->budget_ms_, &budget)) {
290 ESP_LOGE(TAG, "Unsupported timing budget %u ms", this->budget_ms_);
291 return false;
292 }
293 DistanceModeConfig mode;
294 progmem_memcpy(&mode, &DISTANCE_MODE_CONFIGS[this->distance_mode_], sizeof(mode));
295
296 uint8_t config[sizeof(DEFAULT_CONFIG)];
297 progmem_memcpy(config, DEFAULT_CONFIG, sizeof(config));
298 // ULD SetROI: a ROI of at most 10x10 is centred on the part's calibrated optical centre.
299 uint8_t center = this->roi_center_;
300 if (center == 0) {
301 center = ROI_CENTER_LARGE;
303 !this->read_byte16_(ROI_CONFIG_MODE_ROI_CENTRE_SPAD, &center)) {
304 return false;
305 }
306 }
307 // The register address auto-increments, so the whole table goes in one write.
308 return this->write_register16(DEFAULT_CONFIG_START, config, sizeof(config)) == i2c::ERROR_OK &&
309 // SetDistanceMode
310 this->write_byte16_(PHASECAL_CONFIG_TIMEOUT_MACROP, mode.phasecal_timeout) &&
311 this->write_byte16_(RANGE_CONFIG_VCSEL_PERIOD_A, mode.vcsel_period_a) &&
312 this->write_byte16_(RANGE_CONFIG_VCSEL_PERIOD_B, mode.vcsel_period_b) &&
313 this->write_byte16_(RANGE_CONFIG_VALID_PHASE_HIGH, mode.valid_phase_high) &&
314 this->write_word16_(SD_CONFIG_WOI_SD0, mode.woi_sd0) &&
315 this->write_word16_(SD_CONFIG_INITIAL_PHASE_SD0, mode.initial_phase_sd0) &&
316 // SetTimingBudgetInMs
317 this->write_word16_(RANGE_CONFIG_TIMEOUT_MACROP_A_HI, budget.macrop_a) &&
318 this->write_word16_(RANGE_CONFIG_TIMEOUT_MACROP_B_HI, budget.macrop_b) &&
319 // SetOffset
320 this->write_word16_(ALGO_PART_TO_PART_RANGE_OFFSET_MM, static_cast<uint16_t>(this->offset_mm_ * 4)) &&
321 this->write_word16_(MM_CONFIG_INNER_OFFSET_MM, 0) && this->write_word16_(MM_CONFIG_OUTER_OFFSET_MM, 0) &&
322 // SetROI and SetROICenter
323 this->write_byte16_(ROI_CONFIG_USER_ROI_CENTRE_SPAD, center) &&
324 this->write_byte16_(ROI_CONFIG_USER_ROI_REQUESTED_GLOBAL_XY_SIZE,
325 static_cast<uint8_t>(((this->roi_height_ - 1) << 4) | (this->roi_width_ - 1))) &&
326 // SetSignalThreshold
327 this->write_word16_(RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT_MCPS, this->signal_rate_limit_);
328}
329
330bool VL53L1XSensor::start_ranging_() { return this->write_byte16_(SYSTEM_MODE_START, MODE_START_SINGLE_SHOT); }
331
333 if (this->is_in_loop_state()) {
334 ESP_LOGD(TAG, "Measurement still running");
335 return;
336 }
337 if (!this->start_ranging_()) {
338 ESP_LOGW(TAG, "Starting measurement failed");
339 this->status_set_warning();
340 this->publish_state(NAN);
341 return;
342 }
344 this->enable_loop();
345}
346
349 if (elapsed < this->budget_ms_)
350 return;
351
352 uint8_t gpio_status;
353 if (!this->read_byte16_(GPIO_TIO_HV_STATUS, &gpio_status) || (gpio_status & 0x01) == 0) {
354 if (elapsed > static_cast<uint32_t>(this->budget_ms_) * 2 + 100) {
355 ESP_LOGW(TAG, "Measurement timed out");
356 this->status_set_warning();
357 this->publish_state(NAN);
358 this->disable_loop();
359 }
360 return;
361 }
362
363 uint8_t result[RESULT_LENGTH];
364 if (this->read_register16(RESULT_RANGE_STATUS, result, sizeof(result)) != i2c::ERROR_OK ||
365 !this->write_byte16_(SYSTEM_INTERRUPT_CLEAR, 0x01)) {
366 ESP_LOGW(TAG, "Reading result failed");
367 this->status_set_warning();
368 this->publish_state(NAN);
369 this->disable_loop();
370 return;
371 }
372 this->disable_loop();
373
374 if (this->first_result_) {
375 // ULD SensorInit: after the first ranging, start VHV calibration from the previous temperature.
376 if (!this->write_byte16_(VHV_CONFIG_TIMEOUT_MACROP_LOOP_BOUND, 0x09) || !this->write_byte16_(VHV_CONFIG_INIT, 0)) {
377 this->status_set_warning();
378 return;
379 }
380 this->first_result_ = false;
381 return;
382 }
383
384 this->status_clear_warning();
385 const uint8_t range_status = result[0] & 0x1F;
386 if (range_status != RANGE_STATUS_VALID) {
387 ESP_LOGD(TAG, "Range status %u", range_status);
388 this->publish_state(NAN);
389 return;
390 }
391 const uint16_t distance_mm = encode_uint16(result[13], result[14]);
392 this->publish_state(distance_mm / 1000.0f);
393}
394
395// Indexed by DistanceMode
396PROGMEM_STRING_TABLE(DistanceModeStrings, "short", "medium", "long");
397
399 LOG_SENSOR("", "VL53L1X", this);
400 LOG_UPDATE_INTERVAL(this);
401 LOG_I2C_DEVICE(this);
402 LOG_PIN(" Enable Pin: ", this->enable_pin_);
403 ESP_LOGCONFIG(TAG,
404 " Distance Mode: %s\n"
405 " Timing Budget: %u ms\n"
406 " ROI: %ux%u\n"
407 " Offset: %d mm",
408 LOG_STR_ARG(DistanceModeStrings::get_log_str(this->distance_mode_, DistanceModeStrings::LAST_INDEX)),
409 this->budget_ms_, this->roi_width_, this->roi_height_, this->offset_mm_);
410 if (this->roi_center_ != 0) {
411 ESP_LOGCONFIG(TAG, " ROI Center: %u", this->roi_center_);
412 }
413}
414
415bool VL53L1XSensor::write_byte16_(uint16_t reg, uint8_t value) {
416 return this->write_register16(reg, &value, 1) == i2c::ERROR_OK;
417}
418
419bool VL53L1XSensor::write_word16_(uint16_t reg, uint16_t value) {
420 const uint8_t data[2] = {static_cast<uint8_t>(value >> 8), static_cast<uint8_t>(value)};
421 return this->write_register16(reg, data, 2) == i2c::ERROR_OK;
422}
423
424bool VL53L1XSensor::read_byte16_(uint16_t reg, uint8_t *value) {
425 return this->read_register16(reg, value, 1) == i2c::ERROR_OK;
426}
427
428bool VL53L1XSensor::read_word16_(uint16_t reg, uint16_t *value) {
429 uint8_t data[2];
430 if (this->read_register16(reg, data, 2) != i2c::ERROR_OK)
431 return false;
432 *value = encode_uint16(data[0], data[1]);
433 return true;
434}
435
436} // namespace esphome::vl53l1x
BedjetMode mode
BedJet operating mode.
uint8_t status
Definition bl0942.h:8
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void mark_failed()
Mark this component as failed.
bool is_in_loop_state() const
Check if this component has completed setup and is in the loop state.
Definition component.h:207
void enable_loop()
Enable this component's loop.
Definition component.h:248
void disable_loop()
Disable this component's loop.
void status_clear_warning()
Definition component.h:296
virtual void digital_write(bool value)=0
ErrorCode write_register16(uint16_t a_register, const uint8_t *data, size_t len) const
write an array of bytes to a specific register in the I²C device
Definition i2c.cpp:46
uint8_t address_
store the address of the device on the bus
Definition i2c.h:327
ErrorCode read_register16(uint16_t a_register, uint8_t *data, size_t len)
reads an array of bytes from a specific register in the I²C device
Definition i2c.cpp:32
void set_i2c_address(uint8_t address)
We store the address of the device on the bus.
Definition i2c.h:151
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:65
bool write_word16_(uint16_t reg, uint16_t value)
Definition vl53l1x.cpp:419
static VL53L1XSensor * first_sensor
Definition vl53l1x.h:50
void fail_at_default_address_(const LogString *message)
Definition vl53l1x.cpp:271
bool write_byte16_(uint16_t reg, uint8_t value)
Definition vl53l1x.cpp:415
bool read_word16_(uint16_t reg, uint16_t *value)
Definition vl53l1x.cpp:428
bool read_byte16_(uint16_t reg, uint8_t *value)
Definition vl53l1x.cpp:424
const LogString * message
Definition component.cpp:35
std::vector< uint8_t > & out
Definition gif.cpp:49
unsigned count
Definition gif.cpp:51
constexpr float BME680_GAS_LOOKUP_TABLE_1[16] PROGMEM
Definition bme680.cpp:27
@ ERROR_OK
No error found during execution of method.
Definition i2c_bus.h:15
ESPHOME_LOG_TAG(TAG, "vl53l1x")
PROGMEM_STRING_TABLE(DistanceModeStrings, "short", "medium", "long")
void progmem_memcpy(void *dst, const void *src, size_t len)
Definition hal.h:56
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.
Definition helpers.h:998
void HOT delay(uint32_t ms)
Definition hal.cpp:85
uint32_t IRAM_ATTR HOT millis()
Definition hal.cpp:25
Application App
Global storage of Application pointer - only one Application can exist.
static void uint32_t