Blame view

RIOT/drivers/sx127x/include/sx127x_registers.h 84.9 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
  /*
   * Copyright (C) 2016 Unwired Devices <info@unwds.com>
   *               2016 Inria Chile
   *               2017 Inria
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @ingroup     drivers_sx127x
   * @{
   *
   * @file
   * @brief       SX127X registers
   *
   * @author      Eugene P. <ep@unwds.com>
   * @author      José Ignacio Alamos <jose.alamos@inria.cl>
   * @author      Alexandre Abadie <alexandre.abadie@inria.fr>
   *
   */
  
  #ifndef SX127X_REGISTERS_H
  #define SX127X_REGISTERS_H
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @name   SX127X LoRa modem internal registers addresses
   * @{
   */
  
  /* Common settings */
  #define SX127X_REG_LR_OPMODE                                         (0x01)
  #define SX127X_REG_LR_FRFMSB                                         (0x06)
  #define SX127X_REG_LR_FRFMID                                         (0x07)
  #define SX127X_REG_LR_FRFLSB                                         (0x08)
  
  /* Tx settings */
  #define SX127X_REG_LR_PACONFIG                                       (0x09)
  #define SX127X_REG_LR_PARAMP                                         (0x0A)
  #define SX127X_REG_LR_OCP                                            (0x0B)
  
  /* Rx settings */
  #define SX127X_REG_LR_LNA                                            (0x0C)
  
  /* LoRa registers */
  #define SX127X_REG_LR_FIFOADDRPTR                                    (0x0D)
  #define SX127X_REG_LR_FIFOTXBASEADDR                                 (0x0E)
  #define SX127X_REG_LR_FIFORXBASEADDR                                 (0x0F)
  #define SX127X_REG_LR_FIFORXCURRENTADDR                              (0x10)
  #define SX127X_REG_LR_IRQFLAGSMASK                                   (0x11)
  #define SX127X_REG_LR_IRQFLAGS                                       (0x12)
  #define SX127X_REG_LR_RXNBBYTES                                      (0x13)
  #define SX127X_REG_LR_RXHEADERCNTVALUEMSB                            (0x14)
  #define SX127X_REG_LR_RXHEADERCNTVALUELSB                            (0x15)
  #define SX127X_REG_LR_RXPACKETCNTVALUEMSB                            (0x16)
  #define SX127X_REG_LR_RXPACKETCNTVALUELSB                            (0x17)
  #define SX127X_REG_LR_MODEMSTAT                                      (0x18)
  #define SX127X_REG_LR_PKTSNRVALUE                                    (0x19)
  #define SX127X_REG_LR_PKTRSSIVALUE                                   (0x1A)
  #define SX127X_REG_LR_RSSIVALUE                                      (0x1B)
  #define SX127X_REG_LR_HOPCHANNEL                                     (0x1C)
  #define SX127X_REG_LR_MODEMCONFIG1                                   (0x1D)
  #define SX127X_REG_LR_MODEMCONFIG2                                   (0x1E)
  #define SX127X_REG_LR_SYMBTIMEOUTLSB                                 (0x1F)
  #define SX127X_REG_LR_PREAMBLEMSB                                    (0x20)
  #define SX127X_REG_LR_PREAMBLELSB                                    (0x21)
  #define SX127X_REG_LR_PAYLOADLENGTH                                  (0x22)
  #define SX127X_REG_LR_PAYLOADMAXLENGTH                               (0x23)
  #define SX127X_REG_LR_HOPPERIOD                                      (0x24)
  #define SX127X_REG_LR_FIFORXBYTEADDR                                 (0x25)
  #define SX127X_REG_LR_MODEMCONFIG3                                   (0x26)
  #define SX127X_REG_LR_FEIMSB                                         (0x28)
  #define SX127X_REG_LR_FEIMID                                         (0x29)
  #define SX127X_REG_LR_FEILSB                                         (0x2A)
  #define SX127X_REG_LR_RSSIWIDEBAND                                   (0x2C)
  #define SX127X_REG_LR_TEST2F                                         (0x2F)
  #define SX127X_REG_LR_TEST30                                         (0x30)
  #define SX127X_REG_LR_DETECTOPTIMIZE                                 (0x31)
  #define SX127X_REG_LR_INVERTIQ                                       (0x33)
  #define SX127X_REG_LR_TEST36                                         (0x36)
  #define SX127X_REG_LR_DETECTIONTHRESHOLD                             (0x37)
  #define SX127X_REG_LR_SYNCWORD                                       (0x39)
  #define SX127X_REG_LR_TEST3A                                         (0x3A)
  #define SX127X_REG_LR_INVERTIQ2                                      (0x3B)
  
  /* I/O settings */
  #define SX127X_REG_LR_DIOMAPPING1                                    (0x40)
  #define SX127X_REG_LR_DIOMAPPING2                                    (0x41)
  
  /* Version */
  #define SX127X_REG_LR_VERSION                                        (0x42)
  
  /* Additional settings */
  #define SX127X_REG_LR_PLLHOP                                         (0x44)
  #define SX127X_REG_LR_TCXO                                           (0x4B)
  #define SX127X_REG_LR_PADAC                                          (0x4D)
  #define SX127X_REG_LR_FORMERTEMP                                     (0x5B)
  #define SX127X_REG_LR_BITRATEFRAC                                    (0x5D)
  #define SX127X_REG_LR_AGCREF                                         (0x61)
  #define SX127X_REG_LR_AGCTHRESH1                                     (0x62)
  #define SX127X_REG_LR_AGCTHRESH2                                     (0x63)
  #define SX127X_REG_LR_AGCTHRESH3                                     (0x64)
  #define SX127X_REG_LR_PLL                                            (0x70)
  /** @} */
  
  /**
   * @name   Modem settings for random number generator
   * @{
   */
  #define SX127X_RNG_REG_MODEM_CONFIG1                                 (0x0A)
  #define SX127X_RNG_REG_MODEM_CONFIG2                                 (0x70)
  /** @} */
  
  /**
   * @name   SX127X LoRa bits control definition
   * @{
   */
  
  /* RegFifo */
  #define SX127X_REG_LR_FIFO                                           (0x00)
  
  /* RegOpMode */
  #define SX127X_RF_LORA_OPMODE_LONGRANGEMODE_MASK                     (0x7F)
  #define SX127X_RF_LORA_OPMODE_LONGRANGEMODE_OFF                      (0x00) /* Default */
  #define SX127X_RF_LORA_OPMODE_LONGRANGEMODE_ON                       (0x80)
  
  #define SX127X_RF_LORA_OPMODE_ACCESSSHAREDSX127X_REG_MASK            (0xBF)
  #define SX127X_RF_LORA_OPMODE_ACCESSSHAREDSX127X_REG_ENABLE          (0x40)
  #define SX127X_RF_LORA_OPMODE_ACCESSSHAREDSX127X_REG_DISABLE         (0x00) /* Default */
  
  #define SX127X_RF_LORA_OPMODE_FREQMODE_ACCESS_MASK                   (0xF7)
  #define SX127X_RF_LORA_OPMODE_FREQMODE_ACCESS_LF                     (0x08) /* Default */
  #define SX127X_RF_LORA_OPMODE_FREQMODE_ACCESS_HF                     (0x00)
  
  #define SX127X_RF_LORA_OPMODE_MASK                                   (0xF8)
  #define SX127X_RF_LORA_OPMODE_SLEEP                                  (0x00)
  #define SX127X_RF_LORA_OPMODE_STANDBY                                (0x01) /* Default */
  #define SX127X_RF_LORA_OPMODE_SYNTHESIZER_TX                         (0x02)
  #define SX127X_RF_LORA_OPMODE_TRANSMITTER                            (0x03)
  #define SX127X_RF_LORA_OPMODE_SYNTHESIZER_RX                         (0x04)
  #define SX127X_RF_LORA_OPMODE_RECEIVER                               (0x05)
  
  /* LoRa specific modes */
  #define SX127X_RF_LORA_OPMODE_RECEIVER_SINGLE                        (0x06)
  #define SX127X_RF_LORA_OPMODE_CAD                                    (0x07)
  
  /* RegFrf (MHz) */
  #define SX127X_RF_LORA_FRFMSB_434_MHZ                                (0x6C) /* Default */
  #define SX127X_RF_LORA_FRFMID_434_MHZ                                (0x80) /* Default */
  #define SX127X_RF_LORA_FRFLSB_434_MHZ                                (0x00) /* Default */
  
  /* RegPaConfig */
  #define SX127X_RF_LORA_PACONFIG_PASELECT_MASK                        (0x7F)
  #define SX127X_RF_LORA_PACONFIG_PASELECT_PABOOST                     (0x80)
  #define SX127X_RF_LORA_PACONFIG_PASELECT_RFO                         (0x00) /* Default */
  
  #define SX127X_RF_LORA_PACONFIG_MAX_POWER_MASK                       (0x8F)
  
  #define SX127X_RF_LORA_PACONFIG_OUTPUTPOWER_MASK                     (0xF0)
  
  /* RegPaRamp */
  #define SX127X_RF_LORA_PARAMP_TXBANDFORCE_MASK                       (0xEF)
  #define SX127X_RF_LORA_PARAMP_TXBANDFORCE_BAND_SEL                   (0x10)
  #define SX127X_RF_LORA_PARAMP_TXBANDFORCE_AUTO                       (0x00) /* Default */
  
  #define SX127X_RF_LORA_PARAMP_MASK                                   (0xF0)
  #define SX127X_RF_LORA_PARAMP_3400_US                                (0x00)
  #define SX127X_RF_LORA_PARAMP_2000_US                                (0x01)
  #define SX127X_RF_LORA_PARAMP_1000_US                                (0x02)
  #define SX127X_RF_LORA_PARAMP_0500_US                                (0x03)
  #define SX127X_RF_LORA_PARAMP_0250_US                                (0x04)
  #define SX127X_RF_LORA_PARAMP_0125_US                                (0x05)
  #define SX127X_RF_LORA_PARAMP_0100_US                                (0x06)
  #define SX127X_RF_LORA_PARAMP_0062_US                                (0x07)
  #define SX127X_RF_LORA_PARAMP_0050_US                                (0x08)
  #define SX127X_RF_LORA_PARAMP_0040_US                                (0x09) /* Default */
  #define SX127X_RF_LORA_PARAMP_0031_US                                (0x0A)
  #define SX127X_RF_LORA_PARAMP_0025_US                                (0x0B)
  #define SX127X_RF_LORA_PARAMP_0020_US                                (0x0C)
  #define SX127X_RF_LORA_PARAMP_0015_US                                (0x0D)
  #define SX127X_RF_LORA_PARAMP_0012_US                                (0x0E)
  #define SX127X_RF_LORA_PARAMP_0010_US                                (0x0F)
  
  /* RegOcp */
  #define SX127X_RF_LORA_OCP_MASK                                      (0xDF)
  #define SX127X_RF_LORA_OCP_ON                                        (0x20) /* Default */
  #define SX127X_RF_LORA_OCP_OFF                                       (0x00)
  
  #define SX127X_RF_LORA_OCP_TRIM_MASK                                 (0xE0)
  #define SX127X_RF_LORA_OCP_TRIM_045_MA                               (0x00)
  #define SX127X_RF_LORA_OCP_TRIM_050_MA                               (0x01)
  #define SX127X_RF_LORA_OCP_TRIM_055_MA                               (0x02)
  #define SX127X_RF_LORA_OCP_TRIM_060_MA                               (0x03)
  #define SX127X_RF_LORA_OCP_TRIM_065_MA                               (0x04)
  #define SX127X_RF_LORA_OCP_TRIM_070_MA                               (0x05)
  #define SX127X_RF_LORA_OCP_TRIM_075_MA                               (0x06)
  #define SX127X_RF_LORA_OCP_TRIM_080_MA                               (0x07)
  #define SX127X_RF_LORA_OCP_TRIM_085_MA                               (0x08)
  #define SX127X_RF_LORA_OCP_TRIM_090_MA                               (0x09)
  #define SX127X_RF_LORA_OCP_TRIM_095_MA                               (0x0A)
  #define SX127X_RF_LORA_OCP_TRIM_100_MA                               (0x0B)  /* Default */
  #define SX127X_RF_LORA_OCP_TRIM_105_MA                               (0x0C)
  #define SX127X_RF_LORA_OCP_TRIM_110_MA                               (0x0D)
  #define SX127X_RF_LORA_OCP_TRIM_115_MA                               (0x0E)
  #define SX127X_RF_LORA_OCP_TRIM_120_MA                               (0x0F)
  #define SX127X_RF_LORA_OCP_TRIM_130_MA                               (0x10)
  #define SX127X_RF_LORA_OCP_TRIM_140_MA                               (0x11)
  #define SX127X_RF_LORA_OCP_TRIM_150_MA                               (0x12)
  #define SX127X_RF_LORA_OCP_TRIM_160_MA                               (0x13)
  #define SX127X_RF_LORA_OCP_TRIM_170_MA                               (0x14)
  #define SX127X_RF_LORA_OCP_TRIM_180_MA                               (0x15)
  #define SX127X_RF_LORA_OCP_TRIM_190_MA                               (0x16)
  #define SX127X_RF_LORA_OCP_TRIM_200_MA                               (0x17)
  #define SX127X_RF_LORA_OCP_TRIM_210_MA                               (0x18)
  #define SX127X_RF_LORA_OCP_TRIM_220_MA                               (0x19)
  #define SX127X_RF_LORA_OCP_TRIM_230_MA                               (0x1A)
  #define SX127X_RF_LORA_OCP_TRIM_240_MA                               (0x1B)
  
  /* RegLna */
  #define SX127X_RF_LORA_LNA_GAIN_MASK                                 (0x1F)
  #define SX127X_RF_LORA_LNA_GAIN_G1                                   (0x20) /* Default */
  #define SX127X_RF_LORA_LNA_GAIN_G2                                   (0x40)
  #define SX127X_RF_LORA_LNA_GAIN_G3                                   (0x60)
  #define SX127X_RF_LORA_LNA_GAIN_G4                                   (0x80)
  #define SX127X_RF_LORA_LNA_GAIN_G5                                   (0xA0)
  #define SX127X_RF_LORA_LNA_GAIN_G6                                   (0xC0)
  
  #define SX127X_RF_LORA_LNA_BOOST_LF_MASK                             (0xE7)
  #define SX127X_RF_LORA_LNA_BOOST_LF_DEFAULT                          (0x00) /* Default */
  
  #define SX127X_RF_LORA_LNA_BOOST_HF_MASK                             (0xFC)
  #define SX127X_RF_LORA_LNA_BOOST_HF_OFF                              (0x00) /* Default */
  #define SX127X_RF_LORA_LNA_BOOST_HF_ON                               (0x03)
  
  /* RegFifoAddrPtr */
  #define SX127X_RF_LORA_FIFOADDRPTR                                   (0x00) /* Default */
  
  /* RegFifoTxBaseAddr */
  #define SX127X_RF_LORA_FIFOTXBASEADDR                                (0x80) /* Default */
  
  /* RegFifoTxBaseAddr */
  #define SX127X_RF_LORA_FIFORXBASEADDR                                (0x00) /* Default */
  
  /* RegIrqFlagsMask */
  #define SX127X_RF_LORA_IRQFLAGS_RXTIMEOUT_MASK                       (0x80)
  #define SX127X_RF_LORA_IRQFLAGS_RXDONE_MASK                          (0x40)
  #define SX127X_RF_LORA_IRQFLAGS_PAYLOADCRCERROR_MASK                 (0x20)
  #define SX127X_RF_LORA_IRQFLAGS_VALIDHEADER_MASK                     (0x10)
  #define SX127X_RF_LORA_IRQFLAGS_TXDONE_MASK                          (0x08)
  #define SX127X_RF_LORA_IRQFLAGS_CADDONE_MASK                         (0x04)
  #define SX127X_RF_LORA_IRQFLAGS_FHSSCHANGEDCHANNEL_MASK              (0x02)
  #define SX127X_RF_LORA_IRQFLAGS_CADDETECTED_MASK                     (0x01)
  
  /* RegIrqFlags */
  #define SX127X_RF_LORA_IRQFLAGS_RXTIMEOUT                            (0x80)
  #define SX127X_RF_LORA_IRQFLAGS_RXDONE                               (0x40)
  #define SX127X_RF_LORA_IRQFLAGS_PAYLOADCRCERROR                      (0x20)
  #define SX127X_RF_LORA_IRQFLAGS_VALIDHEADER                          (0x10)
  #define SX127X_RF_LORA_IRQFLAGS_TXDONE                               (0x08)
  #define SX127X_RF_LORA_IRQFLAGS_CADDONE                              (0x04)
  #define SX127X_RF_LORA_IRQFLAGS_FHSSCHANGEDCHANNEL                   (0x02)
  #define SX127X_RF_LORA_IRQFLAGS_CADDETECTED                          (0x01)
  
  /* RegModemStat (Read Only) */
  #define SX127X_RF_LORA_MODEMSTAT_RX_CR_MASK                          (0x1F)
  #define SX127X_RF_LORA_MODEMSTAT_MODEM_STATUS_MASK                   (0xE0)
  
  /* RegHopChannel (Read Only) */
  #define SX127X_RF_LORA_HOPCHANNEL_PLL_LOCK_TIMEOUT_MASK              (0x7F)
  #define SX127X_RF_LORA_HOPCHANNEL_PLL_LOCK_FAIL                      (0x80)
  #define SX127X_RF_LORA_HOPCHANNEL_PLL_LOCK_SUCCEED                   (0x00) /* Default */
  
  #define SX127X_RF_LORA_HOPCHANNEL_CRCONPAYLOAD_MASK                  (0xBF)
  #define SX127X_RF_LORA_HOPCHANNEL_CRCONPAYLOAD_ON                    (0x40)
  #define SX127X_RF_LORA_HOPCHANNEL_CRCONPAYLOAD_OFF                   (0x00) /* Default */
  
  #define SX127X_RF_LORA_HOPCHANNEL_CHANNEL_MASK                       (0x3F)
  
  /* RegModemConfig1 */
  #define SX1272_RF_LORA_MODEMCONFIG1_BW_MASK                          (0x3F)
  #define SX1272_RF_LORA_MODEMCONFIG1_BW_125_KHZ                       (0x00) /* Default */
  #define SX1272_RF_LORA_MODEMCONFIG1_BW_250_KHZ                       (0x40)
  #define SX1272_RF_LORA_MODEMCONFIG1_BW_500_KHZ                       (0x80)
  
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_MASK                          (0x0F)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_7_81_KHZ                      (0x00)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_10_41_KHZ                     (0x10)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_15_62_KHZ                     (0x20)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_20_83_KHZ                     (0x30)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_31_25_KHZ                     (0x40)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_41_66_KHZ                     (0x50)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_62_50_KHZ                     (0x60)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_125_KHZ                       (0x70) /* Default */
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_250_KHZ                       (0x80)
  #define SX1276_RF_LORA_MODEMCONFIG1_BW_500_KHZ                       (0x90)
  
  #define SX1272_RF_LORA_MODEMCONFIG1_CODINGRATE_MASK                  (0xC7)
  #define SX1272_RF_LORA_MODEMCONFIG1_CODINGRATE_4_5                   (0x08)
  #define SX1272_RF_LORA_MODEMCONFIG1_CODINGRATE_4_6                   (0x10) /* Default */
  #define SX1272_RF_LORA_MODEMCONFIG1_CODINGRATE_4_7                   (0x18)
  #define SX1272_RF_LORA_MODEMCONFIG1_CODINGRATE_4_8                   (0x20)
  
  #define SX1276_RF_LORA_MODEMCONFIG1_CODINGRATE_MASK                  (0xF1)
  #define SX1276_RF_LORA_MODEMCONFIG1_CODINGRATE_4_5                   (0x02)
  #define SX1276_RF_LORA_MODEMCONFIG1_CODINGRATE_4_6                   (0x04) /* Default */
  #define SX1276_RF_LORA_MODEMCONFIG1_CODINGRATE_4_7                   (0x06)
  #define SX1276_RF_LORA_MODEMCONFIG1_CODINGRATE_4_8                   (0x08)
  
  #define SX1272_RF_LORA_MODEMCONFIG1_IMPLICITHEADER_MASK              (0xFB)
  #define SX1276_RF_LORA_MODEMCONFIG1_IMPLICITHEADER_MASK              (0xFE)
  #define SX127X_RF_LORA_MODEMCONFIG1_IMPLICITHEADER_ON                (0x01)
  #define SX127X_RF_LORA_MODEMCONFIG1_IMPLICITHEADER_OFF               (0x00) /* Default */
  
  #define SX1272_RF_LORA_MODEMCONFIG1_RXPAYLOADCRC_MASK                (0xFD)
  #define SX1272_RF_LORA_MODEMCONFIG1_RXPAYLOADCRC_ON                  (0x02)
  #define SX1272_RF_LORA_MODEMCONFIG1_RXPAYLOADCRC_OFF                 (0x00) /* Default */
  
  #define SX127X_RF_LORA_MODEMCONFIG1_LOWDATARATEOPTIMIZE_MASK         (0xFE)
  
  /* RegModemConfig2 */
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_MASK                          (0x0F)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_6                             (0x60)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_7                             (0x70) /* Default */
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_8                             (0x80)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_9                             (0x90)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_10                            (0xA0)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_11                            (0xB0)
  #define SX127X_RF_LORA_MODEMCONFIG2_SF_12                            (0xC0)
  
  #define SX127X_RF_LORA_MODEMCONFIG2_TXCONTINUOUSMODE_MASK            (0xF7)
  #define SX127X_RF_LORA_MODEMCONFIG2_TXCONTINUOUSMODE_ON              (0x08)
  #define SX127X_RF_LORA_MODEMCONFIG2_TXCONTINUOUSMODE_OFF             (0x00)
  
  #define SX1276_RF_LORA_MODEMCONFIG2_RXPAYLOADCRC_MASK                (0xFB)
  #define SX1276_RF_LORA_MODEMCONFIG2_RXPAYLOADCRC_ON                  (0x04)
  #define SX1276_RF_LORA_MODEMCONFIG2_RXPAYLOADCRC_OFF                 (0x00) /* Default */
  
  #define SX127X_RF_LORA_MODEMCONFIG2_SYMBTIMEOUTMSB_MASK              (0xFC)
  #define SX127X_RF_LORA_MODEMCONFIG2_SYMBTIMEOUTMSB                   (0x00) /* Default */
  
  /* RegSymbTimeoutLsb */
  #define SX127X_RF_LORA_SYMBTIMEOUTLSB_SYMBTIMEOUT                    (0x64) /* Default */
  
  /* RegPreambleLengthMsb */
  #define SX127X_RF_LORA_PREAMBLELENGTHMSB                             (0x00) /* Default */
  
  /* RegPreambleLengthLsb */
  #define SX127X_RF_LORA_PREAMBLELENGTHLSB                             (0x08) /* Default */
  
  /* RegPayloadLength */
  #define SX127X_RF_LORA_PAYLOADLENGTH                                 (0x0E) /* Default */
  
  /* RegPayloadMaxLength */
  #define SX127X_RF_LORA_PAYLOADMAXLENGTH                              (0xFF) /* Default */
  
  /* RegHopPeriod */
  #define SX127X_RF_LORA_HOPPERIOD_FREQFOPPINGPERIOD                   (0x00) /* Default */
  
  /* RegModemConfig3 */
  #define SX127X_RF_LORA_MODEMCONFIG3_LOWDATARATEOPTIMIZE_MASK         (0xF7)
  #define SX127X_RF_LORA_MODEMCONFIG3_LOWDATARATEOPTIMIZE_ON           (0x08)
  #define SX127X_RF_LORA_MODEMCONFIG3_LOWDATARATEOPTIMIZE_OFF          (0x00) /* Default */
  
  #define SX127X_RF_LORA_MODEMCONFIG3_AGCAUTO_MASK                     (0xFB)
  #define SX127X_RF_LORA_MODEMCONFIG3_AGCAUTO_ON                       (0x04) /* Default */
  #define SX127X_RF_LORA_MODEMCONFIG3_AGCAUTO_OFF                      (0x00)
  
  /* RegDetectOptimize */
  #define SX127X_RF_LORA_DETECTIONOPTIMIZE_MASK                        (0xF8)
  #define SX127X_RF_LORA_DETECTIONOPTIMIZE_SF7_TO_SF12                 (0x03) /* Default */
  #define SX127X_RF_LORA_DETECTIONOPTIMIZE_SF6                         (0x05)
  
  /* RegInvertIQ */
  #define SX127X_RF_LORA_INVERTIQ_RX_MASK                              (0xBF)
  #define SX127X_RF_LORA_INVERTIQ_RX_OFF                               (0x00)
  #define SX127X_RF_LORA_INVERTIQ_RX_ON                                (0x40)
  #define SX127X_RF_LORA_INVERTIQ_TX_MASK                              (0xFE)
  #define SX127X_RF_LORA_INVERTIQ_TX_OFF                               (0x01)
  #define SX127X_RF_LORA_INVERTIQ_TX_ON                                (0x00)
  
  /* RegDetectionThreshold */
  #define SX127X_RF_LORA_DETECTIONTHRESH_SF7_TO_SF12                   (0x0A) /* Default */
  #define SX127X_RF_LORA_DETECTIONTHRESH_SF6                           (0x0C)
  
  /* RegInvertIQ2 */
  #define SX127X_RF_LORA_INVERTIQ2_ON                                  (0x19)
  #define SX127X_RF_LORA_INVERTIQ2_OFF                                 (0x1D)
  
  /* RegDioMapping1 */
  #define SX127X_RF_LORA_DIOMAPPING1_DIO0_MASK                         (0x3F)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO0_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING1_DIO0_01                           (0x40)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO0_10                           (0x80)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO0_11                           (0xC0)
  
  #define SX127X_RF_LORA_DIOMAPPING1_DIO1_MASK                         (0xCF)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO1_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING1_DIO1_01                           (0x10)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO1_10                           (0x20)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO1_11                           (0x30)
  
  #define SX127X_RF_LORA_DIOMAPPING1_DIO2_MASK                         (0xF3)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO2_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING1_DIO2_01                           (0x04)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO2_10                           (0x08)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO2_11                           (0x0C)
  
  #define SX127X_RF_LORA_DIOMAPPING1_DIO3_MASK                         (0xFC)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO3_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING1_DIO3_01                           (0x01)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO3_10                           (0x02)
  #define SX127X_RF_LORA_DIOMAPPING1_DIO3_11                           (0x03)
  
  /* RegDioMapping2 */
  #define SX127X_RF_LORA_DIOMAPPING2_DIO4_MASK                         (0x3F)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO4_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING2_DIO4_01                           (0x40)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO4_10                           (0x80)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO4_11                           (0xC0)
  
  #define SX127X_RF_LORA_DIOMAPPING2_DIO5_MASK                         (0xCF)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO5_00                           (0x00)  /* Default */
  #define SX127X_RF_LORA_DIOMAPPING2_DIO5_01                           (0x10)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO5_10                           (0x20)
  #define SX127X_RF_LORA_DIOMAPPING2_DIO5_11                           (0x30)
  
  #define SX127X_RF_LORA_DIOMAPPING2_MAP_MASK                          (0xFE)
  #define SX127X_RF_LORA_DIOMAPPING2_MAP_PREAMBLEDETECT                (0x01)
  #define SX127X_RF_LORA_DIOMAPPING2_MAP_RSSI                          (0x00)  /* Default */
  
  /* RegPllHop */
  #define SX127X_RF_LORA_PLLHOP_FASTHOP_MASK                           (0x7F)
  #define SX127X_RF_LORA_PLLHOP_FASTHOP_ON                             (0x80)
  #define SX127X_RF_LORA_PLLHOP_FASTHOP_OFF                            (0x00)  /* Default */
  
  /* RegTcxo */
  #define SX127X_RF_LORA_TCXO_TCXOINPUT_MASK                           (0xEF)
  #define SX127X_RF_LORA_TCXO_TCXOINPUT_ON                             (0x10)
  #define SX127X_RF_LORA_TCXO_TCXOINPUT_OFF                            (0x00)  /* Default */
  
  /* RegPaDac */
  #define SX127X_RF_LORA_PADAC_20DBM_MASK                              (0xF8)
  #define SX127X_RF_LORA_PADAC_20DBM_ON                                (0x07)
  #define SX127X_RF_LORA_PADAC_20DBM_OFF                               (0x04)  /* Default */
  
  /* RegBitrateFrac */
  #define RF_BITRATEFRAC_MASK                                          (0xF0)
  
  /* RegPll */
  #define RF_PLL_BANDWIDTH_MASK                                        (0x3F)
  #define RF_PLL_BANDWIDTH_75                                          (0x00)
  #define RF_PLL_BANDWIDTH_150                                         (0x40)
  #define RF_PLL_BANDWIDTH_225                                         (0x80)
  #define RF_PLL_BANDWIDTH_300                                         (0xC0)  /* Default */
  /** @} */
  
  
  /* FSK modem definitions */
  
  /**
   * @name   SX127X FSK modem internal registers address
   * @{
   */
  #define SX127X_REG_FIFO                                              (0x00)
  
  /* Common settings */
  #define SX127X_REG_OPMODE                                            (0x01)
  #define SX127X_REG_BITRATEMSB                                        (0x02)
  #define SX127X_REG_BITRATELSB                                        (0x03)
  #define SX127X_REG_FDEVMSB                                           (0x04)
  #define SX127X_REG_FDEVLSB                                           (0x05)
  #define SX127X_REG_FRFMSB                                            (0x06)
  #define SX127X_REG_FRFMID                                            (0x07)
  #define SX127X_REG_FRFLSB                                            (0x08)
  
  /* Tx settings */
  #define SX127X_REG_PACONFIG                                          (0x09)
  #define SX127X_REG_PARAMP                                            (0x0A)
  #define SX127X_REG_OCP                                               (0x0B)
  
  /* Rx settings */
  #define SX127X_REG_LNA                                               (0x0C)
  #define SX127X_REG_RXCONFIG                                          (0x0D)
  #define SX127X_REG_RSSICONFIG                                        (0x0E)
  #define SX127X_REG_RSSICOLLISION                                     (0x0F)
  #define SX127X_REG_RSSITHRESH                                        (0x10)
  #define SX127X_REG_RSSIVALUE                                         (0x11)
  #define SX127X_REG_RXBW                                              (0x12)
  #define SX127X_REG_AFCBW                                             (0x13)
  #define SX127X_REG_OOKPEAK                                           (0x14)
  #define SX127X_REG_OOKFIX                                            (0x15)
  #define SX127X_REG_OOKAVG                                            (0x16)
  #define SX127X_REG_RES17                                             (0x17)
  #define SX127X_REG_RES18                                             (0x18)
  #define SX127X_REG_RES19                                             (0x19)
  #define SX127X_REG_AFCFEI                                            (0x1A)
  #define SX127X_REG_AFCMSB                                            (0x1B)
  #define SX127X_REG_AFCLSB                                            (0x1C)
  #define SX127X_REG_FEIMSB                                            (0x1D)
  #define SX127X_REG_FEILSB                                            (0x1E)
  #define SX127X_REG_PREAMBLEDETECT                                    (0x1F)
  #define SX127X_REG_RXTIMEOUT1                                        (0x20)
  #define SX127X_REG_RXTIMEOUT2                                        (0x21)
  #define SX127X_REG_RXTIMEOUT3                                        (0x22)
  #define SX127X_REG_RXDELAY                                           (0x23)
  
  /* Oscillator settings */
  #define SX127X_REG_OSC                                               (0x24)
  
  /* Packet handler settings */
  #define SX127X_REG_PREAMBLEMSB                                       (0x25)
  #define SX127X_REG_PREAMBLELSB                                       (0x26)
  #define SX127X_REG_SYNCCONFIG                                        (0x27)
  #define SX127X_REG_SYNCVALUE1                                        (0x28)
  #define SX127X_REG_SYNCVALUE2                                        (0x29)
  #define SX127X_REG_SYNCVALUE3                                        (0x2A)
  #define SX127X_REG_SYNCVALUE4                                        (0x2B)
  #define SX127X_REG_SYNCVALUE5                                        (0x2C)
  #define SX127X_REG_SYNCVALUE6                                        (0x2D)
  #define SX127X_REG_SYNCVALUE7                                        (0x2E)
  #define SX127X_REG_SYNCVALUE8                                        (0x2F)
  #define SX127X_REG_PACKETCONFIG1                                     (0x30)
  #define SX127X_REG_PACKETCONFIG2                                     (0x31)
  #define SX127X_REG_PAYLOADLENGTH                                     (0x32)
  #define SX127X_REG_NODEADRS                                          (0x33)
  #define SX127X_REG_BROADCASTADRS                                     (0x34)
  #define SX127X_REG_FIFOTHRESH                                        (0x35)
  
  /* SM settings */
  #define SX127X_REG_SEQCONFIG1                                        (0x36)
  #define SX127X_REG_SEQCONFIG2                                        (0x37)
  #define SX127X_REG_TIMERRESOL                                        (0x38)
  #define SX127X_REG_TIMER1COEF                                        (0x39)
  #define SX127X_REG_TIMER2COEF                                        (0x3A)
  
  /* Service settings */
  #define SX127X_REG_IMAGECAL                                          (0x3B)
  #define SX127X_REG_TEMP                                              (0x3C)
  #define SX127X_REG_LOWBAT                                            (0x3D)
  
  /* Status */
  #define SX127X_REG_IRQFLAGS1                                         (0x3E)
  #define SX127X_REG_IRQFLAGS2                                         (0x3F)
  
  /* I/O settings */
  #define SX127X_REG_DIOMAPPING1                                       (0x40)
  #define SX127X_REG_DIOMAPPING2                                       (0x41)
  
  /* Version */
  #define SX127X_REG_VERSION                                           (0x42)
  #define VERSION_SX1276                                               (0x12)
  #define VERSION_SX1272                                               (0x22)
  
  /* Additional settings */
  #define SX127X_REG_PLLHOP                                            (0x44)
  #define SX127X_REG_TCXO                                              (0x4B)
  #define SX1276_REG_PADAC                                             (0x4D)
  #define SX1272_REG_PADAC                                             (0x5A)
  #define SX127X_REG_FORMERTEMP                                        (0x5B)
  #define SX127X_REG_BITRATEFRAC                                       (0x5D)
  #define SX127X_REG_AGCREF                                            (0x61)
  #define SX127X_REG_AGCTHRESH1                                        (0x62)
  #define SX127X_REG_AGCTHRESH2                                        (0x63)
  #define SX127X_REG_AGCTHRESH3                                        (0x64)
  #define SX127X_REG_PLL                                               (0x70)
  /** @} */
  
  /**
   * @name   SX127X FSK bits control definition
   * @{
   */
  
  /* RegOpMode */
  #define SX127X_RF_OPMODE_LONGRANGEMODE_MASK                          (0x7F)
  #define SX127X_RF_OPMODE_LONGRANGEMODE_OFF                           (0x00)
  #define SX127X_RF_OPMODE_LONGRANGEMODE_ON                            (0x80)
  
  #define SX127X_RF_OPMODE_MODULATIONTYPE_MASK                         (0x9F)
  #define SX127X_RF_OPMODE_MODULATIONTYPE_FSK                          (0x00)  /* Default */
  #define SX127X_RF_OPMODE_MODULATIONTYPE_OOK                          (0x20)
  
  #define SX127X_RF_OPMODE_MODULATIONSHAPING_MASK                      (0xE7)
  #define SX127X_RF_OPMODE_MODULATIONSHAPING_00                        (0x00)  /* Default */
  #define SX127X_RF_OPMODE_MODULATIONSHAPING_01                        (0x08)
  #define SX127X_RF_OPMODE_MODULATIONSHAPING_10                        (0x10)
  #define SX127X_RF_OPMODE_MODULATIONSHAPING_11                        (0x18)
  
  #define SX127X_RF_OPMODE_MASK                                        (0xF8)
  #define SX127X_RF_OPMODE_SLEEP                                       (0x00)
  #define SX127X_RF_OPMODE_STANDBY                                     (0x01)  /* Default */
  #define SX127X_RF_OPMODE_SYNTHESIZER_TX                              (0x02)
  #define SX127X_RF_OPMODE_TRANSMITTER                                 (0x03)
  #define SX127X_RF_OPMODE_SYNTHESIZER_RX                              (0x04)
  #define SX127X_RF_OPMODE_RECEIVER                                    (0x05)
  #define SX127X_RF_OPMODE_RECEIVER_SINGLE                             (0x06)
  
  /* RegBitRate (bits/sec) */
  #define SX127X_RF_BITRATEMSB_1200_BPS                                (0x68)
  #define SX127X_RF_BITRATELSB_1200_BPS                                (0x2B)
  #define SX127X_RF_BITRATEMSB_2400_BPS                                (0x34)
  #define SX127X_RF_BITRATELSB_2400_BPS                                (0x15)
  #define SX127X_RF_BITRATEMSB_4800_BPS                                (0x1A)  /* Default */
  #define SX127X_RF_BITRATELSB_4800_BPS                                (0x0B)  /* Default */
  #define SX127X_RF_BITRATEMSB_9600_BPS                                (0x0D)
  #define SX127X_RF_BITRATELSB_9600_BPS                                (0x05)
  #define SX127X_RF_BITRATEMSB_15000_BPS                               (0x08)
  #define SX127X_RF_BITRATELSB_15000_BPS                               (0x55)
  #define SX127X_RF_BITRATEMSB_19200_BPS                               (0x06)
  #define SX127X_RF_BITRATELSB_19200_BPS                               (0x83)
  #define SX127X_RF_BITRATEMSB_38400_BPS                               (0x03)
  #define SX127X_RF_BITRATELSB_38400_BPS                               (0x41)
  #define SX127X_RF_BITRATEMSB_76800_BPS                               (0x01)
  #define SX127X_RF_BITRATELSB_76800_BPS                               (0xA1)
  #define SX127X_RF_BITRATEMSB_153600_BPS                              (0x00)
  #define SX127X_RF_BITRATELSB_153600_BPS                              (0xD0)
  #define SX127X_RF_BITRATEMSB_57600_BPS                               (0x02)
  #define SX127X_RF_BITRATELSB_57600_BPS                               (0x2C)
  #define SX127X_RF_BITRATEMSB_115200_BPS                              (0x01)
  #define SX127X_RF_BITRATELSB_115200_BPS                              (0x16)
  #define SX127X_RF_BITRATEMSB_12500_BPS                               (0x0A)
  #define SX127X_RF_BITRATELSB_12500_BPS                               (0x00)
  #define SX127X_RF_BITRATEMSB_25000_BPS                               (0x05)
  #define SX127X_RF_BITRATELSB_25000_BPS                               (0x00)
  #define SX127X_RF_BITRATEMSB_50000_BPS                               (0x02)
  #define SX127X_RF_BITRATELSB_50000_BPS                               (0x80)
  #define SX127X_RF_BITRATEMSB_100000_BPS                              (0x01)
  #define SX127X_RF_BITRATELSB_100000_BPS                              (0x40)
  #define SX127X_RF_BITRATEMSB_150000_BPS                              (0x00)
  #define SX127X_RF_BITRATELSB_150000_BPS                              (0xD5)
  #define SX127X_RF_BITRATEMSB_200000_BPS                              (0x00)
  #define SX127X_RF_BITRATELSB_200000_BPS                              (0xA0)
  #define SX127X_RF_BITRATEMSB_250000_BPS                              (0x00)
  #define SX127X_RF_BITRATELSB_250000_BPS                              (0x80)
  #define SX127X_RF_BITRATEMSB_32768_BPS                               (0x03)
  #define SX127X_RF_BITRATELSB_32768_BPS                               (0xD1)
  
  /* RegFdev (Hz) */
  #define SX127X_RF_FDEVMSB_2000_HZ                                    (0x00)
  #define SX127X_RF_FDEVLSB_2000_HZ                                    (0x21)
  #define SX127X_RF_FDEVMSB_5000_HZ                                    (0x00)  /* Default */
  #define SX127X_RF_FDEVLSB_5000_HZ                                    (0x52)  /* Default */
  #define SX127X_RF_FDEVMSB_10000_HZ                                   (0x00)
  #define SX127X_RF_FDEVLSB_10000_HZ                                   (0xA4)
  #define SX127X_RF_FDEVMSB_15000_HZ                                   (0x00)
  #define SX127X_RF_FDEVLSB_15000_HZ                                   (0xF6)
  #define SX127X_RF_FDEVMSB_20000_HZ                                   (0x01)
  #define SX127X_RF_FDEVLSB_20000_HZ                                   (0x48)
  #define SX127X_RF_FDEVMSB_25000_HZ                                   (0x01)
  #define SX127X_RF_FDEVLSB_25000_HZ                                   (0x9A)
  #define SX127X_RF_FDEVMSB_30000_HZ                                   (0x01)
  #define SX127X_RF_FDEVLSB_30000_HZ                                   (0xEC)
  #define SX127X_RF_FDEVMSB_35000_HZ                                   (0x02)
  #define SX127X_RF_FDEVLSB_35000_HZ                                   (0x3D)
  #define SX127X_RF_FDEVMSB_40000_HZ                                   (0x02)
  #define SX127X_RF_FDEVLSB_40000_HZ                                   (0x8F)
  #define SX127X_RF_FDEVMSB_45000_HZ                                   (0x02)
  #define SX127X_RF_FDEVLSB_45000_HZ                                   (0xE1)
  #define SX127X_RF_FDEVMSB_50000_HZ                                   (0x03)
  #define SX127X_RF_FDEVLSB_50000_HZ                                   (0x33)
  #define SX127X_RF_FDEVMSB_55000_HZ                                   (0x03)
  #define SX127X_RF_FDEVLSB_55000_HZ                                   (0x85)
  #define SX127X_RF_FDEVMSB_60000_HZ                                   (0x03)
  #define SX127X_RF_FDEVLSB_60000_HZ                                   (0xD7)
  #define SX127X_RF_FDEVMSB_65000_HZ                                   (0x04)
  #define SX127X_RF_FDEVLSB_65000_HZ                                   (0x29)
  #define SX127X_RF_FDEVMSB_70000_HZ                                   (0x04)
  #define SX127X_RF_FDEVLSB_70000_HZ                                   (0x7B)
  #define SX127X_RF_FDEVMSB_75000_HZ                                   (0x04)
  #define SX127X_RF_FDEVLSB_75000_HZ                                   (0xCD)
  #define SX127X_RF_FDEVMSB_80000_HZ                                   (0x05)
  #define SX127X_RF_FDEVLSB_80000_HZ                                   (0x1F)
  #define SX127X_RF_FDEVMSB_85000_HZ                                   (0x05)
  #define SX127X_RF_FDEVLSB_85000_HZ                                   (0x71)
  #define SX127X_RF_FDEVMSB_90000_HZ                                   (0x05)
  #define SX127X_RF_FDEVLSB_90000_HZ                                   (0xC3)
  #define SX127X_RF_FDEVMSB_95000_HZ                                   (0x06)
  #define SX127X_RF_FDEVLSB_95000_HZ                                   (0x14)
  #define SX127X_RF_FDEVMSB_100000_HZ                                  (0x06)
  #define SX127X_RF_FDEVLSB_100000_HZ                                  (0x66)
  #define SX127X_RF_FDEVMSB_110000_HZ                                  (0x07)
  #define SX127X_RF_FDEVLSB_110000_HZ                                  (0x0A)
  #define SX127X_RF_FDEVMSB_120000_HZ                                  (0x07)
  #define SX127X_RF_FDEVLSB_120000_HZ                                  (0xAE)
  #define SX127X_RF_FDEVMSB_130000_HZ                                  (0x08)
  #define SX127X_RF_FDEVLSB_130000_HZ                                  (0x52)
  #define SX127X_RF_FDEVMSB_140000_HZ                                  (0x08)
  #define SX127X_RF_FDEVLSB_140000_HZ                                  (0xF6)
  #define SX127X_RF_FDEVMSB_150000_HZ                                  (0x09)
  #define SX127X_RF_FDEVLSB_150000_HZ                                  (0x9A)
  #define SX127X_RF_FDEVMSB_160000_HZ                                  (0x0A)
  #define SX127X_RF_FDEVLSB_160000_HZ                                  (0x3D)
  #define SX127X_RF_FDEVMSB_170000_HZ                                  (0x0A)
  #define SX127X_RF_FDEVLSB_170000_HZ                                  (0xE1)
  #define SX127X_RF_FDEVMSB_180000_HZ                                  (0x0B)
  #define SX127X_RF_FDEVLSB_180000_HZ                                  (0x85)
  #define SX127X_RF_FDEVMSB_190000_HZ                                  (0x0C)
  #define SX127X_RF_FDEVLSB_190000_HZ                                  (0x29)
  #define SX127X_RF_FDEVMSB_200000_HZ                                  (0x0C)
  #define SX127X_RF_FDEVLSB_200000_HZ                                  (0xCD)
  
  /* RegFrf (MHz) */
  #define SX127X_RF_FRFMSB_863_MHZ                                     (0xD7)
  #define SX127X_RF_FRFMID_863_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_863_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_864_MHZ                                     (0xD8)
  #define SX127X_RF_FRFMID_864_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_864_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_865_MHZ                                     (0xD8)
  #define SX127X_RF_FRFMID_865_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_865_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_866_MHZ                                     (0xD8)
  #define SX127X_RF_FRFMID_866_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_866_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_867_MHZ                                     (0xD8)
  #define SX127X_RF_FRFMID_867_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_867_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_868_MHZ                                     (0xD9)
  #define SX127X_RF_FRFMID_868_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_868_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_869_MHZ                                     (0xD9)
  #define SX127X_RF_FRFMID_869_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_869_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_870_MHZ                                     (0xD9)
  #define SX127X_RF_FRFMID_870_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_870_MHZ                                     (0x00)
  
  #define SX127X_RF_FRFMSB_902_MHZ                                     (0xE1)
  #define SX127X_RF_FRFMID_902_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_902_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_903_MHZ                                     (0xE1)
  #define SX127X_RF_FRFMID_903_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_903_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_904_MHZ                                     (0xE2)
  #define SX127X_RF_FRFMID_904_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_904_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_905_MHZ                                     (0xE2)
  #define SX127X_RF_FRFMID_905_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_905_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_906_MHZ                                     (0xE2)
  #define SX127X_RF_FRFMID_906_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_906_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_907_MHZ                                     (0xE2)
  #define SX127X_RF_FRFMID_907_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_907_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_908_MHZ                                     (0xE3)
  #define SX127X_RF_FRFMID_908_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_908_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_909_MHZ                                     (0xE3)
  #define SX127X_RF_FRFMID_909_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_909_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_910_MHZ                                     (0xE3)
  #define SX127X_RF_FRFMID_910_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_910_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_911_MHZ                                     (0xE3)
  #define SX127X_RF_FRFMID_911_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_911_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_912_MHZ                                     (0xE4)
  #define SX127X_RF_FRFMID_912_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_912_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_913_MHZ                                     (0xE4)
  #define SX127X_RF_FRFMID_913_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_913_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_914_MHZ                                     (0xE4)
  #define SX127X_RF_FRFMID_914_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_914_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_915_MHZ                                     (0xE4)  /* Default */
  #define SX127X_RF_FRFMID_915_MHZ                                     (0xC0)  /* Default */
  #define SX127X_RF_FRFLSB_915_MHZ                                     (0x00)  /* Default */
  #define SX127X_RF_FRFMSB_916_MHZ                                     (0xE5)
  #define SX127X_RF_FRFMID_916_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_916_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_917_MHZ                                     (0xE5)
  #define SX127X_RF_FRFMID_917_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_917_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_918_MHZ                                     (0xE5)
  #define SX127X_RF_FRFMID_918_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_918_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_919_MHZ                                     (0xE5)
  #define SX127X_RF_FRFMID_919_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_919_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_920_MHZ                                     (0xE6)
  #define SX127X_RF_FRFMID_920_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_920_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_921_MHZ                                     (0xE6)
  #define SX127X_RF_FRFMID_921_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_921_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_922_MHZ                                     (0xE6)
  #define SX127X_RF_FRFMID_922_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_922_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_923_MHZ                                     (0xE6)
  #define SX127X_RF_FRFMID_923_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_923_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_924_MHZ                                     (0xE7)
  #define SX127X_RF_FRFMID_924_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_924_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_925_MHZ                                     (0xE7)
  #define SX127X_RF_FRFMID_925_MHZ                                     (0x40)
  #define SX127X_RF_FRFLSB_925_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_926_MHZ                                     (0xE7)
  #define SX127X_RF_FRFMID_926_MHZ                                     (0x80)
  #define SX127X_RF_FRFLSB_926_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_927_MHZ                                     (0xE7)
  #define SX127X_RF_FRFMID_927_MHZ                                     (0xC0)
  #define SX127X_RF_FRFLSB_927_MHZ                                     (0x00)
  #define SX127X_RF_FRFMSB_928_MHZ                                     (0xE8)
  #define SX127X_RF_FRFMID_928_MHZ                                     (0x00)
  #define SX127X_RF_FRFLSB_928_MHZ                                     (0x00)
  
  /* RegPaConfig */
  #define SX127X_RF_PACONFIG_PASELECT_MASK                             (0x7F)
  #define SX127X_RF_PACONFIG_PASELECT_PABOOST                          (0x80)
  #define SX127X_RF_PACONFIG_PASELECT_RFO                              (0x00) /* Default */
  
  #define SX127X_RF_PACONFIG_MAX_POWER_MASK                            (0x8F)
  
  #define SX127X_RF_PACONFIG_OUTPUTPOWER_MASK                          (0xF0)
  
  /* RegPaRamp */
  #define SX127X_RF_PARAMP_LOWPNTXPLL_MASK                             (0xE0)
  #define SX127X_RF_PARAMP_LOWPNTXPLL_OFF                              (0x10)  /* Default */
  #define SX127X_RF_PARAMP_LOWPNTXPLL_ON                               (0x00)
  
  #define SX127X_RF_PARAMP_MASK                                        (0xF0)
  #define SX127X_RF_PARAMP_3400_US                                     (0x00)
  #define SX127X_RF_PARAMP_2000_US                                     (0x01)
  #define SX127X_RF_PARAMP_1000_US                                     (0x02)
  #define SX127X_RF_PARAMP_0500_US                                     (0x03)
  #define SX127X_RF_PARAMP_0250_US                                     (0x04)
  #define SX127X_RF_PARAMP_0125_US                                     (0x05)
  #define SX127X_RF_PARAMP_0100_US                                     (0x06)
  #define SX127X_RF_PARAMP_0062_US                                     (0x07)
  #define SX127X_RF_PARAMP_0050_US                                     (0x08)
  #define SX127X_RF_PARAMP_0040_US                                     (0x09)  /* Default */
  #define SX127X_RF_PARAMP_0031_US                                     (0x0A)
  #define SX127X_RF_PARAMP_0025_US                                     (0x0B)
  #define SX127X_RF_PARAMP_0020_US                                     (0x0C)
  #define SX127X_RF_PARAMP_0015_US                                     (0x0D)
  #define SX127X_RF_PARAMP_0012_US                                     (0x0E)
  #define SX127X_RF_PARAMP_0010_US                                     (0x0F)
  
  /* RegOcp */
  #define SX127X_RF_OCP_MASK                                           (0xDF)
  #define SX127X_RF_OCP_ON                                             (0x20)  /* Default */
  #define SX127X_RF_OCP_OFF                                            (0x00)
  
  #define SX127X_RF_OCP_TRIM_MASK                                      (0xE0)
  #define SX127X_RF_OCP_TRIM_045_MA                                    (0x00)
  #define SX127X_RF_OCP_TRIM_050_MA                                    (0x01)
  #define SX127X_RF_OCP_TRIM_055_MA                                    (0x02)
  #define SX127X_RF_OCP_TRIM_060_MA                                    (0x03)
  #define SX127X_RF_OCP_TRIM_065_MA                                    (0x04)
  #define SX127X_RF_OCP_TRIM_070_MA                                    (0x05)
  #define SX127X_RF_OCP_TRIM_075_MA                                    (0x06)
  #define SX127X_RF_OCP_TRIM_080_MA                                    (0x07)
  #define SX127X_RF_OCP_TRIM_085_MA                                    (0x08)
  #define SX127X_RF_OCP_TRIM_090_MA                                    (0x09)
  #define SX127X_RF_OCP_TRIM_095_MA                                    (0x0A)
  #define SX127X_RF_OCP_TRIM_100_MA                                    (0x0B)  /* Default */
  #define SX127X_RF_OCP_TRIM_105_MA                                    (0x0C)
  #define SX127X_RF_OCP_TRIM_110_MA                                    (0x0D)
  #define SX127X_RF_OCP_TRIM_115_MA                                    (0x0E)
  #define SX127X_RF_OCP_TRIM_120_MA                                    (0x0F)
  #define SX127X_RF_OCP_TRIM_130_MA                                    (0x10)
  #define SX127X_RF_OCP_TRIM_140_MA                                    (0x11)
  #define SX127X_RF_OCP_TRIM_150_MA                                    (0x12)
  #define SX127X_RF_OCP_TRIM_160_MA                                    (0x13)
  #define SX127X_RF_OCP_TRIM_170_MA                                    (0x14)
  #define SX127X_RF_OCP_TRIM_180_MA                                    (0x15)
  #define SX127X_RF_OCP_TRIM_190_MA                                    (0x16)
  #define SX127X_RF_OCP_TRIM_200_MA                                    (0x17)
  #define SX127X_RF_OCP_TRIM_210_MA                                    (0x18)
  #define SX127X_RF_OCP_TRIM_220_MA                                    (0x19)
  #define SX127X_RF_OCP_TRIM_230_MA                                    (0x1A)
  #define SX127X_RF_OCP_TRIM_240_MA                                    (0x1B)
  
  /* RegLna */
  #define SX127X_RF_LNA_GAIN_MASK                                      (0x1F)
  #define SX127X_RF_LNA_GAIN_G1                                        (0x20)  /* Default */
  #define SX127X_RF_LNA_GAIN_G2                                        (0x40)
  #define SX127X_RF_LNA_GAIN_G3                                        (0x60)
  #define SX127X_RF_LNA_GAIN_G4                                        (0x80)
  #define SX127X_RF_LNA_GAIN_G5                                        (0xA0)
  #define SX127X_RF_LNA_GAIN_G6                                        (0xC0)
  
  #define SX127X_RF_LNA_BOOST_MASK                                     (0xFC)
  #define SX127X_RF_LNA_BOOST_OFF                                      (0x00)  /* Default */
  #define SX127X_RF_LNA_BOOST_ON                                       (0x03)
  
  /* RegRxConfig */
  #define SX127X_RF_RXCONFIG_RESTARTRXONCOLLISION_MASK                 (0x7F)
  #define SX127X_RF_RXCONFIG_RESTARTRXONCOLLISION_ON                   (0x80)
  #define SX127X_RF_RXCONFIG_RESTARTRXONCOLLISION_OFF                  (0x00) /* Default */
  
  #define SX127X_RF_RXCONFIG_RESTARTRXWITHOUTPLLLOCK                   (0x40) /* Write only */
  
  #define SX127X_RF_RXCONFIG_RESTARTRXWITHPLLLOCK                      (0x20) /* Write only */
  
  #define SX127X_RF_RXCONFIG_AFCAUTO_MASK                              (0xEF)
  #define SX127X_RF_RXCONFIG_AFCAUTO_ON                                (0x10)
  #define SX127X_RF_RXCONFIG_AFCAUTO_OFF                               (0x00)  /* Default */
  
  #define SX127X_RF_RXCONFIG_AGCAUTO_MASK                              (0xF7)
  #define SX127X_RF_RXCONFIG_AGCAUTO_ON                                (0x08)  /* Default */
  #define SX127X_RF_RXCONFIG_AGCAUTO_OFF                               (0x00)
  
  #define SX127X_RF_RXCONFIG_RXTRIGER_MASK                             (0xF8)
  #define SX127X_RF_RXCONFIG_RXTRIGER_OFF                              (0x00)
  #define SX127X_RF_RXCONFIG_RXTRIGER_RSSI                             (0x01)
  #define SX127X_RF_RXCONFIG_RXTRIGER_PREAMBLEDETECT                   (0x06)  /* Default */
  #define SX127X_RF_RXCONFIG_RXTRIGER_RSSI_PREAMBLEDETECT              (0x07)
  
  /* RegRssiConfig */
  #define SX127X_RF_RSSICONFIG_OFFSET_MASK                             (0x07)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_00_DB                          (0x00)  /* Default */
  #define SX127X_RF_RSSICONFIG_OFFSET_P_01_DB                          (0x08)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_02_DB                          (0x10)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_03_DB                          (0x18)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_04_DB                          (0x20)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_05_DB                          (0x28)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_06_DB                          (0x30)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_07_DB                          (0x38)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_08_DB                          (0x40)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_09_DB                          (0x48)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_10_DB                          (0x50)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_11_DB                          (0x58)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_12_DB                          (0x60)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_13_DB                          (0x68)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_14_DB                          (0x70)
  #define SX127X_RF_RSSICONFIG_OFFSET_P_15_DB                          (0x78)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_16_DB                          (0x80)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_15_DB                          (0x88)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_14_DB                          (0x90)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_13_DB                          (0x98)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_12_DB                          (0xA0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_11_DB                          (0xA8)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_10_DB                          (0xB0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_09_DB                          (0xB8)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_08_DB                          (0xC0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_07_DB                          (0xC8)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_06_DB                          (0xD0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_05_DB                          (0xD8)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_04_DB                          (0xE0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_03_DB                          (0xE8)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_02_DB                          (0xF0)
  #define SX127X_RF_RSSICONFIG_OFFSET_M_01_DB                          (0xF8)
  
  #define SX127X_RF_RSSICONFIG_SMOOTHING_MASK                          (0xF8)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_2                             (0x00)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_4                             (0x01)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_8                             (0x02)  /* Default */
  #define SX127X_RF_RSSICONFIG_SMOOTHING_16                            (0x03)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_32                            (0x04)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_64                            (0x05)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_128                           (0x06)
  #define SX127X_RF_RSSICONFIG_SMOOTHING_256                           (0x07)
  
  /* RegRssiCollision */
  #define SX127X_RF_RSSICOLISION_THRESHOLD                             (0x0A)  /* Default */
  
  /* RegRssiThresh */
  #define SX127X_RF_RSSITHRESH_THRESHOLD                               (0xFF)  /* Default */
  
  /* RegRxBw */
  #define SX127X_RF_RXBW_MANT_MASK                                     (0xE7)
  #define SX127X_RF_RXBW_MANT_16                                       (0x00)
  #define SX127X_RF_RXBW_MANT_20                                       (0x08)
  #define SX127X_RF_RXBW_MANT_24                                       (0x10)  /* Default */
  
  #define SX127X_RF_RXBW_EXP_MASK                                      (0xF8)
  #define SX127X_RF_RXBW_EXP_0                                         (0x00)
  #define SX127X_RF_RXBW_EXP_1                                         (0x01)
  #define SX127X_RF_RXBW_EXP_2                                         (0x02)
  #define SX127X_RF_RXBW_EXP_3                                         (0x03)
  #define SX127X_RF_RXBW_EXP_4                                         (0x04)
  #define SX127X_RF_RXBW_EXP_5                                         (0x05)  /* Default */
  #define SX127X_RF_RXBW_EXP_6                                         (0x06)
  #define SX127X_RF_RXBW_EXP_7                                         (0x07)
  
  /* RegAfcBw */
  #define SX127X_RF_AFCBW_MANTAFC_MASK                                 (0xE7)
  #define SX127X_RF_AFCBW_MANTAFC_16                                   (0x00)
  #define SX127X_RF_AFCBW_MANTAFC_20                                   (0x08)  /* Default */
  #define SX127X_RF_AFCBW_MANTAFC_24                                   (0x10)
  
  #define SX127X_RF_AFCBW_EXPAFC_MASK                                  (0xF8)
  #define SX127X_RF_AFCBW_EXPAFC_0                                     (0x00)
  #define SX127X_RF_AFCBW_EXPAFC_1                                     (0x01)
  #define SX127X_RF_AFCBW_EXPAFC_2                                     (0x02)
  #define SX127X_RF_AFCBW_EXPAFC_3                                     (0x03)  /* Default */
  #define SX127X_RF_AFCBW_EXPAFC_4                                     (0x04)
  #define SX127X_RF_AFCBW_EXPAFC_5                                     (0x05)
  #define SX127X_RF_AFCBW_EXPAFC_6                                     (0x06)
  #define SX127X_RF_AFCBW_EXPAFC_7                                     (0x07)
  
  /* RegOokPeak */
  #define SX127X_RF_OOKPEAK_BITSYNC_MASK                               (0xDF)  /* Default */
  #define SX127X_RF_OOKPEAK_BITSYNC_ON                                 (0x20)  /* Default */
  #define SX127X_RF_OOKPEAK_BITSYNC_OFF                                (0x00)
  
  #define SX127X_RF_OOKPEAK_OOKTHRESHTYPE_MASK                         (0xE7)
  #define SX127X_RF_OOKPEAK_OOKTHRESHTYPE_FIXED                        (0x00)
  #define SX127X_RF_OOKPEAK_OOKTHRESHTYPE_PEAK                         (0x08)  /* Default */
  #define SX127X_RF_OOKPEAK_OOKTHRESHTYPE_AVERAGE                      (0x10)
  
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_MASK                     (0xF8)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_0_5_DB                   (0x00)  /* Default */
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_1_0_DB                   (0x01)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_1_5_DB                   (0x02)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_2_0_DB                   (0x03)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_3_0_DB                   (0x04)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_4_0_DB                   (0x05)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_5_0_DB                   (0x06)
  #define SX127X_RF_OOKPEAK_OOKPEAKTHRESHSTEP_6_0_DB                   (0x07)
  
  /* RegOokFix */
  #define SX127X_RF_OOKFIX_OOKFIXEDTHRESHOLD                           (0x0C)  /* Default */
  
  /* RegOokAvg */
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_MASK                       (0x1F)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_000                        (0x00)  /* Default */
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_001                        (0x20)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_010                        (0x40)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_011                        (0x60)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_100                        (0x80)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_101                        (0xA0)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_110                        (0xC0)
  #define SX127X_RF_OOKAVG_OOKPEAKTHRESHDEC_111                        (0xE0)
  
  #define SX127X_RF_OOKAVG_AVERAGEOFFSET_MASK                          (0xF3)
  #define SX127X_RF_OOKAVG_AVERAGEOFFSET_0_DB                          (0x00)  /* Default */
  #define SX127X_RF_OOKAVG_AVERAGEOFFSET_2_DB                          (0x04)
  #define SX127X_RF_OOKAVG_AVERAGEOFFSET_4_DB                          (0x08)
  #define SX127X_RF_OOKAVG_AVERAGEOFFSET_6_DB                          (0x0C)
  
  #define SX127X_RF_OOKAVG_OOKAVERAGETHRESHFILT_MASK                   (0xFC)
  #define SX127X_RF_OOKAVG_OOKAVERAGETHRESHFILT_00                     (0x00)
  #define SX127X_RF_OOKAVG_OOKAVERAGETHRESHFILT_01                     (0x01)
  #define SX127X_RF_OOKAVG_OOKAVERAGETHRESHFILT_10                     (0x02)  /* Default */
  #define SX127X_RF_OOKAVG_OOKAVERAGETHRESHFILT_11                     (0x03)
  
  /* RegAfcFei */
  #define SX127X_RF_AFCFEI_AGCSTART                                    (0x10)
  
  #define SX127X_RF_AFCFEI_AFCCLEAR                                    (0x02)
  
  #define SX127X_RF_AFCFEI_AFCAUTOCLEAR_MASK                           (0xFE)
  #define SX127X_RF_AFCFEI_AFCAUTOCLEAR_ON                             (0x01)
  #define SX127X_RF_AFCFEI_AFCAUTOCLEAR_OFF                            (0x00)  /* Default */
  
  /* RegPreambleDetect */
  #define SX127X_RF_PREAMBLEDETECT_DETECTOR_MASK                       (0x7F)
  #define SX127X_RF_PREAMBLEDETECT_DETECTOR_ON                         (0x80)  /* Default */
  #define SX127X_RF_PREAMBLEDETECT_DETECTOR_OFF                        (0x00)
  
  #define SX127X_RF_PREAMBLEDETECT_DETECTORSIZE_MASK                   (0x9F)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORSIZE_1                      (0x00)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORSIZE_2                      (0x20)  /* Default */
  #define SX127X_RF_PREAMBLEDETECT_DETECTORSIZE_3                      (0x40)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORSIZE_4                      (0x60)
  
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_MASK                    (0xE0)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_0                       (0x00)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_1                       (0x01)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_2                       (0x02)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_3                       (0x03)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_4                       (0x04)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_5                       (0x05)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_6                       (0x06)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_7                       (0x07)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_8                       (0x08)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_9                       (0x09)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_10                      (0x0A)  /* Default */
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_11                      (0x0B)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_12                      (0x0C)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_13                      (0x0D)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_14                      (0x0E)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_15                      (0x0F)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_16                      (0x10)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_17                      (0x11)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_18                      (0x12)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_19                      (0x13)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_20                      (0x14)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_21                      (0x15)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_22                      (0x16)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_23                      (0x17)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_24                      (0x18)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_25                      (0x19)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_26                      (0x1A)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_27                      (0x1B)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_28                      (0x1C)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_29                      (0x1D)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_30                      (0x1E)
  #define SX127X_RF_PREAMBLEDETECT_DETECTORTOL_31                      (0x1F)
  
  /* RegRxTimeout1 */
  #define SX127X_RF_RXTIMEOUT1_TIMEOUTRXRSSI                           (0x00)  /* Default */
  
  /* RegRxTimeout2 */
  #define SX127X_RF_RXTIMEOUT2_TIMEOUTRXPREAMBLE                       (0x00)  /* Default */
  
  /* RegRxTimeout3 */
  #define SX127X_RF_RXTIMEOUT3_TIMEOUTSIGNALSYNC                       (0x00)  /* Default */
  
  /* RegRxDelay */
  #define SX127X_RF_RXDELAY_INTERPACKETRXDELAY                         (0x00)  /* Default */
  
  /* RegOsc */
  #define SX127X_RF_OSC_RCCALSTART                                     (0x08)
  
  #define SX127X_RF_OSC_CLKOUT_MASK                                    (0xF8)
  #define SX127X_RF_OSC_CLKOUT_32_MHZ                                  (0x00)
  #define SX127X_RF_OSC_CLKOUT_16_MHZ                                  (0x01)
  #define SX127X_RF_OSC_CLKOUT_8_MHZ                                   (0x02)
  #define SX127X_RF_OSC_CLKOUT_4_MHZ                                   (0x03)
  #define SX127X_RF_OSC_CLKOUT_2_MHZ                                   (0x04)
  #define SX127X_RF_OSC_CLKOUT_1_MHZ                                   (0x05)  /* Default */
  #define SX127X_RF_OSC_CLKOUT_RC                                      (0x06)
  #define SX127X_RF_OSC_CLKOUT_OFF                                     (0x07)
  
  /* RegPreambleMsb/RegPreambleLsb */
  #define SX127X_RF_PREAMBLEMSB_SIZE                                   (0x00)  /* Default */
  #define SX127X_RF_PREAMBLELSB_SIZE                                   (0x03)  /* Default */
  
  /* RegSyncConfig */
  #define SX127X_RF_SYNCCONFIG_AUTORESTARTRXMODE_MASK                  (0x3F)
  #define SX127X_RF_SYNCCONFIG_AUTORESTARTRXMODE_WAITPLL_ON            (0x80)  /* Default */
  #define SX127X_RF_SYNCCONFIG_AUTORESTARTRXMODE_WAITPLL_OFF           (0x40)
  #define SX127X_RF_SYNCCONFIG_AUTORESTARTRXMODE_OFF                   (0x00)
  
  #define SX127X_RF_SYNCCONFIG_PREAMBLEPOLARITY_MASK                   (0xDF)
  #define SX127X_RF_SYNCCONFIG_PREAMBLEPOLARITY_55                     (0x20)
  #define SX127X_RF_SYNCCONFIG_PREAMBLEPOLARITY_AA                     (0x00)  /* Default */
  
  #define SX127X_RF_SYNCCONFIG_SYNC_MASK                               (0xEF)
  #define SX127X_RF_SYNCCONFIG_SYNC_ON                                 (0x10)  /* Default */
  #define SX127X_RF_SYNCCONFIG_SYNC_OFF                                (0x00)
  
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_MASK                           (0xF8)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_1                              (0x00)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_2                              (0x01)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_3                              (0x02)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_4                              (0x03)  /* Default */
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_5                              (0x04)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_6                              (0x05)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_7                              (0x06)
  #define SX127X_RF_SYNCCONFIG_SYNCSIZE_8                              (0x07)
  
  /* RegSyncValue1-8 */
  #define SX127X_RF_SYNCVALUE1_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE2_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE3_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE4_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE5_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE6_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE7_SYNCVALUE                               (0x01)  /* Default */
  #define SX127X_RF_SYNCVALUE8_SYNCVALUE                               (0x01)  /* Default */
  
  /* RegPacketConfig1 */
  #define SX127X_RF_PACKETCONFIG1_PACKETFORMAT_MASK                    (0x7F)
  #define SX127X_RF_PACKETCONFIG1_PACKETFORMAT_FIXED                   (0x00)
  #define SX127X_RF_PACKETCONFIG1_PACKETFORMAT_VARIABLE                (0x80)  /* Default */
  
  #define SX127X_RF_PACKETCONFIG1_DCFREE_MASK                          (0x9F)
  #define SX127X_RF_PACKETCONFIG1_DCFREE_OFF                           (0x00)  /* Default */
  #define SX127X_RF_PACKETCONFIG1_DCFREE_MANCHESTER                    (0x20)
  #define SX127X_RF_PACKETCONFIG1_DCFREE_WHITENING                     (0x40)
  
  #define SX127X_RF_PACKETCONFIG1_CRC_MASK                             (0xEF)
  #define SX127X_RF_PACKETCONFIG1_CRC_ON                               (0x10)  /* Default */
  #define SX127X_RF_PACKETCONFIG1_CRC_OFF                              (0x00)
  
  #define SX127X_RF_PACKETCONFIG1_CRCAUTOCLEAR_MASK                    (0xF7)
  #define SX127X_RF_PACKETCONFIG1_CRCAUTOCLEAR_ON                      (0x00)  /* Default */
  #define SX127X_RF_PACKETCONFIG1_CRCAUTOCLEAR_OFF                     (0x08)
  
  #define SX127X_RF_PACKETCONFIG1_ADDRSFILTERING_MASK                  (0xF9)
  #define SX127X_RF_PACKETCONFIG1_ADDRSFILTERING_OFF                   (0x00)  /* Default */
  #define SX127X_RF_PACKETCONFIG1_ADDRSFILTERING_NODE                  (0x02)
  #define SX127X_RF_PACKETCONFIG1_ADDRSFILTERING_NODEBROADCAST         (0x04)
  
  #define SX127X_RF_PACKETCONFIG1_CRCWHITENINGTYPE_MASK                (0xFE)
  #define SX127X_RF_PACKETCONFIG1_CRCWHITENINGTYPE_CCITT               (0x00)  /* Default */
  #define SX127X_RF_PACKETCONFIG1_CRCWHITENINGTYPE_IBM                 (0x01)
  
  /* RegPacketConfig2 */
  #define SX127X_RF_PACKETCONFIG2_WMBUS_CRC_ENABLE_MASK                (0x7F)
  #define SX127X_RF_PACKETCONFIG2_WMBUS_CRC_ENABLE                     (0x80)
  #define SX127X_RF_PACKETCONFIG2_WMBUS_CRC_DISABLE                    (0x00)  /* Default */
  
  #define SX127X_RF_PACKETCONFIG2_DATAMODE_MASK                        (0xBF)
  #define SX127X_RF_PACKETCONFIG2_DATAMODE_CONTINUOUS                  (0x00)
  #define SX127X_RF_PACKETCONFIG2_DATAMODE_PACKET                      (0x40)  /* Default */
  
  #define SX127X_RF_PACKETCONFIG2_IOHOME_MASK                          (0xDF)
  #define SX127X_RF_PACKETCONFIG2_IOHOME_ON                            (0x20)
  #define SX127X_RF_PACKETCONFIG2_IOHOME_OFF                           (0x00)  /* Default */
  
  #define SX127X_RF_PACKETCONFIG2_BEACON_MASK                          (0xF7)
  #define SX127X_RF_PACKETCONFIG2_BEACON_ON                            (0x08)
  #define SX127X_RF_PACKETCONFIG2_BEACON_OFF                           (0x00)  /* Default */
  
  #define SX127X_RF_PACKETCONFIG2_PAYLOADLENGTH_MSB_MASK               (0xF8)
  
  /* RegPayloadLength */
  #define SX127X_RF_PAYLOADLENGTH_LENGTH                               (0x40)  /* Default */
  
  /* RegNodeAdrs */
  #define SX127X_RF_NODEADDRESS_ADDRESS                                (0x00)
  
  /* RegBroadcastAdrs */
  #define SX127X_RF_BROADCASTADDRESS_ADDRESS                           (0x00)
  
  /* RegFifoThresh */
  #define SX127X_RF_FIFOTHRESH_TXSTARTCONDITION_MASK                   (0x7F)
  #define SX127X_RF_FIFOTHRESH_TXSTARTCONDITION_FIFOTHRESH             (0x00)  /* Default */
  #define SX127X_RF_FIFOTHRESH_TXSTARTCONDITION_FIFONOTEMPTY           (0x80)
  
  #define SX127X_RF_FIFOTHRESH_FIFOTHRESHOLD_MASK                      (0xC0)
  #define SX127X_RF_FIFOTHRESH_FIFOTHRESHOLD_THRESHOLD                 (0x0F)  /* Default */
  
  /* RegSeqConfig1 */
  #define SX127X_RF_SEQCONFIG1_SEQUENCER_START                         (0x80)
  
  #define SX127X_RF_SEQCONFIG1_SEQUENCER_STOP                          (0x40)
  
  #define SX127X_RF_SEQCONFIG1_IDLEMODE_MASK                           (0xDF)
  #define SX127X_RF_SEQCONFIG1_IDLEMODE_SLEEP                          (0x20)
  #define SX127X_RF_SEQCONFIG1_IDLEMODE_STANDBY                        (0x00)  /* Default */
  
  #define SX127X_RF_SEQCONFIG1_FROMSTART_MASK                          (0xE7)
  #define SX127X_RF_SEQCONFIG1_FROMSTART_TOLPS                         (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG1_FROMSTART_TORX                          (0x08)
  #define SX127X_RF_SEQCONFIG1_FROMSTART_TOTX                          (0x10)
  #define SX127X_RF_SEQCONFIG1_FROMSTART_TOTX_ONFIFOLEVEL              (0x18)
  
  #define SX127X_RF_SEQCONFIG1_LPS_MASK                                (0xFB)
  #define SX127X_RF_SEQCONFIG1_LPS_SEQUENCER_OFF                       (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG1_LPS_IDLE                                (0x04)
  
  #define SX127X_RF_SEQCONFIG1_FROMIDLE_MASK                           (0xFD)
  #define SX127X_RF_SEQCONFIG1_FROMIDLE_TOTX                           (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG1_FROMIDLE_TORX                           (0x02)
  
  #define SX127X_RF_SEQCONFIG1_FROMTX_MASK                             (0xFE)
  #define SX127X_RF_SEQCONFIG1_FROMTX_TOLPS                            (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG1_FROMTX_TORX                             (0x01)
  
  /* RegSeqConfig2 */
  #define SX127X_RF_SEQCONFIG2_FROMRX_MASK                             (0x1F)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOUNUSED_000                     (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG2_FROMRX_TORXPKT_ONPLDRDY                 (0x20)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOLPS_ONPLDRDY                   (0x40)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TORXPKT_ONCRCOK                  (0x60)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOSEQUENCEROFF_ONRSSI            (0x80)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOSEQUENCEROFF_ONSYNC            (0xA0)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOSEQUENCEROFF_ONPREAMBLE        (0xC0)
  #define SX127X_RF_SEQCONFIG2_FROMRX_TOUNUSED_111                     (0xE0)
  
  #define SX127X_RF_SEQCONFIG2_FROMRXTIMEOUT_MASK                      (0xE7)
  #define SX127X_RF_SEQCONFIG2_FROMRXTIMEOUT_TORXRESTART               (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG2_FROMRXTIMEOUT_TOTX                      (0x08)
  #define SX127X_RF_SEQCONFIG2_FROMRXTIMEOUT_TOLPS                     (0x10)
  #define SX127X_RF_SEQCONFIG2_FROMRXTIMEOUT_TOSEQUENCEROFF            (0x18)
  
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_MASK                          (0xF8)
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_TOSEQUENCEROFF                (0x00)  /* Default */
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_TOTX_ONFIFOEMPTY              (0x01)
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_TOLPS                         (0x02)
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_TOSYNTHESIZERRX               (0x03)
  #define SX127X_RF_SEQCONFIG2_FROMRXPKT_TORX                          (0x04)
  
  /* RegTimerResol */
  #define SX127X_RF_TIMERRESOL_TIMER1RESOL_MASK                        (0xF3)
  #define SX127X_RF_TIMERRESOL_TIMER1RESOL_OFF                         (0x00)  /* Default */
  #define SX127X_RF_TIMERRESOL_TIMER1RESOL_000064_US                   (0x04)
  #define SX127X_RF_TIMERRESOL_TIMER1RESOL_004100_US                   (0x08)
  #define SX127X_RF_TIMERRESOL_TIMER1RESOL_262000_US                   (0x0C)
  
  #define SX127X_RF_TIMERRESOL_TIMER2RESOL_MASK                        (0xFC)
  #define SX127X_RF_TIMERRESOL_TIMER2RESOL_OFF                         (0x00)  /* Default */
  #define SX127X_RF_TIMERRESOL_TIMER2RESOL_000064_US                   (0x01)
  #define SX127X_RF_TIMERRESOL_TIMER2RESOL_004100_US                   (0x02)
  #define SX127X_RF_TIMERRESOL_TIMER2RESOL_262000_US                   (0x03)
  
  /* RegTimer1Coef */
  #define SX127X_RF_TIMER1COEF_TIMER1COEFFICIENT                       (0xF5)  /* Default */
  
  /* RegTimer2Coef */
  #define SX127X_RF_TIMER2COEF_TIMER2COEFFICIENT                       (0x20)  /* Default */
  
  /* RegImageCal */
  #define SX127X_RF_IMAGECAL_AUTOIMAGECAL_MASK                         (0x7F)
  #define SX127X_RF_IMAGECAL_AUTOIMAGECAL_ON                           (0x80)
  #define SX127X_RF_IMAGECAL_AUTOIMAGECAL_OFF                          (0x00)  /* Default */
  
  #define SX127X_RF_IMAGECAL_IMAGECAL_MASK                             (0xBF)
  #define SX127X_RF_IMAGECAL_IMAGECAL_START                            (0x40)
  
  #define SX127X_RF_IMAGECAL_IMAGECAL_RUNNING                          (0x20)
  #define SX127X_RF_IMAGECAL_IMAGECAL_DONE                             (0x00)  /* Default */
  
  #define SX127X_RF_IMAGECAL_TEMPCHANGE_HIGHER                         (0x08)
  #define SX127X_RF_IMAGECAL_TEMPCHANGE_LOWER                          (0x00)
  
  #define SX127X_RF_IMAGECAL_TEMPTHRESHOLD_MASK                        (0xF9)
  #define SX127X_RF_IMAGECAL_TEMPTHRESHOLD_05                          (0x00)
  #define SX127X_RF_IMAGECAL_TEMPTHRESHOLD_10                          (0x02)  /* Default */
  #define SX127X_RF_IMAGECAL_TEMPTHRESHOLD_15                          (0x04)
  #define SX127X_RF_IMAGECAL_TEMPTHRESHOLD_20                          (0x06)
  
  #define SX127X_RF_IMAGECAL_TEMPMONITOR_MASK                          (0xFE)
  #define SX127X_RF_IMAGECAL_TEMPMONITOR_ON                            (0x00)  /* Default */
  #define SX127X_RF_IMAGECAL_TEMPMONITOR_OFF                           (0x01)
  
  /* RegLowBat */
  #define SX127X_RF_LOWBAT_MASK                                        (0xF7)
  #define SX127X_RF_LOWBAT_ON                                          (0x08)
  #define SX127X_RF_LOWBAT_OFF                                         (0x00)  /* Default */
  
  #define SX127X_RF_LOWBAT_TRIM_MASK                                   (0xF8)
  #define SX127X_RF_LOWBAT_TRIM_1695                                   (0x00)
  #define SX127X_RF_LOWBAT_TRIM_1764                                   (0x01)
  #define SX127X_RF_LOWBAT_TRIM_1835                                   (0x02)  /* Default */
  #define SX127X_RF_LOWBAT_TRIM_1905                                   (0x03)
  #define SX127X_RF_LOWBAT_TRIM_1976                                   (0x04)
  #define SX127X_RF_LOWBAT_TRIM_2045                                   (0x05)
  #define SX127X_RF_LOWBAT_TRIM_2116                                   (0x06)
  #define SX127X_RF_LOWBAT_TRIM_2185                                   (0x07)
  
  /* RegIrqFlags1 */
  #define SX127X_RF_IRQFLAGS1_MODEREADY                                (0x80)
  #define SX127X_RF_IRQFLAGS1_RXREADY                                  (0x40)
  #define SX127X_RF_IRQFLAGS1_TXREADY                                  (0x20)
  #define SX127X_RF_IRQFLAGS1_PLLLOCK                                  (0x10)
  #define SX127X_RF_IRQFLAGS1_RSSI                                     (0x08)
  #define SX127X_RF_IRQFLAGS1_TIMEOUT                                  (0x04)
  #define SX127X_RF_IRQFLAGS1_PREAMBLEDETECT                           (0x02)
  #define SX127X_RF_IRQFLAGS1_SYNCADDRESSMATCH                         (0x01)
  
  /* RegIrqFlags2 */
  #define SX127X_RF_IRQFLAGS2_FIFOFULL                                 (0x80)
  #define SX127X_RF_IRQFLAGS2_FIFOEMPTY                                (0x40)
  #define SX127X_RF_IRQFLAGS2_FIFOLEVEL                                (0x20)
  #define SX127X_RF_IRQFLAGS2_FIFOOVERRUN                              (0x10)
  #define SX127X_RF_IRQFLAGS2_PACKETSENT                               (0x08)
  #define SX127X_RF_IRQFLAGS2_PAYLOADREADY                             (0x04)
  #define SX127X_RF_IRQFLAGS2_CRCOK                                    (0x02)
  #define SX127X_RF_IRQFLAGS2_LOWBAT                                   (0x01)
  
  /* RegDioMapping1 */
  #define SX127X_RF_DIOMAPPING1_DIO0_MASK                              (0x3F)
  #define SX127X_RF_DIOMAPPING1_DIO0_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING1_DIO0_01                                (0x40)
  #define SX127X_RF_DIOMAPPING1_DIO0_10                                (0x80)
  #define SX127X_RF_DIOMAPPING1_DIO0_11                                (0xC0)
  
  #define SX127X_RF_DIOMAPPING1_DIO1_MASK                              (0xCF)
  #define SX127X_RF_DIOMAPPING1_DIO1_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING1_DIO1_01                                (0x10)
  #define SX127X_RF_DIOMAPPING1_DIO1_10                                (0x20)
  #define SX127X_RF_DIOMAPPING1_DIO1_11                                (0x30)
  
  #define SX127X_RF_DIOMAPPING1_DIO2_MASK                              (0xF3)
  #define SX127X_RF_DIOMAPPING1_DIO2_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING1_DIO2_01                                (0x04)
  #define SX127X_RF_DIOMAPPING1_DIO2_10                                (0x08)
  #define SX127X_RF_DIOMAPPING1_DIO2_11                                (0x0C)
  
  #define SX127X_RF_DIOMAPPING1_DIO3_MASK                              (0xFC)
  #define SX127X_RF_DIOMAPPING1_DIO3_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING1_DIO3_01                                (0x01)
  #define SX127X_RF_DIOMAPPING1_DIO3_10                                (0x02)
  #define SX127X_RF_DIOMAPPING1_DIO3_11                                (0x03)
  
  /* RegDioMapping2 */
  #define SX127X_RF_DIOMAPPING2_DIO4_MASK                              (0x3F)
  #define SX127X_RF_DIOMAPPING2_DIO4_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING2_DIO4_01                                (0x40)
  #define SX127X_RF_DIOMAPPING2_DIO4_10                                (0x80)
  #define SX127X_RF_DIOMAPPING2_DIO4_11                                (0xC0)
  
  #define SX127X_RF_DIOMAPPING2_DIO5_MASK                              (0xCF)
  #define SX127X_RF_DIOMAPPING2_DIO5_00                                (0x00)  /* Default */
  #define SX127X_RF_DIOMAPPING2_DIO5_01                                (0x10)
  #define SX127X_RF_DIOMAPPING2_DIO5_10                                (0x20)
  #define SX127X_RF_DIOMAPPING2_DIO5_11                                (0x30)
  
  #define SX127X_RF_DIOMAPPING2_MAP_MASK                               (0xFE)
  #define SX127X_RF_DIOMAPPING2_MAP_PREAMBLEDETECT                     (0x01)
  #define SX127X_RF_DIOMAPPING2_MAP_RSSI                               (0x00)  /* Default */
  
  /* RegPllHop */
  #define SX127X_RF_PLLHOP_FASTHOP_MASK                                (0x7F)
  #define SX127X_RF_PLLHOP_FASTHOP_ON                                  (0x80)
  #define SX127X_RF_PLLHOP_FASTHOP_OFF                                 (0x00) /* Default */
  
  /* RegTcxo */
  #define SX127X_RF_TCXO_TCXOINPUT_MASK                                (0xEF)
  #define SX127X_RF_TCXO_TCXOINPUT_ON                                  (0x10)
  #define SX127X_RF_TCXO_TCXOINPUT_OFF                                 (0x00)  /* Default */
  
  /* RegPaDac */
  #define SX127X_RF_PADAC_20DBM_MASK                                   (0xF8)
  #define SX127X_RF_PADAC_20DBM_ON                                     (0x07)
  #define SX127X_RF_PADAC_20DBM_OFF                                    (0x04)  /* Default */
  
  /* RegBitrateFrac */
  #define SX127X_RF_BITRATEFRAC_MASK                                   (0xF0)
  
  /* RegPll */
  #define SX127X_RF_PLL_BANDWIDTH_MASK                                 (0x3F)
  #define SX127X_RF_PLL_BANDWIDTH_75                                   (0x00)
  #define SX127X_RF_PLL_BANDWIDTH_150                                  (0x40)
  #define SX127X_RF_PLL_BANDWIDTH_225                                  (0x80)
  #define SX127X_RF_PLL_BANDWIDTH_300                                  (0xC0)  /* Default */
  /** @} */
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* SX127X_REGISTERS_H */
  /** @} */