| SX126x-Arduino 2.0.1

sx126x.h
Go to the documentation of this file.
1
23 #ifndef __SX126x_H__
24 #define __SX126x_H__
25
26 extern "C"
27 {
28 #define SX1261 1
29 #define SX1262 2
30
34 #define RADIO_TCXO_SETUP_TIME 50 // [ms]
35
39 #define RADIO_WAKEUP_TIME 3 // [ms]
40
44 #define AUTO_RX_TX_OFFSET 2
45
49 #define CRC_IBM_SEED 0xFFFF
50
54 #define CRC_CCITT_SEED 0x1D0F
55
59 #define CRC_POLYNOMIAL_IBM 0x8005
60
64 #define CRC_POLYNOMIAL_CCITT 0x1021
65
70 #define REG_LR_CRCSEEDBASEADDR 0x06BC
71
75 #define REG_LR_CRCPOLYBASEADDR 0x06BE
76
80 #define REG_LR_WHITSEEDBASEADDR_MSB 0x06B8
81 #define REG_LR_WHITSEEDBASEADDR_LSB 0x06B9
82
86 #define REG_LR_PACKETPARAMS 0x0704
87
91 #define REG_LR_PAYLOADLENGTH 0x0702
92
96 #define REG_LR_SYNCWORDBASEADDRESS 0x06C0
97
101 #define REG_LR_SYNCWORD 0x0740
102
106 #define LORA_MAC_PRIVATE_SYNCWORD 0x1424
107
111 #define LORA_MAC_PUBLIC_SYNCWORD 0x3444
112
116 #define RANDOM_NUMBER_GENERATORBASEADDR 0x0819
117
121 #define REG_RX_GAIN 0x08AC
122
126 #define REG_XTA_TRIM 0x0911
127
131 #define REG_OCP 0x08E7
132
136 typedef union RadioStatus_u {
137 uint8_t Value;
138 struct
139 { //bit order is lsb -> msb
140 uint8_t Reserved : 1;
141 uint8_t CmdStatus : 3;
142 uint8_t ChipMode : 3;
143 uint8_t CpuBusy : 1;
144 } Fields;
145 } RadioStatus_t;
146
150 typedef enum
151 {
152 IRQ_HEADER_ERROR_CODE = 0x01,
153 IRQ_SYNCWORD_ERROR_CODE = 0x02,
154 IRQ_CRC_ERROR_CODE = 0x04,
155 } IrqErrorCode_t;
156
157 enum IrqPblSyncHeaderCode_t
158 {
159 IRQ_PBL_DETECT_CODE = 0x01,
160 IRQ_SYNCWORD_VALID_CODE = 0x02,
161 IRQ_HEADER_VALID_CODE = 0x04,
162 };
163
167 typedef enum
168 {
169 MODE_SLEEP = 0x00,
170 MODE_STDBY_RC,
171 MODE_STDBY_XOSC,
172 MODE_FS,
173 MODE_TX,
174 MODE_RX,
175 MODE_RX_DC,
176 MODE_CAD
177 } RadioOperatingModes_t;
178
185 typedef enum
186 {
187 STDBY_RC = 0x00,
188 STDBY_XOSC = 0x01,
189 } RadioStandbyModes_t;
190
197 typedef enum
198 {
199 USE_LDO = 0x00, // default
200 USE_DCDC = 0x01,
201 } RadioRegulatorMode_t;
202
206 typedef enum
207 {
208 PACKET_TYPE_GFSK = 0x00,
209 PACKET_TYPE_LORA = 0x01,
210 PACKET_TYPE_NONE = 0x0F,
211 } RadioPacketTypes_t;
212
216 typedef enum
217 {
218 RADIO_RAMP_10_US = 0x00,
219 RADIO_RAMP_20_US = 0x01,
220 RADIO_RAMP_40_US = 0x02,
221 RADIO_RAMP_80_US = 0x03,
222 RADIO_RAMP_200_US = 0x04,
223 RADIO_RAMP_800_US = 0x05,
224 RADIO_RAMP_1700_US = 0x06,
225 RADIO_RAMP_3400_US = 0x07,
226 } RadioRampTimes_t;
227
231 typedef enum
232 {
233 LORA_CAD_01_SYMBOL = 0x00,
234 LORA_CAD_02_SYMBOL = 0x01,
235 LORA_CAD_04_SYMBOL = 0x02,
236 LORA_CAD_08_SYMBOL = 0x03,
237 LORA_CAD_16_SYMBOL = 0x04,
238 } RadioLoRaCadSymbols_t;
239
243 typedef enum
244 {
245 LORA_CAD_ONLY = 0x00,
246 LORA_CAD_RX = 0x01,
247 LORA_CAD_LBT = 0x10,
248 } RadioCadExitModes_t;
249
253 typedef enum
254 {
255 MOD_SHAPING_OFF = 0x00,
256 MOD_SHAPING_G_BT_03 = 0x08,
257 MOD_SHAPING_G_BT_05 = 0x09,
258 MOD_SHAPING_G_BT_07 = 0x0A,
259 MOD_SHAPING_G_BT_1 = 0x0B,
260 } RadioModShapings_t;
261
265 typedef enum
266 {
267 RX_BW_4800 = 0x1F,
268 RX_BW_5800 = 0x17,
269 RX_BW_7300 = 0x0F,
270 RX_BW_9700 = 0x1E,
271 RX_BW_11700 = 0x16,
272 RX_BW_14600 = 0x0E,
273 RX_BW_19500 = 0x1D,
274 RX_BW_23400 = 0x15,
275 RX_BW_29300 = 0x0D,
276 RX_BW_39000 = 0x1C,
277 RX_BW_46900 = 0x14,
278 RX_BW_58600 = 0x0C,
279 RX_BW_78200 = 0x1B,
280 RX_BW_93800 = 0x13,
281 RX_BW_117300 = 0x0B,
282 RX_BW_156200 = 0x1A,
283 RX_BW_187200 = 0x12,
284 RX_BW_234300 = 0x0A,
285 RX_BW_312000 = 0x19,
286 RX_BW_373600 = 0x11,
287 RX_BW_467000 = 0x09,
288 } RadioRxBandwidth_t;
289
293 typedef enum
294 {
295 LORA_SF5 = 0x05,
296 LORA_SF6 = 0x06,
297 LORA_SF7 = 0x07,
298 LORA_SF8 = 0x08,
299 LORA_SF9 = 0x09,
300 LORA_SF10 = 0x0A,
301 LORA_SF11 = 0x0B,
302 LORA_SF12 = 0x0C,
303 } RadioLoRaSpreadingFactors_t;
304
308 typedef enum
309 {
310 LORA_BW_500 = 6,
311 LORA_BW_250 = 5,
312 LORA_BW_125 = 4,
313 LORA_BW_062 = 3,
314 LORA_BW_041 = 10,
315 LORA_BW_031 = 2,
316 LORA_BW_020 = 9,
317 LORA_BW_015 = 1,
318 LORA_BW_010 = 8,
319 LORA_BW_007 = 0,
320 } RadioLoRaBandwidths_t;
321
325 typedef enum
326 {
327 LORA_CR_4_5 = 0x01,
328 LORA_CR_4_6 = 0x02,
329 LORA_CR_4_7 = 0x03,
330 LORA_CR_4_8 = 0x04,
331 } RadioLoRaCodingRates_t;
332
336 typedef enum
337 {
338 RADIO_PREAMBLE_DETECTOR_OFF = 0x00,
339 RADIO_PREAMBLE_DETECTOR_08_BITS = 0x04,
340 RADIO_PREAMBLE_DETECTOR_16_BITS = 0x05,
341 RADIO_PREAMBLE_DETECTOR_24_BITS = 0x06,
342 RADIO_PREAMBLE_DETECTOR_32_BITS = 0x07,
343 } RadioPreambleDetection_t;
344
348 typedef enum
349 {
350 RADIO_ADDRESSCOMP_FILT_OFF = 0x00,
351 RADIO_ADDRESSCOMP_FILT_NODE = 0x01,
352 RADIO_ADDRESSCOMP_FILT_NODE_BROAD = 0x02,
353 } RadioAddressComp_t;
354
358 typedef enum
359 {
360 RADIO_PACKET_FIXED_LENGTH = 0x00,
361 RADIO_PACKET_VARIABLE_LENGTH = 0x01,
362 } RadioPacketLengthModes_t;
363
367 typedef enum
368 {
369 RADIO_CRC_OFF = 0x01,
370 RADIO_CRC_1_BYTES = 0x00,
371 RADIO_CRC_2_BYTES = 0x02,
372 RADIO_CRC_1_BYTES_INV = 0x04,
373 RADIO_CRC_2_BYTES_INV = 0x06,
374 RADIO_CRC_2_BYTES_IBM = 0xF1,
375 RADIO_CRC_2_BYTES_CCIT = 0xF2,
376 } RadioCrcTypes_t;
377
381 typedef enum
382 {
383 RADIO_DC_FREE_OFF = 0x00,
384 RADIO_DC_FREEWHITENING = 0x01,
385 } RadioDcFree_t;
386
390 typedef enum
391 {
392 LORA_PACKET_VARIABLE_LENGTH = 0x00,
393 LORA_PACKET_FIXED_LENGTH = 0x01,
394 LORA_PACKET_EXPLICIT = LORA_PACKET_VARIABLE_LENGTH,
395 LORA_PACKET_IMPLICIT = LORA_PACKET_FIXED_LENGTH,
396 } RadioLoRaPacketLengthsMode_t;
397
401 typedef enum
402 {
403 LORA_CRC_ON = 0x01,
404 LORA_CRC_OFF = 0x00,
405 } RadioLoRaCrcModes_t;
406
410 typedef enum
411 {
412 LORA_IQ_NORMAL = 0x00,
413 LORA_IQ_INVERTED = 0x01,
414 } RadioLoRaIQModes_t;
415
419 typedef enum
420 {
421 TCXO_CTRL_1_6V = 0x00,
422 TCXO_CTRL_1_7V = 0x01,
423 TCXO_CTRL_1_8V = 0x02,
424 TCXO_CTRL_2_2V = 0x03,
425 TCXO_CTRL_2_4V = 0x04,
426 TCXO_CTRL_2_7V = 0x05,
427 TCXO_CTRL_3_0V = 0x06,
428 TCXO_CTRL_3_3V = 0x07,
429 } RadioTcxoCtrlVoltage_t;
430
436 typedef enum
437 {
438 IRQ_RADIO_NONE = 0x0000,
439 IRQ_TX_DONE = 0x0001,
440 IRQ_RX_DONE = 0x0002,
441 IRQ_PREAMBLE_DETECTED = 0x0004,
442 IRQ_SYNCWORD_VALID = 0x0008,
443 IRQ_HEADER_VALID = 0x0010,
444 IRQ_HEADER_ERROR = 0x0020,
445 IRQ_CRC_ERROR = 0x0040,
446 IRQ_CAD_DONE = 0x0080,
447 IRQ_CAD_ACTIVITY_DETECTED = 0x0100,
448 IRQ_RX_TX_TIMEOUT = 0x0200,
449 IRQ_RADIO_ALL = 0xFFFF,
450 } RadioIrqMasks_t;
451
455 typedef enum RadioCommands_e
456 {
457 RADIO_GET_STATUS = 0xC0,
458 RADIO_WRITE_REGISTER = 0x0D,
459 RADIO_READ_REGISTER = 0x1D,
460 RADIO_WRITE_BUFFER = 0x0E,
461 RADIO_READ_BUFFER = 0x1E,
462 RADIO_SET_SLEEP = 0x84,
463 RADIO_SET_STANDBY = 0x80,
464 RADIO_SET_FS = 0xC1,
465 RADIO_SET_TX = 0x83,
466 RADIO_SET_RX = 0x82,
467 RADIO_SET_RXDUTYCYCLE = 0x94,
468 RADIO_SET_CAD = 0xC5,
469 RADIO_SET_TXCONTINUOUSWAVE = 0xD1,
470 RADIO_SET_TXCONTINUOUSPREAMBLE = 0xD2,
471 RADIO_SET_PACKETTYPE = 0x8A,
472 RADIO_GET_PACKETTYPE = 0x11,
473 RADIO_SET_RFFREQUENCY = 0x86,
474 RADIO_SET_TXPARAMS = 0x8E,
475 RADIO_SET_PACONFIG = 0x95,
476 RADIO_SET_CADPARAMS = 0x88,
477 RADIO_SET_BUFFERBASEADDRESS = 0x8F,
478 RADIO_SET_MODULATIONPARAMS = 0x8B,
479 RADIO_SET_PACKETPARAMS = 0x8C,
480 RADIO_GET_RXBUFFERSTATUS = 0x13,
481 RADIO_GET_PACKETSTATUS = 0x14,
482 RADIO_GET_RSSIINST = 0x15,
483 RADIO_GET_STATS = 0x10,
484 RADIO_RESET_STATS = 0x00,
485 RADIO_CFG_DIOIRQ = 0x08,
486 RADIO_GET_IRQSTATUS = 0x12,
487 RADIO_CLR_IRQSTATUS = 0x02,
488 RADIO_CALIBRATE = 0x89,
489 RADIO_CALIBRATEIMAGE = 0x98,
490 RADIO_SET_REGULATORMODE = 0x96,
491 RADIO_GET_ERROR = 0x17,
492 RADIO_CLR_ERROR = 0x07,
493 RADIO_SET_TCXOMODE = 0x97,
494 RADIO_SET_TXFALLBACKMODE = 0x93,
495 RADIO_SET_RFSWITCHMODE = 0x9D,
496 RADIO_SET_STOPRXTIMERONPREAMBLE = 0x9F,
497 RADIO_SET_LORASYMBTIMEOUT = 0xA0,
498 } RadioCommands_t;
499
503 typedef struct
504 {
505 RadioPacketTypes_t PacketType;
506 struct
507 {
508 struct
509 {
510 uint32_t BitRate;
511 uint32_t Fdev;
512 RadioModShapings_t ModulationShaping;
513 uint8_t Bandwidth;
514 } Gfsk;
515 struct
516 {
517 RadioLoRaSpreadingFactors_t SpreadingFactor;
518 RadioLoRaBandwidths_t Bandwidth;
519 RadioLoRaCodingRates_t CodingRate;
520 uint8_t LowDatarateOptimize;
521 } LoRa;
522 } Params;
523 } ModulationParams_t;
524
528 typedef struct
529 {
530 RadioPacketTypes_t PacketType;
531 struct
532 {
536 struct
537 {
538 uint16_t PreambleLength;
539 RadioPreambleDetection_t PreambleMinDetect;
540 uint8_t SyncWordLength;
541 RadioAddressComp_t AddrComp;
542 RadioPacketLengthModes_t HeaderType;
543 uint8_t PayloadLength;
544 RadioCrcTypes_t CrcLength;
545 RadioDcFree_t DcFree;
546 } Gfsk;
550 struct
551 {
552 uint16_t PreambleLength;
553 RadioLoRaPacketLengthsMode_t HeaderType;
554 uint8_t PayloadLength;
555 RadioLoRaCrcModes_t CrcMode;
556 RadioLoRaIQModes_t InvertIQ;
557 } LoRa;
558 } Params;
559 } PacketParams_t;
560
564 typedef struct
565 {
566 RadioPacketTypes_t packetType;
567 struct
568 {
569 struct
570 {
571 uint8_t RxStatus;
572 int8_t RssiAvg;
573 int8_t RssiSync;
574 uint32_t FreqError;
575 } Gfsk;
576 struct
577 {
578 int8_t RssiPkt;
579 int8_t SnrPkt;
580 int8_t SignalRssiPkt;
581 uint32_t FreqError;
582 } LoRa;
583 } Params;
584 } PacketStatus_t;
585
589 typedef struct
590 {
591 RadioPacketTypes_t packetType;
592 uint16_t PacketReceived;
593 uint16_t CrcOk;
594 uint16_t LengthError;
595 } RxCounter_t;
596
600 typedef union {
601 struct
602 {
603 uint8_t RC64KEnable : 1;
604 uint8_t RC13MEnable : 1;
605 uint8_t PLLEnable : 1;
606 uint8_t ADCPulseEnable : 1;
607 uint8_t ADCBulkNEnable : 1;
608 uint8_t ADCBulkPEnable : 1;
609 uint8_t ImgEnable : 1;
610 uint8_t : 1;
611 } Fields;
612 uint8_t Value;
613 } CalibrationParams_t;
614
618 typedef union {
619 struct
620 {
621 uint8_t WakeUpRTC : 1;
622 uint8_t Reset : 1;
623 uint8_t WarmStart : 1;
624 uint8_t Reserved : 5;
625 } Fields;
626 uint8_t Value;
627 } SleepParams_t;
628
632 typedef union {
633 struct
634 {
635 uint8_t Rc64kCalib : 1;
636 uint8_t Rc13mCalib : 1;
637 uint8_t PllCalib : 1;
638 uint8_t AdcCalib : 1;
639 uint8_t ImgCalib : 1;
640 uint8_t XoscStart : 1;
641 uint8_t PllLock : 1;
642 uint8_t BuckStart : 1;
643 uint8_t PaRamp : 1;
644 uint8_t : 7;
645 } Fields;
646 uint16_t Value;
647 } RadioError_t;
648
652 typedef struct SX126x_s
653 {
654 int Reset;
655 int BUSY;
656 int DIO1;
657 int DIO2;
658 int DIO3;
659 int Spi;
660 PacketParams_t PacketParams;
661 PacketStatus_t PacketStatus;
662 ModulationParams_t ModulationParams;
663 } SX126x_t;
664
668 typedef void(DioIrqHandler)(void);
669
679 #define XTAL_FREQ (double)32000000
680 #define FREQ_DIV (double)pow(2.0, 25.0)
681 #define FREQ_STEP (double)(XTAL_FREQ / FREQ_DIV)
682
683 #define RX_BUFFER_SIZE 256
684
689 typedef struct
690 {
691 void (*txDone)(void);
692 void (*rxDone)(void);
693 void (*rxPreambleDetect)(void);
694 void (*rxSyncWordDone)(void);
695 void (*rxHeaderDone)(bool isOk);
696 void (*txTimeout)(void);
697 void (*rxTimeout)(void);
698 void (*rxError)(IrqErrorCode_t errCode);
699 void (*cadDone)(bool cadFlag);
700 } SX126xCallbacks_t;
701
711 void SX126xInit(DioIrqHandler dioIrq);
712
716 void SX126xReInit(DioIrqHandler dioIrq);
717
723 RadioOperatingModes_t SX126xGetOperatingMode(void);
724
733 void SX126xSetOperatingMode(RadioOperatingModes_t mode);
734
738 void SX126xCheckDeviceReady(void);
739
746 void SX126xSetPayload(uint8_t *payload, uint8_t size);
747
756 uint8_t SX126xGetPayload(uint8_t *payload, uint8_t *size, uint8_t maxSize);
757
765 void SX126xSendPayload(uint8_t *payload, uint8_t size, uint32_t timeout);
766
774 uint8_t SX126xSetSyncWord(uint8_t *syncWord);
775
782 void SX126xSetCrcSeed(uint16_t seed);
783
790 void SX126xSetCrcPolynomial(uint16_t polynomial);
791
797 void SX126xSetWhiteningSeed(uint16_t seed);
798
806 uint32_t SX126xGetRandom(void);
807
814 void SX126xSetSleep(SleepParams_t sleepConfig);
815
821 void SX126xSetStandby(RadioStandbyModes_t mode);
822
826 void SX126xSetFs(void);
827
833 void SX126xSetTx(uint32_t timeout);
834
840 void SX126xSetRx(uint32_t timeout);
841
847 void SX126xSetRxBoosted(uint32_t timeout);
848
855 void SX126xSetRxDutyCycle(uint32_t rxTime, uint32_t sleepTime);
856
860 void SX126xSetCad(void);
861
865 void SX126xSetTxContinuousWave(void);
866
870 void SX126xSetTxInfinitePreamble(void);
871
878 void SX126xSetStopRxTimerOnPreambleDetect(bool enable);
879
885 void SX126xSetLoRaSymbNumTimeout(uint8_t SymbNum);
886
892 void SX126xSetRegulatorMode(RadioRegulatorMode_t mode);
893
899 void SX126xCalibrate(CalibrationParams_t calibParam);
900
906 void SX126xCalibrateImage(uint32_t freq);
907
913 void SX126xSetLongPreamble(uint8_t enable);
914
923 void SX126xSetPaConfig(uint8_t paDutyCycle, uint8_t hpMax, uint8_t deviceSel, uint8_t paLut);
924
930 void SX126xSetRxTxFallbackMode(uint8_t fallbackMode);
931
939 void SX126xWriteRegisters(uint16_t address, uint8_t *buffer, uint16_t size);
940
948 void SX126xReadRegisters(uint16_t address, uint8_t *buffer, uint16_t size);
949
957 void SX126xWriteBuffer(uint8_t offset, uint8_t *buffer, uint8_t size);
958
966 void SX126xReadBuffer(uint8_t offset, uint8_t *buffer, uint8_t size);
967
976 void SX126xSetDioIrqParams(uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask, uint16_t dio3Mask);
977
983 uint16_t SX126xGetIrqStatus(void);
984
990 void SX126xSetDio2AsRfSwitchCtrl(uint8_t enable);
991
998 void SX126xSetDio3AsTcxoCtrl(RadioTcxoCtrlVoltage_t tcxoVoltage, uint32_t timeout);
999
1005 void SX126xSetRfFrequency(uint32_t frequency);
1006
1015 void SX126xSetPacketType(RadioPacketTypes_t packetType);
1016
1022 RadioPacketTypes_t SX126xGetPacketType(void);
1023
1030 void SX126xSetTxParams(int8_t power, RadioRampTimes_t rampTime);
1031
1037 void SX126xSetModulationParams(ModulationParams_t *modParams);
1038
1044 void SX126xSetPacketParams(PacketParams_t *packetParams);
1045
1059 void SX126xSetCadParams(RadioLoRaCadSymbols_t cadSymbolNum, uint8_t cadDetPeak, uint8_t cadDetMin, RadioCadExitModes_t cadExitMode, uint32_t cadTimeout);
1060
1067 void SX126xSetBufferBaseAddress(uint8_t txBaseAddress, uint8_t rxBaseAddress);
1068
1074 RadioStatus_t SX126xGetStatus(void);
1075
1081 int8_t SX126xGetRssiInst(void);
1082
1089 void SX126xGetRxBufferStatus(uint8_t *payloadLength, uint8_t *rxStartBuffer);
1090
1096 void SX126xGetPacketStatus(PacketStatus_t *pktStatus);
1097
1103 RadioError_t SX126xGetDeviceErrors(void);
1104
1108 void SX126xClearDeviceErrors(void);
1109
1115 void SX126xClearIrqStatus(uint16_t irq);
1116 };
1117 #endif // __SX126x_H__
ModulationParams_t::ModulationShaping
RadioModShapings_t ModulationShaping
Definition: sx126x.h:512
SX126xGetRssiInst
int8_t SX126xGetRssiInst(void)
Returns the instantaneous RSSI value for the last packet received.
Definition: sx126x.cpp:658
IRQ_RX_TX_TIMEOUT
@ IRQ_RX_TX_TIMEOUT
Definition: sx126x.h:448
SX126xSetTx
void SX126xSetTx(uint32_t timeout)
Sets the radio in transmission mode.
Definition: sx126x.cpp:257
RadioError_t::AdcCalib
uint8_t AdcCalib
ADC calibration failed.
Definition: sx126x.h:638
LORA_SF11
@ LORA_SF11
Definition: sx126x.h:301
RadioStatus_u::CmdStatus
uint8_t CmdStatus
Command status.
Definition: sx126x.h:141
RADIO_GET_STATUS
@ RADIO_GET_STATUS
Definition: sx126x.h:457
IRQ_TX_DONE
@ IRQ_TX_DONE
Definition: sx126x.h:439
IRQ_RADIO_NONE
@ IRQ_RADIO_NONE
Definition: sx126x.h:438
LORA_CAD_04_SYMBOL
@ LORA_CAD_04_SYMBOL
Definition: sx126x.h:235
PACKET_TYPE_LORA
@ PACKET_TYPE_LORA
Definition: sx126x.h:209
RADIO_CLR_ERROR
@ RADIO_CLR_ERROR
Definition: sx126x.h:492
RX_BW_7300
@ RX_BW_7300
Definition: sx126x.h:269
RadioStandbyModes_t
RadioStandbyModes_t
Declares the oscillator in use while in standby mode.
Definition: sx126x.h:186
RADIO_GET_RSSIINST
@ RADIO_GET_RSSIINST
Definition: sx126x.h:482
IRQ_CAD_DONE
@ IRQ_CAD_DONE
Definition: sx126x.h:446
RADIO_CRC_1_BYTES_INV
@ RADIO_CRC_1_BYTES_INV
Definition: sx126x.h:372
SleepParams_t
Represents a sleep mode configuration.
Definition: sx126x.h:618
RadioLoRaCadSymbols_t
RadioLoRaCadSymbols_t
Represents the number of symbols to be used for channel activity detection operation.
Definition: sx126x.h:232
MODE_FS
@ MODE_FS
The radio is in standby mode with XOSC oscillator.
Definition: sx126x.h:172
SX126xSetOperatingMode
void SX126xSetOperatingMode(RadioOperatingModes_t mode)
Sets/Updates the current Radio OperationMode variable.
Definition: sx126x.cpp:119
RADIO_CRC_2_BYTES_CCIT
@ RADIO_CRC_2_BYTES_CCIT
Definition: sx126x.h:375
RadioIrqMasks_t
RadioIrqMasks_t
Represents the interruption masks available for the radio.
Definition: sx126x.h:437
ModulationParams_t::PacketType
RadioPacketTypes_t PacketType
Packet to which the modulation parameters are referring to.
Definition: sx126x.h:505
RadioStatus_u::Reserved
uint8_t Reserved
Reserved.
Definition: sx126x.h:140
LORA_BW_020
@ LORA_BW_020
Definition: sx126x.h:316
RadioTcxoCtrlVoltage_t
RadioTcxoCtrlVoltage_t
Represents the voltage used to control the TCXO on/off from DIO3.
Definition: sx126x.h:420
SX126xSetStopRxTimerOnPreambleDetect
void SX126xSetStopRxTimerOnPreambleDetect(bool enable)
Decide which interrupt will stop the internal radio rx timer.
Definition: sx126x.cpp:325
MOD_SHAPING_G_BT_03
@ MOD_SHAPING_G_BT_03
Definition: sx126x.h:256
RADIO_SET_TXPARAMS
@ RADIO_SET_TXPARAMS
Definition: sx126x.h:474
LORA_SF9
@ LORA_SF9
Definition: sx126x.h:299
RADIO_GET_RXBUFFERSTATUS
@ RADIO_GET_RXBUFFERSTATUS
Definition: sx126x.h:480
RadioError_t::Rc13mCalib
uint8_t Rc13mCalib
RC 13MHz oscillator calibration failed.
Definition: sx126x.h:636
RX_BW_467000
@ RX_BW_467000
Definition: sx126x.h:287
LORA_CRC_ON
@ LORA_CRC_ON
CRC activated.
Definition: sx126x.h:403
LORA_PACKET_VARIABLE_LENGTH
@ LORA_PACKET_VARIABLE_LENGTH
The packet is on variable size, header included.
Definition: sx126x.h:392
LORA_CR_4_8
@ LORA_CR_4_8
Definition: sx126x.h:330
LORA_PACKET_IMPLICIT
@ LORA_PACKET_IMPLICIT
Definition: sx126x.h:395
RADIO_CALIBRATE
@ RADIO_CALIBRATE
Definition: sx126x.h:488
LORA_CAD_RX
@ LORA_CAD_RX
Definition: sx126x.h:246
ModulationParams_t::BitRate
uint32_t BitRate
Definition: sx126x.h:510
RADIO_ADDRESSCOMP_FILT_NODE_BROAD
@ RADIO_ADDRESSCOMP_FILT_NODE_BROAD
Definition: sx126x.h:352
RADIO_GET_IRQSTATUS
@ RADIO_GET_IRQSTATUS
Definition: sx126x.h:486
RadioLoRaIQModes_t
RadioLoRaIQModes_t
Represents the IQ mode for LoRa packet type.
Definition: sx126x.h:411
IRQ_SYNCWORD_VALID
@ IRQ_SYNCWORD_VALID
Definition: sx126x.h:442
TCXO_CTRL_1_8V
@ TCXO_CTRL_1_8V
Definition: sx126x.h:423
MOD_SHAPING_G_BT_07
@ MOD_SHAPING_G_BT_07
Definition: sx126x.h:258
SX126x_s::BUSY
int BUSY
Definition: sx126x.h:655
LORA_CRC_OFF
@ LORA_CRC_OFF
CRC not used.
Definition: sx126x.h:404
PacketStatus_t::SnrPkt
int8_t SnrPkt
The SNR of the last packet.
Definition: sx126x.h:579
RadioRxBandwidth_t
RadioRxBandwidth_t
Represents the modulation shaping parameter.
Definition: sx126x.h:266
SX126x_s::Spi
int Spi
Definition: sx126x.h:659
RADIO_RESET_STATS
@ RADIO_RESET_STATS
Definition: sx126x.h:484
RADIO_SET_FS
@ RADIO_SET_FS
Definition: sx126x.h:464
SX126xCallbacks_t
The radio callbacks structure Holds function pointers to be called on radio interrupts.
Definition: sx126x.h:690
SX126xSetRxTxFallbackMode
void SX126xSetRxTxFallbackMode(uint8_t fallbackMode)
Defines into which mode the chip goes after a TX / RX done.
Definition: sx126x.cpp:388
RX_BW_234300
@ RX_BW_234300
Definition: sx126x.h:284
RxCounter_t::packetType
RadioPacketTypes_t packetType
Packet to which the packet status are referring to.
Definition: sx126x.h:591
LORA_CR_4_6
@ LORA_CR_4_6
Definition: sx126x.h:328
RX_BW_5800
@ RX_BW_5800
Definition: sx126x.h:268
MODE_RX_DC
@ MODE_RX_DC
The radio is in receive mode.
Definition: sx126x.h:175
RadioPacketLengthModes_t
RadioPacketLengthModes_t
Radio GFSK packet length mode.
Definition: sx126x.h:359
PacketParams_t::AddrComp
RadioAddressComp_t AddrComp
Activated SyncWord correlators.
Definition: sx126x.h:541
IRQ_CRC_ERROR
@ IRQ_CRC_ERROR
Definition: sx126x.h:445
TCXO_CTRL_3_3V
@ TCXO_CTRL_3_3V
Definition: sx126x.h:428
PacketStatus_t::RssiPkt
int8_t RssiPkt
The RSSI of the last packet.
Definition: sx126x.h:578
PacketParams_t::PreambleMinDetect
RadioPreambleDetection_t PreambleMinDetect
The preamble Rx length minimal for GFSK packet type.
Definition: sx126x.h:539
SX126x_s::Reset
int Reset
Definition: sx126x.h:654
RadioStatus_u::ChipMode
uint8_t ChipMode
Chip mode.
Definition: sx126x.h:142
RADIO_CLR_IRQSTATUS
@ RADIO_CLR_IRQSTATUS
Definition: sx126x.h:487
SX126xSetRegulatorMode
void SX126xSetRegulatorMode(RadioRegulatorMode_t mode)
Sets the power regulators operating mode.
Definition: sx126x.cpp:335
LORA_IQ_INVERTED
@ LORA_IQ_INVERTED
Definition: sx126x.h:413
RX_BW_156200
@ RX_BW_156200
Definition: sx126x.h:282
SX126xSendPayload
void SX126xSendPayload(uint8_t *payload, uint8_t size, uint32_t timeout)
Sends a payload.
Definition: sx126x.cpp:153
RADIO_CRC_1_BYTES
@ RADIO_CRC_1_BYTES
Definition: sx126x.h:370
CalibrationParams_t::RC64KEnable
uint8_t RC64KEnable
Calibrate RC64K clock.
Definition: sx126x.h:603
RADIO_SET_REGULATORMODE
@ RADIO_SET_REGULATORMODE
Definition: sx126x.h:490
PacketStatus_t::RssiAvg
int8_t RssiAvg
The averaged RSSI.
Definition: sx126x.h:572
RADIO_GET_PACKETTYPE
@ RADIO_GET_PACKETTYPE
Definition: sx126x.h:472
SX126xGetDeviceErrors
RadioError_t SX126xGetDeviceErrors(void)
Returns the possible system errors.
Definition: sx126x.cpp:721
ModulationParams_t::Fdev
uint32_t Fdev
Definition: sx126x.h:511
RadioCommands_t
enum RadioCommands_e RadioCommands_t
Represents all possible opcode understood by the radio.
RxCounter_t::PacketReceived
uint16_t PacketReceived
Definition: sx126x.h:592
RadioError_t::Value
uint16_t Value
Definition: sx126x.h:646
LORA_CR_4_7
@ LORA_CR_4_7
Definition: sx126x.h:329
SX126xSetPaConfig
void SX126xSetPaConfig(uint8_t paDutyCycle, uint8_t hpMax, uint8_t deviceSel, uint8_t paLut)
Sets the transmission parameters.
Definition: sx126x.cpp:377
RADIO_CALIBRATEIMAGE
@ RADIO_CALIBRATEIMAGE
Definition: sx126x.h:489
MOD_SHAPING_OFF
@ MOD_SHAPING_OFF
Definition: sx126x.h:255
SX126xGetOperatingMode
RadioOperatingModes_t SX126xGetOperatingMode(void)
Gets the current Operation Mode of the Radio.
Definition: sx126x.cpp:114
RADIO_SET_LORASYMBTIMEOUT
@ RADIO_SET_LORASYMBTIMEOUT
Definition: sx126x.h:497
SX126xReInit
void SX126xReInit(DioIrqHandler dioIrq)
Re-Initializes the radio driver after CPU wakeup from deep sleep.
Definition: sx126x.cpp:109
SX126xSetRxBoosted
void SX126xSetRxBoosted(uint32_t timeout)
Sets the radio in reception mode with Boosted LNA gain.
Definition: sx126x.cpp:281
LORA_SF10
@ LORA_SF10
Definition: sx126x.h:300
PacketParams_t::PreambleLength
uint16_t PreambleLength
The preamble Tx length for GFSK packet type in bit.
Definition: sx126x.h:538
SX126x_s::DIO2
int DIO2
Definition: sx126x.h:657
LORA_SF8
@ LORA_SF8
Definition: sx126x.h:298
RadioStatus_u
Structure describing the radio status.
Definition: sx126x.h:136
SX126xReadBuffer
void SX126xReadBuffer(uint8_t offset, uint8_t *buffer, uint8_t size)
Read data from the buffer holding the payload in the radio.
Definition: sx126x-board.cpp:290
RadioPacketTypes_t
RadioPacketTypes_t
Represents the possible packet type (i.e. modem) used.
Definition: sx126x.h:207
RadioDcFree_t
RadioDcFree_t
Radio whitening mode activated or deactivated.
Definition: sx126x.h:382
RADIO_PREAMBLE_DETECTOR_OFF
@ RADIO_PREAMBLE_DETECTOR_OFF
Preamble detection length off.
Definition: sx126x.h:338
SX126xSetSyncWord
uint8_t SX126xSetSyncWord(uint8_t *syncWord)
Sets the Sync Word given by index used in GFSK.
Definition: sx126x.cpp:159
SX126xSetDio2AsRfSwitchCtrl
void SX126xSetDio2AsRfSwitchCtrl(uint8_t enable)
Indicates if DIO2 is used to control an RF Switch.
Definition: sx126x.cpp:416
RX_BW_39000
@ RX_BW_39000
Definition: sx126x.h:276
IRQ_RADIO_ALL
@ IRQ_RADIO_ALL
Definition: sx126x.h:449
RADIO_WRITE_REGISTER
@ RADIO_WRITE_REGISTER
Definition: sx126x.h:458
PacketParams_t::CrcLength
RadioCrcTypes_t CrcLength
Size of the CRC block in the GFSK packet.
Definition: sx126x.h:544
SX126xGetPayload
uint8_t SX126xGetPayload(uint8_t *payload, uint8_t *size, uint8_t maxSize)
Reads the payload received. If the received payload is longer than maxSize, then the method returns 1...
Definition: sx126x.cpp:140
PacketParams_t
The type describing the packet parameters for every packet types.
Definition: sx126x.h:529
SX126xSetCadParams
void SX126xSetCadParams(RadioLoRaCadSymbols_t cadSymbolNum, uint8_t cadDetPeak, uint8_t cadDetMin, RadioCadExitModes_t cadExitMode, uint32_t cadTimeout)
Sets the Channel Activity Detection (CAD) parameters.
Definition: sx126x.cpp:624
RADIO_READ_BUFFER
@ RADIO_READ_BUFFER
Definition: sx126x.h:461
LORA_CR_4_5
@ LORA_CR_4_5
Definition: sx126x.h:327
RADIO_SET_RX
@ RADIO_SET_RX
Definition: sx126x.h:466
CalibrationParams_t::ImgEnable
uint8_t ImgEnable
Definition: sx126x.h:609
SX126xInit
void SX126xInit(DioIrqHandler dioIrq)
Initializes the radio driver.
Definition: sx126x.cpp:84
SX126xSetLoRaSymbNumTimeout
void SX126xSetLoRaSymbNumTimeout(uint8_t SymbNum)
Set the number of symbol the radio will wait to validate a reception.
Definition: sx126x.cpp:330
IrqPblSyncHeaderCode_t
IrqPblSyncHeaderCode_t
Definition: sx126x.h:158
RADIO_DC_FREEWHITENING
@ RADIO_DC_FREEWHITENING
Definition: sx126x.h:384
CalibrationParams_t::ADCBulkPEnable
uint8_t ADCBulkPEnable
Calibrate ADC bulkP.
Definition: sx126x.h:608
RADIO_SET_CAD
@ RADIO_SET_CAD
Definition: sx126x.h:468
IrqErrorCode_t
IrqErrorCode_t
Structure describing the error codes for callback functions.
Definition: sx126x.h:151
DioIrqHandler
void() DioIrqHandler(void)
Definition: sx126x.h:668
RADIO_PREAMBLE_DETECTOR_32_BITS
@ RADIO_PREAMBLE_DETECTOR_32_BITS
Preamble detection length 32 bit.
Definition: sx126x.h:342
RADIO_PREAMBLE_DETECTOR_16_BITS
@ RADIO_PREAMBLE_DETECTOR_16_BITS
Preamble detection length 16 bits.
Definition: sx126x.h:340
RadioLoRaCodingRates_t
RadioLoRaCodingRates_t
Represents the coding rate values for LoRa packet type.
Definition: sx126x.h:326
RADIO_SET_PACONFIG
@ RADIO_SET_PACONFIG
Definition: sx126x.h:475
SX126xSetCad
void SX126xSetCad(void)
Sets the radio in CAD mode.
Definition: sx126x.cpp:309
LORA_PACKET_EXPLICIT
@ LORA_PACKET_EXPLICIT
Definition: sx126x.h:394
RadioCommands_e
RadioCommands_e
Represents all possible opcode understood by the radio.
Definition: sx126x.h:456
SX126xSetLongPreamble
void SX126xSetLongPreamble(uint8_t enable)
Activate the extention of the timeout when long preamble is used.
RADIO_SET_TXCONTINUOUSPREAMBLE
@ RADIO_SET_TXCONTINUOUSPREAMBLE
Definition: sx126x.h:470
IRQ_RX_DONE
@ IRQ_RX_DONE
Definition: sx126x.h:440
RADIO_RAMP_800_US
@ RADIO_RAMP_800_US
Definition: sx126x.h:223
RADIO_SET_CADPARAMS
@ RADIO_SET_CADPARAMS
Definition: sx126x.h:476
SX126xGetPacketType
RadioPacketTypes_t SX126xGetPacketType(void)
Gets the current radio protocol.
Definition: sx126x.cpp:468
MODE_CAD
@ MODE_CAD
The radio is in receive duty cycle mode.
Definition: sx126x.h:176
RADIO_CFG_DIOIRQ
@ RADIO_CFG_DIOIRQ
Definition: sx126x.h:485
LORA_IQ_NORMAL
@ LORA_IQ_NORMAL
Definition: sx126x.h:412
SleepParams_t::Reset
uint8_t Reset
Definition: sx126x.h:622
PacketParams_t::HeaderType
RadioPacketLengthModes_t HeaderType
If the header is explicit, it will be transmitted in the GFSK packet. If the header is implicit,...
Definition: sx126x.h:542
RadioError_t::BuckStart
uint8_t BuckStart
Buck converter failed to start.
Definition: sx126x.h:642
LORA_BW_125
@ LORA_BW_125
Definition: sx126x.h:312
IRQ_SYNCWORD_ERROR_CODE
@ IRQ_SYNCWORD_ERROR_CODE
Definition: sx126x.h:153
SX126xSetTxInfinitePreamble
void SX126xSetTxInfinitePreamble(void)
Sets the radio in continuous preamble transmission mode.
Definition: sx126x.cpp:320
SX126xSetCrcPolynomial
void SX126xSetCrcPolynomial(uint16_t polynomial)
Sets the polynomial used for the CRC calculation.
Definition: sx126x.cpp:183
LORA_SF6
@ LORA_SF6
Definition: sx126x.h:296
RadioLoRaSpreadingFactors_t
RadioLoRaSpreadingFactors_t
Represents the possible spreading factor values in LoRa packet types.
Definition: sx126x.h:294
RADIO_PACKET_VARIABLE_LENGTH
@ RADIO_PACKET_VARIABLE_LENGTH
The packet is on variable size, header included.
Definition: sx126x.h:361
SX126x_s::PacketStatus
PacketStatus_t PacketStatus
Definition: sx126x.h:661
SX126xGetStatus
RadioStatus_t SX126xGetStatus(void)
Gets the current radio status.
Definition: sx126x.cpp:648
ModulationParams_t
The type describing the modulation parameters for every packet types.
Definition: sx126x.h:504
RADIO_SET_MODULATIONPARAMS
@ RADIO_SET_MODULATIONPARAMS
Definition: sx126x.h:478
RX_BW_58600
@ RX_BW_58600
Definition: sx126x.h:278
LORA_CAD_ONLY
@ LORA_CAD_ONLY
Definition: sx126x.h:245
TCXO_CTRL_2_2V
@ TCXO_CTRL_2_2V
Definition: sx126x.h:424
PacketParams_t::PayloadLength
uint8_t PayloadLength
Size of the payload in the GFSK packet.
Definition: sx126x.h:543
LORA_BW_250
@ LORA_BW_250
Definition: sx126x.h:311
MOD_SHAPING_G_BT_1
@ MOD_SHAPING_G_BT_1
Definition: sx126x.h:259
RADIO_CRC_2_BYTES_IBM
@ RADIO_CRC_2_BYTES_IBM
Definition: sx126x.h:374
SX126xSetTxParams
void SX126xSetTxParams(int8_t power, RadioRampTimes_t rampTime)
Sets the transmission parameters.
Definition: sx126x.cpp:473
MODE_STDBY_RC
@ MODE_STDBY_RC
The radio is in sleep mode.
Definition: sx126x.h:170
IRQ_HEADER_VALID_CODE
@ IRQ_HEADER_VALID_CODE
Definition: sx126x.h:161
RadioStatus_u::Fields
struct RadioStatus_u::@0 Fields
PacketParams_t::PacketType
RadioPacketTypes_t PacketType
Packet to which the packet parameters are referring to.
Definition: sx126x.h:530
RADIO_RAMP_80_US
@ RADIO_RAMP_80_US
Definition: sx126x.h:221
RX_BW_9700
@ RX_BW_9700
Definition: sx126x.h:270
LORA_SF12
@ LORA_SF12
Definition: sx126x.h:302
RxCounter_t
Represents the Rx internal counters values when GFSK or LoRa packet type is used.
Definition: sx126x.h:590
PacketParams_t::DcFree
RadioDcFree_t DcFree
Definition: sx126x.h:545
RadioError_t::PllLock
uint8_t PllLock
PLL lock failed.
Definition: sx126x.h:641
LORA_CAD_08_SYMBOL
@ LORA_CAD_08_SYMBOL
Definition: sx126x.h:236
SX126xSetBufferBaseAddress
void SX126xSetBufferBaseAddress(uint8_t txBaseAddress, uint8_t rxBaseAddress)
Sets the data buffer base address for transmission and reception.
Definition: sx126x.cpp:639
RX_BW_373600
@ RX_BW_373600
Definition: sx126x.h:286
RadioPreambleDetection_t
RadioPreambleDetection_t
Represents the preamble length used to detect the packet on Rx side.
Definition: sx126x.h:337
RADIO_WRITE_BUFFER
@ RADIO_WRITE_BUFFER
Definition: sx126x.h:460
SX126xSetDio3AsTcxoCtrl
void SX126xSetDio3AsTcxoCtrl(RadioTcxoCtrlVoltage_t tcxoVoltage, uint32_t timeout)
Indicates if the Radio main clock is supplied from a tcxo.
Definition: sx126x.cpp:421
RadioError_t::PaRamp
uint8_t PaRamp
PA ramp failed.
Definition: sx126x.h:643
LORA_BW_010
@ LORA_BW_010
Definition: sx126x.h:318
USE_DCDC
@ USE_DCDC
Definition: sx126x.h:200
RadioRegulatorMode_t
RadioRegulatorMode_t
Declares the power regulation used to power the device.
Definition: sx126x.h:198
RX_BW_78200
@ RX_BW_78200
Definition: sx126x.h:279
IRQ_HEADER_VALID
@ IRQ_HEADER_VALID
Definition: sx126x.h:443
SX126x_s::DIO3
int DIO3
Definition: sx126x.h:658
PacketParams_t::InvertIQ
RadioLoRaIQModes_t InvertIQ
Allows to swap IQ for LoRa packet.
Definition: sx126x.h:556
PacketParams_t::SyncWordLength
uint8_t SyncWordLength
The synchronization word length for GFSK packet type.
Definition: sx126x.h:540
RADIO_SET_TCXOMODE
@ RADIO_SET_TCXOMODE
Definition: sx126x.h:493
RadioCrcTypes_t
RadioCrcTypes_t
Represents the CRC length.
Definition: sx126x.h:368
LORA_BW_007
@ LORA_BW_007
Definition: sx126x.h:319
SleepParams_t::WarmStart
uint8_t WarmStart
Definition: sx126x.h:623
RADIO_SET_RFFREQUENCY
@ RADIO_SET_RFFREQUENCY
Definition: sx126x.h:473
RADIO_RAMP_40_US
@ RADIO_RAMP_40_US
Definition: sx126x.h:220
SX126xSetDioIrqParams
void SX126xSetDioIrqParams(uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask, uint16_t dio3Mask)
Sets the IRQ mask and DIO masks.
Definition: sx126x.cpp:393
RX_BW_93800
@ RX_BW_93800
Definition: sx126x.h:280
RADIO_CRC_2_BYTES
@ RADIO_CRC_2_BYTES
Definition: sx126x.h:371
CalibrationParams_t::Value
uint8_t Value
Definition: sx126x.h:612
RadioRampTimes_t
RadioRampTimes_t
Represents the ramping time for power amplifier.
Definition: sx126x.h:217
TCXO_CTRL_2_7V
@ TCXO_CTRL_2_7V
Definition: sx126x.h:426
LORA_CAD_02_SYMBOL
@ LORA_CAD_02_SYMBOL
Definition: sx126x.h:234
SX126xSetModulationParams
void SX126xSetModulationParams(ModulationParams_t *modParams)
Set the modulation parameters.
Definition: sx126x.cpp:520
MODE_RX
@ MODE_RX
The radio is in transmit mode.
Definition: sx126x.h:174
LORA_PACKET_FIXED_LENGTH
@ LORA_PACKET_FIXED_LENGTH
The packet is known on both sides, no header included in the packet.
Definition: sx126x.h:393
SX126xWriteBuffer
void SX126xWriteBuffer(uint8_t offset, uint8_t *buffer, uint8_t size)
Write data to the buffer holding the payload in the radio.
Definition: sx126x-board.cpp:271
RADIO_CRC_2_BYTES_INV
@ RADIO_CRC_2_BYTES_INV
Definition: sx126x.h:373
IRQ_CAD_ACTIVITY_DETECTED
@ IRQ_CAD_ACTIVITY_DETECTED
Definition: sx126x.h:447
RADIO_DC_FREE_OFF
@ RADIO_DC_FREE_OFF
Definition: sx126x.h:383
PacketStatus_t::SignalRssiPkt
int8_t SignalRssiPkt
Definition: sx126x.h:580
IRQ_CRC_ERROR_CODE
@ IRQ_CRC_ERROR_CODE
Definition: sx126x.h:154
SX126xSetWhiteningSeed
void SX126xSetWhiteningSeed(uint16_t seed)
Sets the Initial value of the LFSR used for the whitening in GFSK protocols.
Definition: sx126x.cpp:201
RX_BW_14600
@ RX_BW_14600
Definition: sx126x.h:272
SX126xSetPayload
void SX126xSetPayload(uint8_t *payload, uint8_t size)
Saves the payload to be send in the radio buffer.
Definition: sx126x.cpp:135
RADIO_SET_SLEEP
@ RADIO_SET_SLEEP
Definition: sx126x.h:462
IRQ_HEADER_ERROR
@ IRQ_HEADER_ERROR
Definition: sx126x.h:444
STDBY_XOSC
@ STDBY_XOSC
Definition: sx126x.h:188
LORA_BW_015
@ LORA_BW_015
Definition: sx126x.h:317
LORA_BW_041
@ LORA_BW_041
Definition: sx126x.h:314
SX126xSetRxDutyCycle
void SX126xSetRxDutyCycle(uint32_t rxTime, uint32_t sleepTime)
Sets the Rx duty cycle management parameters.
Definition: sx126x.cpp:295
SleepParams_t::WakeUpRTC
uint8_t WakeUpRTC
Get out of sleep mode if wakeup signal received from RTC.
Definition: sx126x.h:621
LORA_SF5
@ LORA_SF5
Definition: sx126x.h:295
RX_BW_19500
@ RX_BW_19500
Definition: sx126x.h:273
SX126xReadRegisters
void SX126xReadRegisters(uint16_t address, uint8_t *buffer, uint16_t size)
Read data from the radio memory.
Definition: sx126x-board.cpp:243
RADIO_SET_PACKETTYPE
@ RADIO_SET_PACKETTYPE
Definition: sx126x.h:471
RX_BW_187200
@ RX_BW_187200
Definition: sx126x.h:283
RADIO_PREAMBLE_DETECTOR_24_BITS
@ RADIO_PREAMBLE_DETECTOR_24_BITS
Preamble detection length 24 bits.
Definition: sx126x.h:341
RadioError_t::Rc64kCalib
uint8_t Rc64kCalib
RC 64kHz oscillator calibration failed.
Definition: sx126x.h:635
TCXO_CTRL_3_0V
@ TCXO_CTRL_3_0V
Definition: sx126x.h:427
RX_BW_4800
@ RX_BW_4800
Definition: sx126x.h:267
RadioLoRaBandwidths_t
RadioLoRaBandwidths_t
Represents the bandwidth values for LoRa packet type.
Definition: sx126x.h:309
SX126xSetRfFrequency
void SX126xSetRfFrequency(uint32_t frequency)
Sets the RF frequency.
Definition: sx126x.cpp:442
RADIO_SET_STANDBY
@ RADIO_SET_STANDBY
Definition: sx126x.h:463
TCXO_CTRL_1_6V
@ TCXO_CTRL_1_6V
Definition: sx126x.h:421
SX126xCheckDeviceReady
void SX126xCheckDeviceReady(void)
Wakeup the radio if it is in Sleep mode and check that Busy is low.
Definition: sx126x.cpp:124
RADIO_GET_STATS
@ RADIO_GET_STATS
Definition: sx126x.h:483
SX126xSetPacketType
void SX126xSetPacketType(RadioPacketTypes_t packetType)
Sets the radio for the given protocol.
Definition: sx126x.cpp:461
ModulationParams_t::Bandwidth
uint8_t Bandwidth
Definition: sx126x.h:513
PacketStatus_t::packetType
RadioPacketTypes_t packetType
Packet to which the packet status are referring to.
Definition: sx126x.h:566
SX126xGetRandom
uint32_t SX126xGetRandom(void)
Gets a 32 bits random value generated by the radio.
Definition: sx126x.cpp:219
PacketStatus_t::FreqError
uint32_t FreqError
Definition: sx126x.h:574
RadioLoRaPacketLengthsMode_t
RadioLoRaPacketLengthsMode_t
Holds the Radio lengths mode for the LoRa packet type.
Definition: sx126x.h:391
CalibrationParams_t
Represents a calibration configuration.
Definition: sx126x.h:600
LORA_CAD_LBT
@ LORA_CAD_LBT
Definition: sx126x.h:247
SX126x_s::DIO1
int DIO1
Definition: sx126x.h:656
MODE_STDBY_XOSC
@ MODE_STDBY_XOSC
The radio is in standby mode with RC oscillator.
Definition: sx126x.h:171
RX_BW_46900
@ RX_BW_46900
Definition: sx126x.h:277
RadioError_t::XoscStart
uint8_t XoscStart
XOSC oscillator failed to start.
Definition: sx126x.h:640
SX126xCalibrateImage
void SX126xCalibrateImage(uint32_t freq)
Calibrates the Image rejection depending of the frequency.
Definition: sx126x.cpp:345
LORA_SF7
@ LORA_SF7
Definition: sx126x.h:297
SleepParams_t::Value
uint8_t Value
Definition: sx126x.h:626
RadioStatus_u::CpuBusy
uint8_t CpuBusy
Flag for CPU radio busy.
Definition: sx126x.h:143
RADIO_SET_TXFALLBACKMODE
@ RADIO_SET_TXFALLBACKMODE
Definition: sx126x.h:494
SX126xSetTxContinuousWave
void SX126xSetTxContinuousWave(void)
Sets the radio in continuous wave transmission mode.
Definition: sx126x.cpp:315
LORA_BW_031
@ LORA_BW_031
Definition: sx126x.h:315
RADIO_ADDRESSCOMP_FILT_NODE
@ RADIO_ADDRESSCOMP_FILT_NODE
Definition: sx126x.h:351
RADIO_CRC_OFF
@ RADIO_CRC_OFF
No CRC in use.
Definition: sx126x.h:369
USE_LDO
@ USE_LDO
Definition: sx126x.h:199
LORA_BW_500
@ LORA_BW_500
Definition: sx126x.h:310
LORA_CAD_01_SYMBOL
@ LORA_CAD_01_SYMBOL
Definition: sx126x.h:233
CalibrationParams_t::PLLEnable
uint8_t PLLEnable
Calibrate PLL.
Definition: sx126x.h:605
RADIO_ADDRESSCOMP_FILT_OFF
@ RADIO_ADDRESSCOMP_FILT_OFF
No correlator turned on, i.e. do not search for SyncWord.
Definition: sx126x.h:350
RADIO_SET_PACKETPARAMS
@ RADIO_SET_PACKETPARAMS
Definition: sx126x.h:479
RadioOperatingModes_t
RadioOperatingModes_t
Represents the operating mode the radio is actually running.
Definition: sx126x.h:168
RadioStatus_u::Value
uint8_t Value
Definition: sx126x.h:137
PacketStatus_t::RssiSync
int8_t RssiSync
The RSSI measured on last packet.
Definition: sx126x.h:573
RADIO_RAMP_10_US
@ RADIO_RAMP_10_US
Definition: sx126x.h:218
TCXO_CTRL_1_7V
@ TCXO_CTRL_1_7V
Definition: sx126x.h:422
RadioError_t::ImgCalib
uint8_t ImgCalib
Image calibration failed.
Definition: sx126x.h:639
ModulationParams_t::Bandwidth
RadioLoRaBandwidths_t Bandwidth
Bandwidth for the LoRa modulation.
Definition: sx126x.h:518
ModulationParams_t::SpreadingFactor
RadioLoRaSpreadingFactors_t SpreadingFactor
Spreading Factor for the LoRa modulation.
Definition: sx126x.h:517
ModulationParams_t::CodingRate
RadioLoRaCodingRates_t CodingRate
Coding rate for the LoRa modulation.
Definition: sx126x.h:519
CalibrationParams_t::ADCPulseEnable
uint8_t ADCPulseEnable
Calibrate ADC Pulse.
Definition: sx126x.h:606
RADIO_SET_RFSWITCHMODE
@ RADIO_SET_RFSWITCHMODE
Definition: sx126x.h:495
RX_BW_23400
@ RX_BW_23400
Definition: sx126x.h:274
RadioModShapings_t
RadioModShapings_t
Represents the modulation shaping parameter.
Definition: sx126x.h:254
SX126xCalibrate
void SX126xCalibrate(CalibrationParams_t calibParam)
Calibrates the given radio block.
Definition: sx126x.cpp:340
RADIO_PREAMBLE_DETECTOR_08_BITS
@ RADIO_PREAMBLE_DETECTOR_08_BITS
Preamble detection length 8 bits.
Definition: sx126x.h:339
PacketStatus_t
Represents the packet status for every packet type.
Definition: sx126x.h:565
RADIO_SET_BUFFERBASEADDRESS
@ RADIO_SET_BUFFERBASEADDRESS
Definition: sx126x.h:477
SX126xSetRx
void SX126xSetRx(uint32_t timeout)
Sets the radio in reception mode.
Definition: sx126x.cpp:269
IRQ_PREAMBLE_DETECTED
@ IRQ_PREAMBLE_DETECTED
Definition: sx126x.h:441
LORA_BW_062
@ LORA_BW_062
Definition: sx126x.h:313
SX126x_t
struct SX126x_s SX126x_t
RX_BW_11700
@ RX_BW_11700
Definition: sx126x.h:271
SX126xWriteRegisters
void SX126xWriteRegisters(uint16_t address, uint8_t *buffer, uint16_t size)
Write data to the radio memory.
Definition: sx126x-board.cpp:216
RADIO_RAMP_3400_US
@ RADIO_RAMP_3400_US
Definition: sx126x.h:225
SX126x_s::PacketParams
PacketParams_t PacketParams
Definition: sx126x.h:660
RadioError_t
Represents the possible radio system error states.
Definition: sx126x.h:632
RADIO_GET_ERROR
@ RADIO_GET_ERROR
Definition: sx126x.h:491
SX126xGetIrqStatus
uint16_t SX126xGetIrqStatus(void)
Returns the current IRQ status.
Definition: sx126x.cpp:408
RxCounter_t::LengthError
uint16_t LengthError
Definition: sx126x.h:594
TCXO_CTRL_2_4V
@ TCXO_CTRL_2_4V
Definition: sx126x.h:425
STDBY_RC
@ STDBY_RC
Definition: sx126x.h:187
IRQ_PBL_DETECT_CODE
@ IRQ_PBL_DETECT_CODE
Definition: sx126x.h:159
SX126xGetPacketStatus
void SX126xGetPacketStatus(PacketStatus_t *pktStatus)
Gets the last received packet payload length.
Definition: sx126x.cpp:687
SX126xSetPacketParams
void SX126xSetPacketParams(PacketParams_t *packetParams)
Sets the packet parameters.
Definition: sx126x.cpp:565
RADIO_SET_STOPRXTIMERONPREAMBLE
@ RADIO_SET_STOPRXTIMERONPREAMBLE
Definition: sx126x.h:496
PacketParams_t::CrcMode
RadioLoRaCrcModes_t CrcMode
Size of CRC block in LoRa packet.
Definition: sx126x.h:555
SX126xSetCrcSeed
void SX126xSetCrcSeed(uint16_t seed)
Sets the seed value for the LFSR used for the CRC calculation.
Definition: sx126x.cpp:165
RadioStatus_t
union RadioStatus_u RadioStatus_t
Structure describing the radio status.
RxCounter_t::CrcOk
uint16_t CrcOk
Definition: sx126x.h:593
RADIO_RAMP_200_US
@ RADIO_RAMP_200_US
Definition: sx126x.h:222
RADIO_RAMP_1700_US
@ RADIO_RAMP_1700_US
Definition: sx126x.h:224
RadioLoRaCrcModes_t
RadioLoRaCrcModes_t
Represents the CRC mode for LoRa packet type.
Definition: sx126x.h:402
RADIO_SET_RXDUTYCYCLE
@ RADIO_SET_RXDUTYCYCLE
Definition: sx126x.h:467
MOD_SHAPING_G_BT_05
@ MOD_SHAPING_G_BT_05
Definition: sx126x.h:257
LORA_CAD_16_SYMBOL
@ LORA_CAD_16_SYMBOL
Definition: sx126x.h:237
RX_BW_29300
@ RX_BW_29300
Definition: sx126x.h:275
RX_BW_312000
@ RX_BW_312000
Definition: sx126x.h:285
IRQ_HEADER_ERROR_CODE
@ IRQ_HEADER_ERROR_CODE
Definition: sx126x.h:152
SX126xSetSleep
void SX126xSetSleep(SleepParams_t sleepConfig)
Sets the radio in sleep mode.
Definition: sx126x.cpp:228
PacketStatus_t::RxStatus
uint8_t RxStatus
Definition: sx126x.h:571
PacketParams_t::HeaderType
RadioLoRaPacketLengthsMode_t HeaderType
If the header is explicit, it will be transmitted in the LoRa packet. If the header is implicit,...
Definition: sx126x.h:553
CalibrationParams_t::RC13MEnable
uint8_t RC13MEnable
Calibrate RC13M clock.
Definition: sx126x.h:604
SX126xSetStandby
void SX126xSetStandby(RadioStandbyModes_t mode)
Sets the radio in configuration mode.
Definition: sx126x.cpp:236
IRQ_SYNCWORD_VALID_CODE
@ IRQ_SYNCWORD_VALID_CODE
Definition: sx126x.h:160
SX126xClearDeviceErrors
void SX126xClearDeviceErrors(void)
Clear all the errors in the device.
Definition: sx126x.cpp:729
SX126xSetFs
void SX126xSetFs(void)
Sets the radio in FS mode.
Definition: sx126x.cpp:251
SX126xGetRxBufferStatus
void SX126xGetRxBufferStatus(uint8_t *payloadLength, uint8_t *rxStartBuffer)
Gets the last received packet buffer status.
Definition: sx126x.cpp:668
SX126x_s
Definition: sx126x.h:653
RADIO_PACKET_FIXED_LENGTH
@ RADIO_PACKET_FIXED_LENGTH
The packet is known on both sides, no header included in the packet.
Definition: sx126x.h:360
RADIO_SET_TX
@ RADIO_SET_TX
Definition: sx126x.h:465
MODE_TX
@ MODE_TX
The radio is in frequency synthesis mode.
Definition: sx126x.h:173
CalibrationParams_t::ADCBulkNEnable
uint8_t ADCBulkNEnable
Calibrate ADC bulkN.
Definition: sx126x.h:607
SleepParams_t::Reserved
uint8_t Reserved
Definition: sx126x.h:624
RADIO_RAMP_20_US
@ RADIO_RAMP_20_US
Definition: sx126x.h:219
RadioError_t::PllCalib
uint8_t PllCalib
PLL calibration failed.
Definition: sx126x.h:637
RadioAddressComp_t
RadioAddressComp_t
Represents the possible combinations of SyncWord correlators activated.
Definition: sx126x.h:349
SX126xClearIrqStatus
void SX126xClearIrqStatus(uint16_t irq)
Clears the IRQs.
Definition: sx126x.cpp:735
PACKET_TYPE_GFSK
@ PACKET_TYPE_GFSK
Definition: sx126x.h:208
RadioCadExitModes_t
RadioCadExitModes_t
Represents the Channel Activity Detection actions after the CAD operation is finished.
Definition: sx126x.h:244
MODE_SLEEP
@ MODE_SLEEP
Definition: sx126x.h:169
ModulationParams_t::LowDatarateOptimize
uint8_t LowDatarateOptimize
Indicates if the modem uses the low datarate optimization.
Definition: sx126x.h:520
RADIO_SET_TXCONTINUOUSWAVE
@ RADIO_SET_TXCONTINUOUSWAVE
Definition: sx126x.h:469
RADIO_READ_REGISTER
@ RADIO_READ_REGISTER
Definition: sx126x.h:459
RADIO_GET_PACKETSTATUS
@ RADIO_GET_PACKETSTATUS
Definition: sx126x.h:481
SX126x_s::ModulationParams
ModulationParams_t ModulationParams
Definition: sx126x.h:662
PACKET_TYPE_NONE
@ PACKET_TYPE_NONE
Definition: sx126x.h:210
RX_BW_117300
@ RX_BW_117300
Definition: sx126x.h:281