ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
cc1101.cpp
Go to the documentation of this file.
1#include "cc1101.h"
2#include "cc1101pa.h"
4#include "esphome/core/log.h"
5#include <cmath>
6
7namespace esphome::cc1101 {
8
9static const char *const TAG = "cc1101";
10
11static void split_float(float value, int mbits, uint8_t &e, uint32_t &m) {
12 int e_tmp;
13 float m_tmp = std::frexp(value, &e_tmp);
14 if (e_tmp <= mbits) {
15 e = 0;
16 m = 0;
17 return;
18 }
19 e = static_cast<uint8_t>(e_tmp - mbits - 1);
20 m = static_cast<uint32_t>(((m_tmp * 2 - 1) * (1 << (mbits + 1))) + 1) >> 1;
21 if (m == (1UL << mbits)) {
22 e = e + 1;
23 m = 0;
24 }
25}
26
28 // Datasheet defaults
29 memset(&this->state_, 0, sizeof(this->state_));
30 this->state_.GDO2_CFG = 0x0D; // Serial Data (for RX on GDO2)
31 this->state_.GDO1_CFG = 0x2E;
32 this->state_.GDO0_CFG = 0x0D; // Serial Data (for RX on GDO0 / TX Input)
33 this->state_.FIFO_THR = 7;
34 this->state_.SYNC1 = 0xD3;
35 this->state_.SYNC0 = 0x91;
36 this->state_.PKTLEN = 0xFF;
37 this->state_.APPEND_STATUS = 1;
38 this->state_.LENGTH_CONFIG = 1;
39 this->state_.CRC_EN = 1;
40 this->state_.WHITE_DATA = 1;
41 this->state_.FREQ_IF = 0x0F;
42 this->state_.FREQ2 = 0x1E;
43 this->state_.FREQ1 = 0xC4;
44 this->state_.FREQ0 = 0xEC;
45 this->state_.DRATE_E = 0x0C;
46 this->state_.CHANBW_E = 0x02;
47 this->state_.DRATE_M = 0x22;
48 this->state_.SYNC_MODE = 2;
49 this->state_.CHANSPC_E = 2;
50 this->state_.NUM_PREAMBLE = 2;
51 this->state_.CHANSPC_M = 0xF8;
52 this->state_.DEVIATION_M = 7;
53 this->state_.DEVIATION_E = 4;
54 this->state_.RX_TIME = 7;
55 this->state_.CCA_MODE = 3;
56 this->state_.PO_TIMEOUT = 1;
57 this->state_.FOC_LIMIT = 2;
58 this->state_.FOC_POST_K = 1;
59 this->state_.FOC_PRE_K = 2;
60 this->state_.FOC_BS_CS_GATE = 1;
61 this->state_.BS_POST_KP = 1;
62 this->state_.BS_POST_KI = 1;
63 this->state_.BS_PRE_KP = 2;
64 this->state_.BS_PRE_KI = 1;
65 this->state_.MAGN_TARGET = 3;
66 this->state_.AGC_LNA_PRIORITY = 1;
67 this->state_.FILTER_LENGTH = 1;
68 this->state_.WAIT_TIME = 1;
69 this->state_.HYST_LEVEL = 2;
70 this->state_.WOREVT1 = 0x87;
71 this->state_.WOREVT0 = 0x6B;
72 this->state_.RC_CAL = 1;
73 this->state_.EVENT1 = 7;
74 this->state_.RC_PD = 1;
75 this->state_.MIX_CURRENT = 2;
76 this->state_.LODIV_BUF_CURRENT_RX = 1;
77 this->state_.LNA2MIX_CURRENT = 1;
78 this->state_.LNA_CURRENT = 1;
79 this->state_.LODIV_BUF_CURRENT_TX = 1;
80 this->state_.FSCAL3_LO = 9;
81 this->state_.CHP_CURR_CAL_EN = 2;
82 this->state_.FSCAL3_HI = 2;
83 this->state_.FSCAL2 = 0x0A;
84 this->state_.FSCAL1 = 0x20;
85 this->state_.FSCAL0 = 0x0D;
86 this->state_.RCCTRL1 = 0x41;
87 this->state_.FSTEST = 0x59;
88 this->state_.PTEST = 0x7F;
89 this->state_.AGCTEST = 0x3F;
90 this->state_.TEST2 = 0x88;
91 this->state_.TEST1 = 0x31;
92 this->state_.TEST0_LO = 1;
93 this->state_.VCO_SEL_CAL_EN = 1;
94 this->state_.TEST0_HI = 2;
95
96 // PKTCTRL0
97 this->state_.PKT_FORMAT = 3;
98 this->state_.LENGTH_CONFIG = 2;
99 this->state_.FS_AUTOCAL = 1;
100
101 // CRITICAL: Initialize PA Table to avoid transmitting 0 power (Silence)
102 memset(this->pa_table_, 0, sizeof(this->pa_table_));
103}
104
106 this->spi_setup();
107 this->cs_->digital_write(true);
109 this->cs_->digital_write(false);
111 this->cs_->digital_write(true);
113 this->cs_->digital_write(false);
114 delay(5);
115
116 this->strobe_(Command::RES);
117 delay(5);
118
121 this->chip_id_ = encode_uint16(this->state_.PARTNUM, this->state_.VERSION);
122 ESP_LOGD(TAG, "CC1101 found! Chip ID: 0x%04X", this->chip_id_);
123 if (this->state_.VERSION == 0 || this->state_.PARTNUM == 0xFF) {
124 ESP_LOGE(TAG, "Failed to verify CC1101.");
125 this->mark_failed();
126 return;
127 }
128
129 // Setup GDO0 pin if configured
130 if (this->gdo0_pin_ != nullptr) {
131 this->gdo0_pin_->setup();
132 }
133
134 this->initialized_ = true;
135
136 for (uint8_t i = 0; i <= static_cast<uint8_t>(Register::TEST0); i++) {
137 if (i == static_cast<uint8_t>(Register::FSTEST) || i == static_cast<uint8_t>(Register::AGCTEST)) {
138 continue;
139 }
140 this->write_(static_cast<Register>(i));
141 }
143 this->strobe_(Command::RX);
144
145 // Defer pin mode setup until after all components have completed setup()
146 // This handles the case where remote_transmitter runs after CC1101 and changes pin mode
147 if (this->gdo0_pin_ != nullptr) {
148 this->defer([this]() { this->gdo0_pin_->pin_mode(gpio::FLAG_INPUT); });
149 }
150}
151
153 if (this->state_.PKT_FORMAT != static_cast<uint8_t>(PacketFormat::PACKET_FORMAT_FIFO) || this->gdo0_pin_ == nullptr ||
154 !this->gdo0_pin_->digital_read()) {
155 return;
156 }
157
158 // Read state
160 uint8_t rx_bytes = this->state_.NUM_RXBYTES;
161 bool overflow = this->state_.RXFIFO_OVERFLOW;
162 if (overflow || rx_bytes == 0) {
163 ESP_LOGW(TAG, "RX FIFO overflow, flushing");
164 this->enter_idle_();
165 this->strobe_(Command::FRX);
166 this->strobe_(Command::RX);
168 return;
169 }
170
171 // Read packet
172 uint8_t payload_length, expected_rx;
173 if (this->state_.LENGTH_CONFIG == static_cast<uint8_t>(LengthConfig::LENGTH_CONFIG_VARIABLE)) {
174 this->read_(Register::FIFO, &payload_length, 1);
175 expected_rx = payload_length + 1;
176 } else {
177 payload_length = this->state_.PKTLEN;
178 expected_rx = payload_length;
179 }
180 if (payload_length == 0 || payload_length > 64 || rx_bytes != expected_rx) {
181 ESP_LOGW(TAG, "Invalid packet: rx_bytes %u, payload_length %u", rx_bytes, payload_length);
182 this->enter_idle_();
183 this->strobe_(Command::FRX);
184 this->strobe_(Command::RX);
186 return;
187 }
188 this->packet_.resize(payload_length);
189 this->read_(Register::FIFO, this->packet_.data(), payload_length);
190
191 // Read status from registers (more reliable than FIFO status bytes due to timing issues)
192 this->read_(Register::RSSI);
193 this->read_(Register::LQI);
194 float rssi = (this->state_.RSSI * RSSI_STEP) - RSSI_OFFSET;
195 bool crc_ok = (this->state_.LQI & STATUS_CRC_OK_MASK) != 0;
196 uint8_t lqi = this->state_.LQI & STATUS_LQI_MASK;
197 if (this->state_.CRC_EN == 0 || crc_ok) {
198 this->packet_trigger_->trigger(this->packet_, rssi, lqi);
199 }
200
201 // Return to rx
202 this->enter_idle_();
203 this->strobe_(Command::FRX);
204 this->strobe_(Command::RX);
206}
207
209 static const char *const MODULATION_NAMES[] = {"2-FSK", "GFSK", "UNUSED", "ASK/OOK",
210 "4-FSK", "UNUSED", "UNUSED", "MSK"};
211 int32_t freq = static_cast<int32_t>(this->state_.FREQ2 << 16 | this->state_.FREQ1 << 8 | this->state_.FREQ0) *
212 XTAL_FREQUENCY / (1 << 16);
213 float symbol_rate = (((256.0f + this->state_.DRATE_M) * (1 << this->state_.DRATE_E)) / (1 << 28)) * XTAL_FREQUENCY;
214 float bw = XTAL_FREQUENCY / (8.0f * (4 + this->state_.CHANBW_M) * (1 << this->state_.CHANBW_E));
215 ESP_LOGCONFIG(TAG, "CC1101:");
216 LOG_PIN(" CS Pin: ", this->cs_);
217 ESP_LOGCONFIG(TAG,
218 " Chip ID: 0x%04X\n"
219 " Frequency: %" PRId32 " Hz\n"
220 " Channel: %u\n"
221 " Modulation: %s\n"
222 " Symbol Rate: %.0f baud\n"
223 " Filter Bandwidth: %.1f Hz\n"
224 " Output Power: %.1f dBm",
225 this->chip_id_, freq, this->state_.CHANNR, MODULATION_NAMES[this->state_.MOD_FORMAT & 0x07],
226 symbol_rate, bw, this->output_power_effective_);
227}
228
230 // Ensure Packet Format is 3 (Async Serial)
231 this->write_(Register::PKTCTRL0, 0x32);
232 ESP_LOGV(TAG, "Beginning TX sequence");
233 if (this->gdo0_pin_ != nullptr) {
235 }
236 this->strobe_(Command::TX);
237 if (!this->wait_for_state_(State::TX, 50)) {
238 ESP_LOGW(TAG, "Timed out waiting for TX state!");
239 }
240}
241
243 ESP_LOGV(TAG, "Beginning RX sequence");
244 if (this->gdo0_pin_ != nullptr) {
246 }
247 this->strobe_(Command::RX);
248}
249
251 this->strobe_(Command::RES);
252 this->setup();
253}
254
256 ESP_LOGV(TAG, "Setting IDLE state");
257 this->enter_idle_();
258}
259
260bool CC1101Component::wait_for_state_(State target_state, uint32_t timeout_ms) {
261 uint32_t start = millis();
262 while (millis() - start < timeout_ms) {
264 State s = static_cast<State>(this->state_.MARC_STATE);
265 if (s == target_state) {
266 return true;
267 }
269 }
270 return false;
271}
272
277
279 uint8_t index = static_cast<uint8_t>(cmd);
280 if (cmd < Command::RES || cmd > Command::NOP) {
281 return 0xFF;
282 }
283 this->enable();
284 uint8_t status_byte = this->transfer_byte(index);
285 this->disable();
286 return status_byte;
287}
288
290 uint8_t index = static_cast<uint8_t>(reg);
291 this->enable();
292 this->write_byte(index);
293 this->write_array(&this->state_.regs()[index], 1);
294 this->disable();
295}
296
297void CC1101Component::write_(Register reg, uint8_t value) {
298 uint8_t index = static_cast<uint8_t>(reg);
299 this->state_.regs()[index] = value;
300 this->write_(reg);
301}
302
303void CC1101Component::write_(Register reg, const uint8_t *buffer, size_t length) {
304 uint8_t index = static_cast<uint8_t>(reg);
305 this->enable();
306 this->write_byte(index | BUS_WRITE | BUS_BURST);
307 this->write_array(buffer, length);
308 this->disable();
309}
310
312 uint8_t index = static_cast<uint8_t>(reg);
313 this->enable();
314 this->write_byte(index | BUS_READ | BUS_BURST);
315 this->state_.regs()[index] = this->transfer_byte(0);
316 this->disable();
317}
318
319void CC1101Component::read_(Register reg, uint8_t *buffer, size_t length) {
320 uint8_t index = static_cast<uint8_t>(reg);
321 this->enable();
322 this->write_byte(index | BUS_READ | BUS_BURST);
323 this->read_array(buffer, length);
324 this->disable();
325}
326
327CC1101Error CC1101Component::transmit_packet(const std::vector<uint8_t> &packet) {
328 if (this->state_.PKT_FORMAT != static_cast<uint8_t>(PacketFormat::PACKET_FORMAT_FIFO)) {
329 return CC1101Error::PARAMS;
330 }
331
332 // Write packet
333 this->enter_idle_();
334 this->strobe_(Command::FTX);
335 if (this->state_.LENGTH_CONFIG == static_cast<uint8_t>(LengthConfig::LENGTH_CONFIG_VARIABLE)) {
336 this->write_(Register::FIFO, static_cast<uint8_t>(packet.size()));
337 }
338 this->write_(Register::FIFO, packet.data(), packet.size());
339 this->strobe_(Command::TX);
340 if (!this->wait_for_state_(State::IDLE, 1000)) {
341 ESP_LOGW(TAG, "TX timeout");
342 this->enter_idle_();
343 this->strobe_(Command::RX);
346 }
347
348 // Return to rx
349 this->strobe_(Command::RX);
351 return CC1101Error::NONE;
352}
353
354// Setters
356 this->output_power_requested_ = value;
357 int32_t freq = static_cast<int32_t>(this->state_.FREQ2 << 16 | this->state_.FREQ1 << 8 | this->state_.FREQ0) *
358 XTAL_FREQUENCY / (1 << 16);
359 uint8_t a = 0xC0;
360 if (freq >= 300000000 && freq <= 348000000) {
361 a = PowerTableItem::find(PA_TABLE_315, sizeof(PA_TABLE_315) / sizeof(PA_TABLE_315[0]), value);
362 } else if (freq >= 378000000 && freq <= 464000000) {
363 a = PowerTableItem::find(PA_TABLE_433, sizeof(PA_TABLE_433) / sizeof(PA_TABLE_433[0]), value);
364 } else if (freq >= 779000000 && freq < 900000000) {
365 a = PowerTableItem::find(PA_TABLE_868, sizeof(PA_TABLE_868) / sizeof(PA_TABLE_868[0]), value);
366 } else if (freq >= 900000000 && freq <= 928000000) {
367 a = PowerTableItem::find(PA_TABLE_915, sizeof(PA_TABLE_915) / sizeof(PA_TABLE_915[0]), value);
368 }
369
370 if (static_cast<Modulation>(this->state_.MOD_FORMAT) == Modulation::MODULATION_ASK_OOK) {
371 this->pa_table_[0] = 0;
372 this->pa_table_[1] = a;
373 } else {
374 this->pa_table_[0] = a;
375 this->pa_table_[1] = 0;
376 }
377 this->output_power_effective_ = value;
378 if (this->initialized_) {
379 this->write_(Register::PATABLE, this->pa_table_, sizeof(this->pa_table_));
380 }
381}
382
384 this->state_.CLOSE_IN_RX = static_cast<uint8_t>(value);
385 if (this->initialized_) {
387 }
388}
389
391 this->state_.DEM_DCFILT_OFF = value ? 0 : 1;
392 if (this->initialized_) {
394 }
395}
396
398 int32_t freq = static_cast<int32_t>(value * (1 << 16) / XTAL_FREQUENCY);
399 this->state_.FREQ2 = static_cast<uint8_t>(freq >> 16);
400 this->state_.FREQ1 = static_cast<uint8_t>(freq >> 8);
401 this->state_.FREQ0 = static_cast<uint8_t>(freq);
402 if (this->initialized_) {
403 this->enter_idle_();
404 this->write_(Register::FREQ2);
405 this->write_(Register::FREQ1);
406 this->write_(Register::FREQ0);
407 this->strobe_(Command::RX);
408 }
409}
410
412 this->state_.FREQ_IF = value * (1 << 10) / XTAL_FREQUENCY;
413 if (this->initialized_) {
415 }
416}
417
419 uint8_t e;
420 uint32_t m;
421 split_float(XTAL_FREQUENCY / (value * 8), 2, e, m);
422 this->state_.CHANBW_E = e;
423 this->state_.CHANBW_M = static_cast<uint8_t>(m);
424 if (this->initialized_) {
426 }
427}
428
429void CC1101Component::set_channel(uint8_t value) {
430 this->state_.CHANNR = value;
431 if (this->initialized_) {
432 this->enter_idle_();
434 this->strobe_(Command::RX);
435 }
436}
437
439 uint8_t e;
440 uint32_t m;
441 split_float(value * (1 << 18) / XTAL_FREQUENCY, 8, e, m);
442 this->state_.CHANSPC_E = e;
443 this->state_.CHANSPC_M = static_cast<uint8_t>(m);
444 if (this->initialized_) {
447 }
448}
449
451 uint8_t e;
452 uint32_t m;
453 split_float(value * (1 << 17) / XTAL_FREQUENCY, 3, e, m);
454 this->state_.DEVIATION_E = e;
455 this->state_.DEVIATION_M = static_cast<uint8_t>(m);
456 if (this->initialized_) {
458 }
459}
460
462 this->state_.DEVIATION_E = 0;
463 this->state_.DEVIATION_M = value - 1;
464 if (this->initialized_) {
466 }
467}
468
470 uint8_t e;
471 uint32_t m;
472 split_float(value * (1 << 28) / XTAL_FREQUENCY, 8, e, m);
473 this->state_.DRATE_E = e;
474 this->state_.DRATE_M = static_cast<uint8_t>(m);
475 if (this->initialized_) {
478 }
479}
480
482 this->state_.SYNC_MODE = static_cast<uint8_t>(value);
483 if (this->initialized_) {
485 }
486}
487
489 this->state_.CARRIER_SENSE_ABOVE_THRESHOLD = value ? 1 : 0;
490 if (this->initialized_) {
492 }
493}
494
496 this->state_.MOD_FORMAT = static_cast<uint8_t>(value);
497 this->state_.PA_POWER = value == Modulation::MODULATION_ASK_OOK ? 1 : 0;
498 if (this->initialized_) {
499 this->enter_idle_();
503 this->strobe_(Command::RX);
504 }
505}
506
508 this->state_.MANCHESTER_EN = value ? 1 : 0;
509 if (this->initialized_) {
511 }
512}
513
515 this->state_.NUM_PREAMBLE = value;
516 if (this->initialized_) {
518 }
519}
520
521void CC1101Component::set_sync1(uint8_t value) {
522 this->state_.SYNC1 = value;
523 if (this->initialized_) {
524 this->write_(Register::SYNC1);
525 }
526}
527
528void CC1101Component::set_sync0(uint8_t value) {
529 this->state_.SYNC0 = value;
530 if (this->initialized_) {
531 this->write_(Register::SYNC0);
532 }
533}
534
536 this->state_.MAGN_TARGET = static_cast<uint8_t>(value);
537 if (this->initialized_) {
539 }
540}
541
543 this->state_.MAX_LNA_GAIN = static_cast<uint8_t>(value);
544 if (this->initialized_) {
546 }
547}
548
550 this->state_.MAX_DVGA_GAIN = static_cast<uint8_t>(value);
551 if (this->initialized_) {
553 }
554}
555
557 this->state_.CARRIER_SENSE_ABS_THR = static_cast<uint8_t>(value & 0b1111);
558 if (this->initialized_) {
560 }
561}
562
564 this->state_.CARRIER_SENSE_REL_THR = static_cast<uint8_t>(value);
565 if (this->initialized_) {
567 }
568}
569
571 this->state_.AGC_LNA_PRIORITY = value ? 1 : 0;
572 if (this->initialized_) {
574 }
575}
576
578 this->state_.FILTER_LENGTH = static_cast<uint8_t>(value);
579 if (this->initialized_) {
581 }
582}
583
585 this->state_.FILTER_LENGTH = static_cast<uint8_t>(value);
586 if (this->initialized_) {
588 }
589}
590
592 this->state_.AGC_FREEZE = static_cast<uint8_t>(value);
593 if (this->initialized_) {
595 }
596}
597
599 this->state_.WAIT_TIME = static_cast<uint8_t>(value);
600 if (this->initialized_) {
602 }
603}
604
606 this->state_.HYST_LEVEL = static_cast<uint8_t>(value);
607 if (this->initialized_) {
609 }
610}
611
613 this->state_.PKT_FORMAT =
615 if (value) {
616 // Configure GDO0 for FIFO status (asserts on RX FIFO threshold or end of packet)
617 this->state_.GDO0_CFG = 0x01;
618 // Set max RX FIFO threshold to ensure we only trigger on end-of-packet
619 this->state_.FIFO_THR = 15;
620 // Don't append status bytes to FIFO - we read from registers instead
621 this->state_.APPEND_STATUS = 0;
622 } else {
623 // Configure GDO0 for serial data (async serial mode)
624 this->state_.GDO0_CFG = 0x0D;
625 }
626 if (this->initialized_) {
631 }
632}
633
635 if (value == 0) {
636 this->state_.LENGTH_CONFIG = static_cast<uint8_t>(LengthConfig::LENGTH_CONFIG_VARIABLE);
637 } else {
638 this->state_.LENGTH_CONFIG = static_cast<uint8_t>(LengthConfig::LENGTH_CONFIG_FIXED);
639 this->state_.PKTLEN = value;
640 }
641 if (this->initialized_) {
644 }
645}
646
648 this->state_.CRC_EN = value ? 1 : 0;
649 if (this->initialized_) {
651 }
652}
653
655 this->state_.WHITE_DATA = value ? 1 : 0;
656 if (this->initialized_) {
658 }
659}
660
661} // namespace esphome::cc1101
uint8_t m
Definition bl0906.h:1
virtual void mark_failed()
Mark this component as failed.
void defer(const std::string &name, std::function< void()> &&f)
Defer a callback to the next loop() call.
virtual void pin_mode(gpio::Flags flags)=0
virtual void setup()=0
virtual void digital_write(bool value)=0
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
Definition automation.h:204
void set_packet_mode(bool value)
Definition cc1101.cpp:612
void set_max_dvga_gain(MaxDvgaGain value)
Definition cc1101.cpp:549
void set_whitening(bool value)
Definition cc1101.cpp:654
void set_carrier_sense_above_threshold(bool value)
Definition cc1101.cpp:488
void write_(Register reg)
Definition cc1101.cpp:289
void set_sync0(uint8_t value)
Definition cc1101.cpp:528
void set_freeze(Freeze value)
Definition cc1101.cpp:591
void set_rx_attenuation(RxAttenuation value)
Definition cc1101.cpp:383
InternalGPIOPin * gdo0_pin_
Definition cc1101.h:89
void set_symbol_rate(float value)
Definition cc1101.cpp:469
uint8_t strobe_(Command cmd)
Definition cc1101.cpp:278
void set_sync_mode(SyncMode value)
Definition cc1101.cpp:481
void set_fsk_deviation(float value)
Definition cc1101.cpp:450
void set_msk_deviation(uint8_t value)
Definition cc1101.cpp:461
void set_carrier_sense_rel_thr(CarrierSenseRelThr value)
Definition cc1101.cpp:563
uint8_t pa_table_[PA_TABLE_SIZE]
Definition cc1101.h:84
void set_lna_priority(bool value)
Definition cc1101.cpp:570
void set_output_power(float value)
Definition cc1101.cpp:355
void set_modulation_type(Modulation value)
Definition cc1101.cpp:495
void set_if_frequency(float value)
Definition cc1101.cpp:411
void set_frequency(float value)
Definition cc1101.cpp:397
void set_num_preamble(uint8_t value)
Definition cc1101.cpp:514
void set_hyst_level(HystLevel value)
Definition cc1101.cpp:605
void set_filter_bandwidth(float value)
Definition cc1101.cpp:418
void set_filter_length_fsk_msk(FilterLengthFskMsk value)
Definition cc1101.cpp:577
void set_crc_enable(bool value)
Definition cc1101.cpp:647
void set_carrier_sense_abs_thr(int8_t value)
Definition cc1101.cpp:556
void set_magn_target(MagnTarget value)
Definition cc1101.cpp:535
void set_channel_spacing(float value)
Definition cc1101.cpp:438
CC1101Error transmit_packet(const std::vector< uint8_t > &packet)
Definition cc1101.cpp:327
void set_wait_time(WaitTime value)
Definition cc1101.cpp:598
void set_dc_blocking_filter(bool value)
Definition cc1101.cpp:390
void set_packet_length(uint8_t value)
Definition cc1101.cpp:634
void set_manchester(bool value)
Definition cc1101.cpp:507
std::vector< uint8_t > packet_
Definition cc1101.h:93
void set_channel(uint8_t value)
Definition cc1101.cpp:429
void set_filter_length_ask_ook(FilterLengthAskOok value)
Definition cc1101.cpp:584
void set_max_lna_gain(MaxLnaGain value)
Definition cc1101.cpp:542
Trigger< std::vector< uint8_t >, float, uint8_t > * packet_trigger_
Definition cc1101.h:92
void set_sync1(uint8_t value)
Definition cc1101.cpp:521
bool wait_for_state_(State target_state, uint32_t timeout_ms=100)
Definition cc1101.cpp:260
@ FLAG_OUTPUT
Definition gpio.h:19
@ FLAG_INPUT
Definition gpio.h:18
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
Definition core.cpp:28
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:420
void IRAM_ATTR HOT delay(uint32_t ms)
Definition core.cpp:26
uint32_t IRAM_ATTR HOT millis()
Definition core.cpp:25
static uint8_t find(const PowerTableItem *items, size_t count, float &dbm_target)
Definition cc1101pa.h:15
uint16_t length
Definition tt21100.cpp:0