forked from Wassasin/sx128x
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice.yaml
More file actions
762 lines (690 loc) · 13.2 KB
/
device.yaml
File metadata and controls
762 lines (690 loc) · 13.2 KB
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
config:
default_byte_order: BE
buffer_address_type: u8
command_address_type: u8
register_address_type: u16
defmt_feature: "defmt"
# 11.5 Data Buffer Operations
BUFFER:
type: buffer
address: 0x00
access: RW
# 12. List of Commands
GET_STATUS:
type: command
address: 0xC0
size_bits_out: 8
fields_out:
circuit_mode:
base: uint
start: 5
end: 8
try_conversion:
name: circuit_mode
stdby_rc: 0x2
stdby_xosc: 0x3
fs: 0x4
rx: 0x5
tx: 0x6
command_status:
base: uint
start: 2
end: 5
try_conversion:
name: command_status
command_success: 0x1
data_available: 0x2
command_timeout: 0x3
command_error: 0x4
command_failure: 0x5
command_done: 0x6
SET_SLEEP:
type: command
address: 0x84
size_bits_in: 8
fields_in:
buffer_retention:
base: bool
start: 1
ram_retention:
base: bool
start: 0
SET_STANDBY:
type: command
address: 0x80
size_bits_in: 8
fields_in:
standby_config:
base: uint
start: 0
end: 1
conversion:
name: standby_config
stdby_rc: 0
stdby_xosc: 1
SET_TX:
type: command
description: >
Sets the device in Transmit mode.
Clear IRQ status before using this command.
address: 0x83
size_bits_in: 24
fields_in:
period_base:
base: uint
start: 16
end: 18
conversion:
name: tx_timeout_step
step15us625: 0x00
step62us5: 0x01
step1ms: 0x02
step4ms: 0x03
period_base_count:
base: uint
start: 0
end: 16
conversion:
name: tx_timeout_base_count
single_mode: 0x0000
other: catch_all
SET_RX:
type: command
description: >
Sets the device in Receive mode.
Clear IRQ status before using this command.
address: 0x82
size_bits_in: 24
fields_in:
period_base:
base: uint
start: 16
end: 18
conversion:
name: rx_timeout_step
step15us625: 0x00
step62us5: 0x01
step1ms: 0x02
step4ms: 0x03
period_base_count:
base: uint
start: 0
end: 16
conversion:
name: rx_timeout_base_count
single_mode:
value: 0x0000
other:
value: catch_all
continuous: 0xFFFF
SET_RX_DUTY_CYCLE:
type: command
address: 0x94
size_bits_in: 16
SET_CAD:
type: command
address: 0xC5
SET_TX_CONTINUOUS_WAVE:
type: command
address: 0xD1
SET_TX_CONTINUOUS_PREAMBLE:
type: command
address: 0xD2
SET_PACKET_TYPE:
type: command
description: >
The command SetPacketType() sets the transceiver radio frame out of a choice of 5 different packet types.
Despite some packet types using the same physical modem, they do not all share the same parameters.
address: 0x8A
size_bits_in: 8
fields_in:
value:
base: uint
start: 0
end: 8
try_conversion:
name: packet_type
gfsk: 0x00
lo_ra: 0x01
ranging: 0x02
flrc: 0x03
BLE: 0x04
GET_PACKET_TYPE:
type: command
address: 0x03
size_bits_out: 8
SET_RF_FREQUENCY:
type: command
address: 0x86
size_bits_in: 24
fields_in:
value:
base: uint
start: 0
end: 24
SET_TX_PARAMS:
type: command
address: 0x8E
size_bits_in: 16
fields_in:
power:
base: uint
start: 8
end: 13
ramp_time:
base: uint
start: 0
end: 8
conversion:
name: ramp_time
radio_ramp_02_us: 0x00
radio_ramp_04_us: 0x20
radio_ramp_06_us: 0x40
radio_ramp_08_us: 0x60
radio_ramp_10_us: 0x80
radio_ramp_12_us: 0xA0
radio_ramp_16_us: 0xC0
radio_ramp_20_us: 0xE0
other: default
SET_CAD_PARAMS:
type: command
description: The number of symbols on which Channel Activity Detected (CAD) operates.
address: 0x88
size_bits_in: 8
fields_in:
value:
base: uint
start: 0
end: 8
conversion:
name: lora_cad_symbols
lora_cad_01_symbols: 0x00
lora_cad_02_symbols: 0x20
lora_cad_04_symbols: 0x40
lora_cad_08_symbols: 0x60
lora_cad_16_symbols: 0x80
other: default
SET_BUFFER_BASE_ADDRESS:
type: command
address: 0x8F
size_bits_in: 16
fields_in:
tx_base_address:
base: uint
start: 8
end: 16
rx_base_address:
base: uint
start: 0
end: 8
SET_MODULATION_PARAMS:
type: command
address: 0x8B
size_bits_in: 24
fields_in:
mod_params:
base: uint
start: 0
end: 24
SET_PACKET_PARAMS:
type: command
address: 0x8C
size_bits_in: 56
fields_in:
packet_params:
base: uint
start: 0
end: 56
GET_RX_BUFFER_STATUS:
type: command
address: 0x17
size_bits_out: 16
fields_out:
rx_payload_length:
base: uint
start: 8
end: 16
rx_start_buffer_pointer:
base: uint
start: 0
end: 8
GET_PACKET_STATUS:
type: command
address: 0x1D
size_bits_out: 40
fields_out:
value:
base: uint
start: 0
end: 40
GET_RSSI_INST:
type: command
address: 0x1F
SET_DIO_IRQ_PARAMS:
type: command
address: 0x8D
size_bits_in: 64
fields_in:
irq_mask:
base: uint
start: 48
end: 64
dio1_mask:
base: uint
start: 32
end: 48
dio2_mask:
base: uint
start: 16
end: 32
dio3_mask:
base: uint
start: 0
end: 16
GET_IRQ_STATUS:
type: command
address: 0x15
size_bits_out: 16
fields_out:
value:
base: uint
start: 0
end: 16
CLR_IRQ_STATUS:
type: command
address: 0x97
size_bits_in: 16
fields_in:
value:
base: uint
start: 0
end: 16
SET_REGULATOR_MODE:
type: command
address: 0x96
size_bits_in: 8
fields_in:
regulator_type:
base: uint
start: 0
end: 1
conversion:
name: regulator_type
ldo: 0
dc_dc: 1
CALIBRATE:
type: command
address: 0x89
size_bits_in: 8
fields_in:
adc_bulk_p_enable:
base: bool
start: 5
adc_bulk_n_enable:
base: bool
start: 4
adc_pulse_enable:
base: bool
start: 3
pll_enable:
base: bool
start: 2
rc13_m_enable_enable:
base: bool
start: 1
rc64_k_enable:
base: bool
start: 0
SET_SAVE_CONTEXT:
type: command
address: 0xD5
SET_AUTO_FS:
type: command
address: 0x9E
SET_AUTO_TX:
type: command
address: 0x98
SET_LONG_PREAMBLE:
type: command
address: 0x9B
SET_RANGING_ROLE:
type: command
address: 0xA3
SET_ADVANCED_RANGING:
type: command
address: 0x9A
SET_FS:
type: command
address: 0xC1
# 13. Register Map
FIRMWARE_VERSIONS:
type: register
description: Firmware versions 0xB7A9 and 0xB5A9 can be read from register 0x0153
access: RO
address: 0x153
size_bits: 16
fields:
value:
base: uint
start: 0
end: 16
conversion:
name: firmware_version
version1: 0xA9B5
version2: 0xA9B7
other: catch_all
RX_GAIN:
type: register
description: Register determining the LNA gain regime
access: RW
size_bits: 8
address: 0x891
reset_value: 0x25
allow_bit_overlap: true
fields:
mode:
base: uint
start: 6
end: 8
conversion:
name: rx_gain
high_sensitivity: 0b11
low_power: 0b00
other: default
MANUAL_GAIN_SETTING:
type: register
access: RW
size_bits: 8
address: 0x895
reset_value: 0x01
fields:
gain_control:
base: uint
start: 0
end: 1
conversion:
name: gain_control
manual: 0
automatic: 1
LNA_GAIN_VALUE:
type: register
access: RW
size_bits: 8
address: 0x89E
reset_value: 0x0A
fields:
setting:
base: uint
start: 0
end: 4
conversion:
name: gain_value
other: default
max: 13
max_neg2: 12
max_neg4: 11
max_neg6: 10
max_neg8: 9
max_neg12: 8
max_neg18: 7
max_neg24: 6
max_neg30: 5
max_neg36: 4
max_neg42: 3
max_neg48: 2
max_neg54: 1
LNA_GAIN_CONTROL:
type: register
description: Enable/Disable manual LNA gain control
access: RW
size_bits: 8
address: 0x89F
reset_value: 0x4D
fields:
gain_control:
base: uint
start: 7
end: 8
conversion:
name: lna_gain_control
automatic: 0
manual: 1
SYNCH_PEAK_ATTENUATION:
type: register
description: dB Attenuation of the peak power during synch address
access: RW
size_bits: 8
address: 0x8C2
reset_value: 0x04
fields:
attenuation:
base: uint
start: 3
end: 6
conversion:
name: attenuation
minus1: 0b000
minus4: 0b001
minus8: 0b010
minus16: 0b011
minus24: 0b100
minus32: 0b101
minus48: 0b110
minus64: 0b111
PAYLOAD_LENGTH:
type: register
description: The length of the received LoRa payload
access: RW
size_bits: 8
address: 0x901
fields:
length:
base: uint
start: 0
end: 8
LORA_HEADER_MODE:
type: register
description: Indicates the LoRa modem header mode
access: RW
size_bits: 8
address: 0x903
fields:
header:
base: bool
start: 7
# Note: skip ranging for now
# RANGING_REQUEST_ADDRESS:
# type: register
# access: RW
# size_bits: 32
# address: 0x912
# reset_value: 0x00000019
# RANGING_DEVICE_ADDRESS:
# type: register
# access: RW
# size_bits: 32
# address: 0x916
# reset_value: 0x00000019
# RANGING_FILTER_WINDOW_SIZE:
# type: register
# access: RO
# size_bits: 8
# address: 0x91E
# RESET_RANGING_FILTER:
# type: register
# access: WO
# size_bits: 8
# address: 0x923
# RANGING_RESULT_MUX:
# type: register
# access: RW
# size_bits: 8
# address: 0x924
# reset_value: 0x03
SF_ADDITIONAL_CONFIGURATION:
type: register
description: SF range selection in LoRa mode
access: RW
size_bits: 8
address: 0x925
fields:
value:
base: uint
start: 0
end: 8
try_conversion:
name: F_E_C
SF5_6: 0x1E
SF7_8: 0x37
SF9_12: 0x32
# RANGING_CALIBRATION:
# type: register
# access: RW
# size_bits: 24
# address: 0x92B
# reset_value: 0x005FD2
# RANGING_ID_CHECK:
# type: register
# access: RW
# size_bits: 8
# address: 0x931
# reset_value: 0x03
FREQUENCY_ERROR_CORRECTION:
type: register
description: >
Crystal frequency error correction mode.
When updating SfAdditionalConfiguration, write 0x1 to this register.
access: RW
size_bits: 8
address: 0x93C
fields:
value:
base: uint
start: 0
end: 8
CAD_DET_PEAK:
type: register
description: Peak-to-noise ratio decision threshold for the CAD
access: RW
size_bits: 8
address: 0x942
reset_value: 0x32
LORA_SYNC_WORD:
type: register
description: LoRa sync word value
access: RW
size_bits: 16
address: 0x944
reset_value: 0x1424
fields:
msb:
base: uint
start: 12
end: 16
lsb:
base: uint
start: 4
end: 8
# Overlaps?
# HEADER_CRC:
# type: register
# access: RO
# size_bits: 8
# address: 0x954
CODING_RATE:
type: register
description: Coding Rate in LoRa incoming packet
access: RO
size_bits: 8
address: 0x950
fields:
coding_rate:
base: uint
start: 4
end: 7
FEI:
type: register
description: LoRa Frequency error indicator
access: RO
size_bits: 24
address: 0x954
fields:
fei:
base: uint
start: 0
end: 20
# RANGING_RESULT:
# type: register
# access: RO
# size_bits: 8
# address: 0x961
# RANGING_RSSI:
# type: register
# access: RO
# size_bits: 8
# address: 0x964
# FREEZE_RANGING_RESULT:
# type: register
# access: RW
# size_bits: 8
# address: 0x97F
PACKET_PREAMBLE_SETTINGS:
type: register
description: Preamble length in GFSK and Bluetooth Low Energy compatible
access: RW
size_bits: 8
address: 0x9C1
reset_value: 0x00
WHITENING_INITIAL_VALUE:
type: register
description: Data whitening seed for GFSK and Bluetooth Low Energy compatible modulation
access: RW
size_bits: 8
address: 0x9C5
reset_value: 0x01
CRC_POLYNOMIAL:
type: register
description: CRC Polynomial Definition for GFSK
access: RW
size_bits: 16
address: 0x9C6
reset_value: 0xFFFF
CRC_POLYNOMIAL_SEED:
type: register
description: CRC Seed for Bluetooth Low Energy compatible modulation
access: RW
size_bits: 24
address: 0x9C7
reset_value: 0xFFFFFF
CRC_INITIAL:
type: register
description: CRC Seed used for GFSK and FLRC modulation
access: RW
size_bits: 16
address: 0x9C8
reset_value: 0xFFFF
SYNC_ADDRESS_CONTROL:
type: register
description: The number of sync word bit errors tolerated in FLRC and GFSK modes
access: RW
size_bits: 8
address: 0x09CD
reset_value: 0x80
SYNC_ADDRESS1:
type: register
access: RW
size_bits: 40
address: 0x9CE
reset_value: 0x5555555555
SYNC_ADDRESS2:
type: register
access: RW
size_bits: 40
address: 0x9D3
reset_value: 0x5555555555
SYNC_ADDRESS3:
type: register
access: RW
size_bits: 40
address: 0x9D8
reset_value: 0x5555555555