-
Notifications
You must be signed in to change notification settings - Fork 0
/
fh101rf_reg.h
11215 lines (9878 loc) · 448 KB
/
fh101rf_reg.h
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
// clang-format off
/**
* @file fh101rf_reg.h
* @brief FH101RF
* @note do not edit directly: generated using reginald from ../fh101rf.yaml.
*
* Generator: c.funcpack
*
* Listing file author: Jonah Imfeld, Silvano Cortesi
*
* Listing file notice:
* Licensed under LGPL-3.0
* File Version: 1.0.1
*/
#ifndef REGINALD_FH101RF_REG_H
#define REGINALD_FH101RF_REG_H
#include <stdint.h>
#include <stdbool.h>
// =============================================================================
// ==== Shared Enums ===========================================================
// =============================================================================
// ---- BIN_CODE Enum ----------------------------------------------------------
enum fh101rf_bin_code {
/** @brief mls A */
FH101RF_BIN_CODE_A = 0x0U,
/** @brief mls A inv */
FH101RF_BIN_CODE_A_INV = 0x4U,
/** @brief m-sequence A */
FH101RF_BIN_CODE_A_SEQ = 0x6U,
/** @brief mls B */
FH101RF_BIN_CODE_B = 0x1U,
/** @brief mls B inv */
FH101RF_BIN_CODE_B_INV = 0x5U,
/** @brief m-sequence B */
FH101RF_BIN_CODE_B_SEQ = 0x7U,
/** @brief mls C */
FH101RF_BIN_CODE_C = 0x2U,
/** @brief mls D */
FH101RF_BIN_CODE_D = 0x3U,
/** @brief 16 ones */
FH101RF_BIN_CODE_ONE_16 = 0xAU,
/** @brief 24 ones */
FH101RF_BIN_CODE_ONE_24 = 0xBU,
/** @brief 31 ones */
FH101RF_BIN_CODE_ONE_31 = 0xCU,
/** @brief 8 ones */
FH101RF_BIN_CODE_ONE_8 = 0x9U,
/** @brief 111000 pattern */
FH101RF_BIN_CODE_OOOZZZ = 0xFU,
/** @brief 1100 pattern */
FH101RF_BIN_CODE_OOZZ = 0xEU,
/** @brief 31 zeros */
FH101RF_BIN_CODE_ZERO_31 = 0x8U,
/** @brief 0101 pattern */
FH101RF_BIN_CODE_ZOZO = 0xDU,
};
/**
* @brief Check if a numeric value is a valid @ref enum fh101rf_bin_code.
* @returns bool (true/false)
*/
#define FH101RF_IS_VALID_BIN_CODE(_VAL_) ( \
((_VAL_) <= 0xFU) ? true : \
false )
// ---- EXIT_COND Enum ---------------------------------------------------------
enum fh101rf_exit_cond {
/** @brief FO_QUIT was set - user forced slow mode. */
FH101RF_EXIT_COND_FORCE_QUIT = 0x3U,
/** @brief ID match failed - 16-bit ID did not match. */
FH101RF_EXIT_COND_ID_FAIL = 0x2U,
/** @brief RX resetted or FDD is disabled - Initial state. */
FH101RF_EXIT_COND_NO_REASON = 0x0U,
/** @brief Timeout - No fast code A or B received. */
FH101RF_EXIT_COND_TIMEOUT = 0x1U,
};
/**
* @brief Check if a numeric value is a valid @ref enum fh101rf_exit_cond.
* @returns bool (true/false)
*/
#define FH101RF_IS_VALID_EXIT_COND(_VAL_) ( \
((_VAL_) <= 0x3U) ? true : \
false )
// ---- FDD_MODE Enum ----------------------------------------------------------
enum fh101rf_fdd_mode {
/** @brief Fast mode. */
FH101RF_FDD_MODE_FAST = 0x1U,
/** @brief Slow mode. */
FH101RF_FDD_MODE_SLOW = 0x0U,
};
/**
* @brief Check if a numeric value is a valid @ref enum fh101rf_fdd_mode.
* @returns bool (true/false)
*/
#define FH101RF_IS_VALID_FDD_MODE(_VAL_) ( \
((_VAL_) <= 0x1U) ? true : \
false )
// ---- FIFO_LEN Enum ----------------------------------------------------------
enum fh101rf_fifo_len {
/** @brief 16-bit FIFO. */
FH101RF_FIFO_LEN_BIT16 = 0x0U,
/** @brief 24-bit FIFO. */
FH101RF_FIFO_LEN_BIT24 = 0x1U,
/** @brief 32-bit FIFO. */
FH101RF_FIFO_LEN_BIT32 = 0x2U,
/** @brief 40-bit FIFO. */
FH101RF_FIFO_LEN_BIT40 = 0x3U,
};
/**
* @brief Check if a numeric value is a valid @ref enum fh101rf_fifo_len.
* @returns bool (true/false)
*/
#define FH101RF_IS_VALID_FIFO_LEN(_VAL_) ( \
((_VAL_) <= 0x3U) ? true : \
false )
// ---- SAMPLE_RATE Enum -------------------------------------------------------
enum fh101rf_sample_rate {
/** @brief 256 Hz. 125ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_0_256 = 0x7U,
/** @brief 512 Hz. 62.5ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_0_512 = 0x6U,
/** @brief 16384 Hz. 1.957ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_16_384 = 0x1U,
/** @brief 1024 Hz. 31.25ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_1_024 = 0x5U,
/** @brief 2048 Hz. 15.625ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_2_048 = 0x4U,
/** @brief 32768 Hz. 0.977ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_32_768 = 0x0U,
/** @brief 4096 Hz. 7.813ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_4_096 = 0x3U,
/** @brief 32768 Hz. 0.977ms code-sequence-duration. */
FH101RF_SAMPLE_RATE_SR_8_192 = 0x2U,
};
/**
* @brief Check if a numeric value is a valid @ref enum fh101rf_sample_rate.
* @returns bool (true/false)
*/
#define FH101RF_IS_VALID_SAMPLE_RATE(_VAL_) ( \
((_VAL_) <= 0x7U) ? true : \
false )
// =============================================================================
// ==== Shared Layout Structs ==================================================
// =============================================================================
// ---- BANDS Layout -----------------------------------------------------------
// Fields:
// - [0] BAND_433 (bool): True means on for 433MHz band.
// - [1] BAND_868 (bool): True means on for 868/915MHz band.
// - [2] BAND_2G4 (bool): True means on for 2.4GHz band.
// Layout Struct:
/** @note use pack/unpack functions for conversion to/from packed binary value */
struct fh101rf_bands {
/** @brief True means on for 2.4GHz band. */
bool band_2g4;
/** @brief True means on for 433MHz band. */
bool band_433;
/** @brief True means on for 868/915MHz band. */
bool band_868;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_bands struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_bands_pack_le(const struct fh101rf_bands *r, uint8_t val[1]) {
// BAND_2G4 @ bands[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->band_2g4 << 2)) & 0x4U);
// BAND_433 @ bands[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->band_433) & 0x1U);
// BAND_868 @ bands[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->band_868 << 1)) & 0x2U);
}
/**
* @brief Convert @ref struct fh101rf_bands struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_bands_pack_be(const struct fh101rf_bands *r, uint8_t val[1]) {
// BAND_2G4 @ bands[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->band_2g4 << 2)) & 0x4U);
// BAND_433 @ bands[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->band_433) & 0x1U);
// BAND_868 @ bands[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->band_868 << 1)) & 0x2U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_bands fh101rf_bands_unpack_le(const uint8_t val[1]) {
struct fh101rf_bands r = {0};
// BAND_2G4 @ bands[2]:
r.band_2g4 = (bool)(((val[0] & 0x4U) >> 2));
// BAND_433 @ bands[0]:
r.band_433 = (bool)((val[0] & 0x1U));
// BAND_868 @ bands[1]:
r.band_868 = (bool)(((val[0] & 0x2U) >> 1));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_bands fh101rf_bands_unpack_be(const uint8_t val[1]) {
struct fh101rf_bands r = {0};
// BAND_2G4 @ bands[2]:
r.band_2g4 = (bool)(((val[0] & 0x4U) >> 2));
// BAND_433 @ bands[0]:
r.band_433 = (bool)((val[0] & 0x1U));
// BAND_868 @ bands[1]:
r.band_868 = (bool)(((val[0] & 0x2U) >> 1));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_bands(const struct fh101rf_bands *r) {
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_bands_try_unpack_le(const uint8_t val[1], struct fh101rf_bands *r) {
*r = fh101rf_bands_unpack_le(val);
return fh101rf_validate_bands(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_bands_try_unpack_be(const uint8_t val[1], struct fh101rf_bands *r) {
*r = fh101rf_bands_unpack_be(val);
return fh101rf_validate_bands(r);
}
// ---- BRANCHES Layout --------------------------------------------------------
// Fields:
// - [0] WEAK (bool): True means weak branch on.
// - [1] MEDIUM (bool): True means medium branch on (+8dB of weak).
// - [2] STRONG (bool): True means strong branch on (+16dB of weak).
// Layout Struct:
/** @note use pack/unpack functions for conversion to/from packed binary value */
struct fh101rf_branches {
/** @brief True means medium branch on (+8dB of weak). */
bool medium;
/** @brief True means strong branch on (+16dB of weak). */
bool strong;
/** @brief True means weak branch on. */
bool weak;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_branches struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_branches_pack_le(const struct fh101rf_branches *r, uint8_t val[1]) {
// MEDIUM @ branches[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->medium << 1)) & 0x2U);
// STRONG @ branches[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->strong << 2)) & 0x4U);
// WEAK @ branches[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->weak) & 0x1U);
}
/**
* @brief Convert @ref struct fh101rf_branches struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_branches_pack_be(const struct fh101rf_branches *r, uint8_t val[1]) {
// MEDIUM @ branches[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->medium << 1)) & 0x2U);
// STRONG @ branches[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->strong << 2)) & 0x4U);
// WEAK @ branches[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->weak) & 0x1U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_branches fh101rf_branches_unpack_le(const uint8_t val[1]) {
struct fh101rf_branches r = {0};
// MEDIUM @ branches[1]:
r.medium = (bool)(((val[0] & 0x2U) >> 1));
// STRONG @ branches[2]:
r.strong = (bool)(((val[0] & 0x4U) >> 2));
// WEAK @ branches[0]:
r.weak = (bool)((val[0] & 0x1U));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_branches fh101rf_branches_unpack_be(const uint8_t val[1]) {
struct fh101rf_branches r = {0};
// MEDIUM @ branches[1]:
r.medium = (bool)(((val[0] & 0x2U) >> 1));
// STRONG @ branches[2]:
r.strong = (bool)(((val[0] & 0x4U) >> 2));
// WEAK @ branches[0]:
r.weak = (bool)((val[0] & 0x1U));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_branches(const struct fh101rf_branches *r) {
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_branches_try_unpack_le(const uint8_t val[1], struct fh101rf_branches *r) {
*r = fh101rf_branches_unpack_le(val);
return fh101rf_validate_branches(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_branches_try_unpack_be(const uint8_t val[1], struct fh101rf_branches *r) {
*r = fh101rf_branches_unpack_be(val);
return fh101rf_validate_branches(r);
}
// ---- IRQ_SOURCE Layout ------------------------------------------------------
// Fields:
// - [0] ID_MATCH (bool): The 16-bit ID in FDD mode matches (register ID_HI, ID_LO).
// - [1] FIFO_OVERFLOW (bool): FIFO overflow.
// - [2] FIFO_FULL (bool): FIFO buffer full.
// - [3] CORREL_MATCH (bool): OOK data matches the correlation sequence.
// - [4] ID_MATCH_AND_FIFO_FULL (bool): 16-bit ID in FDD mode matches and FIFO buffer full.
// - [5] ID_MATCH_AND_LDR (bool): 16-bit ID in FDD mode matches and LDR was entered.
// - [6] RTC_TIMER_ALARM (bool): RTC timer alarm.
// - [7] CYCLIC_TIMER_ALARM (bool): Cyclic timer alarm.
// Layout Struct:
/** @note use pack/unpack functions for conversion to/from packed binary value */
struct fh101rf_irq_source {
/** @brief OOK data matches the correlation sequence. */
bool correl_match;
/** @brief Cyclic timer alarm. */
bool cyclic_timer_alarm;
/** @brief FIFO buffer full. */
bool fifo_full;
/** @brief FIFO overflow. */
bool fifo_overflow;
/** @brief The 16-bit ID in FDD mode matches (register ID_HI, ID_LO). */
bool id_match;
/** @brief 16-bit ID in FDD mode matches and FIFO buffer full. */
bool id_match_and_fifo_full;
/** @brief 16-bit ID in FDD mode matches and LDR was entered. */
bool id_match_and_ldr;
/** @brief RTC timer alarm. */
bool rtc_timer_alarm;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_irq_source struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_irq_source_pack_le(const struct fh101rf_irq_source *r, uint8_t val[1]) {
// CORREL_MATCH @ irq_source[3]:
val[0] &= (uint8_t)~0x8U;
val[0] |= (uint8_t)(((uint8_t)(r->correl_match << 3)) & 0x8U);
// CYCLIC_TIMER_ALARM @ irq_source[7]:
val[0] &= (uint8_t)~0x80U;
val[0] |= (uint8_t)(((uint8_t)(r->cyclic_timer_alarm << 7)) & 0x80U);
// FIFO_FULL @ irq_source[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->fifo_full << 2)) & 0x4U);
// FIFO_OVERFLOW @ irq_source[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->fifo_overflow << 1)) & 0x2U);
// ID_MATCH @ irq_source[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->id_match) & 0x1U);
// ID_MATCH_AND_FIFO_FULL @ irq_source[4]:
val[0] &= (uint8_t)~0x10U;
val[0] |= (uint8_t)(((uint8_t)(r->id_match_and_fifo_full << 4)) & 0x10U);
// ID_MATCH_AND_LDR @ irq_source[5]:
val[0] &= (uint8_t)~0x20U;
val[0] |= (uint8_t)(((uint8_t)(r->id_match_and_ldr << 5)) & 0x20U);
// RTC_TIMER_ALARM @ irq_source[6]:
val[0] &= (uint8_t)~0x40U;
val[0] |= (uint8_t)(((uint8_t)(r->rtc_timer_alarm << 6)) & 0x40U);
}
/**
* @brief Convert @ref struct fh101rf_irq_source struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_irq_source_pack_be(const struct fh101rf_irq_source *r, uint8_t val[1]) {
// CORREL_MATCH @ irq_source[3]:
val[0] &= (uint8_t)~0x8U;
val[0] |= (uint8_t)(((uint8_t)(r->correl_match << 3)) & 0x8U);
// CYCLIC_TIMER_ALARM @ irq_source[7]:
val[0] &= (uint8_t)~0x80U;
val[0] |= (uint8_t)(((uint8_t)(r->cyclic_timer_alarm << 7)) & 0x80U);
// FIFO_FULL @ irq_source[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->fifo_full << 2)) & 0x4U);
// FIFO_OVERFLOW @ irq_source[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->fifo_overflow << 1)) & 0x2U);
// ID_MATCH @ irq_source[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->id_match) & 0x1U);
// ID_MATCH_AND_FIFO_FULL @ irq_source[4]:
val[0] &= (uint8_t)~0x10U;
val[0] |= (uint8_t)(((uint8_t)(r->id_match_and_fifo_full << 4)) & 0x10U);
// ID_MATCH_AND_LDR @ irq_source[5]:
val[0] &= (uint8_t)~0x20U;
val[0] |= (uint8_t)(((uint8_t)(r->id_match_and_ldr << 5)) & 0x20U);
// RTC_TIMER_ALARM @ irq_source[6]:
val[0] &= (uint8_t)~0x40U;
val[0] |= (uint8_t)(((uint8_t)(r->rtc_timer_alarm << 6)) & 0x40U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_irq_source fh101rf_irq_source_unpack_le(const uint8_t val[1]) {
struct fh101rf_irq_source r = {0};
// CORREL_MATCH @ irq_source[3]:
r.correl_match = (bool)(((val[0] & 0x8U) >> 3));
// CYCLIC_TIMER_ALARM @ irq_source[7]:
r.cyclic_timer_alarm = (bool)(((val[0] & 0x80U) >> 7));
// FIFO_FULL @ irq_source[2]:
r.fifo_full = (bool)(((val[0] & 0x4U) >> 2));
// FIFO_OVERFLOW @ irq_source[1]:
r.fifo_overflow = (bool)(((val[0] & 0x2U) >> 1));
// ID_MATCH @ irq_source[0]:
r.id_match = (bool)((val[0] & 0x1U));
// ID_MATCH_AND_FIFO_FULL @ irq_source[4]:
r.id_match_and_fifo_full = (bool)(((val[0] & 0x10U) >> 4));
// ID_MATCH_AND_LDR @ irq_source[5]:
r.id_match_and_ldr = (bool)(((val[0] & 0x20U) >> 5));
// RTC_TIMER_ALARM @ irq_source[6]:
r.rtc_timer_alarm = (bool)(((val[0] & 0x40U) >> 6));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_irq_source fh101rf_irq_source_unpack_be(const uint8_t val[1]) {
struct fh101rf_irq_source r = {0};
// CORREL_MATCH @ irq_source[3]:
r.correl_match = (bool)(((val[0] & 0x8U) >> 3));
// CYCLIC_TIMER_ALARM @ irq_source[7]:
r.cyclic_timer_alarm = (bool)(((val[0] & 0x80U) >> 7));
// FIFO_FULL @ irq_source[2]:
r.fifo_full = (bool)(((val[0] & 0x4U) >> 2));
// FIFO_OVERFLOW @ irq_source[1]:
r.fifo_overflow = (bool)(((val[0] & 0x2U) >> 1));
// ID_MATCH @ irq_source[0]:
r.id_match = (bool)((val[0] & 0x1U));
// ID_MATCH_AND_FIFO_FULL @ irq_source[4]:
r.id_match_and_fifo_full = (bool)(((val[0] & 0x10U) >> 4));
// ID_MATCH_AND_LDR @ irq_source[5]:
r.id_match_and_ldr = (bool)(((val[0] & 0x20U) >> 5));
// RTC_TIMER_ALARM @ irq_source[6]:
r.rtc_timer_alarm = (bool)(((val[0] & 0x40U) >> 6));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_irq_source(const struct fh101rf_irq_source *r) {
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_irq_source_try_unpack_le(const uint8_t val[1], struct fh101rf_irq_source *r) {
*r = fh101rf_irq_source_unpack_le(val);
return fh101rf_validate_irq_source(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_irq_source_try_unpack_be(const uint8_t val[1], struct fh101rf_irq_source *r) {
*r = fh101rf_irq_source_unpack_be(val);
return fh101rf_validate_irq_source(r);
}
// ---- RTC Layout -------------------------------------------------------------
// Fields:
// - [0] RTCSH0 (bool): Selects the short RTC counter
// - [1] RTCSH1 (bool): Selects the short RTC counter
// - [2] RTCLG0 (bool): Selects the long RTC counter
// - [3] RTCLG1 (bool): Selects the long RTC counter
// Layout Struct:
/** @note use pack/unpack functions for conversion to/from packed binary value */
struct fh101rf_rtc {
/** @brief Selects the long RTC counter */
bool rtclg0;
/** @brief Selects the long RTC counter */
bool rtclg1;
/** @brief Selects the short RTC counter */
bool rtcsh0;
/** @brief Selects the short RTC counter */
bool rtcsh1;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_rtc struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_rtc_pack_le(const struct fh101rf_rtc *r, uint8_t val[1]) {
// RTCLG0 @ rtc[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->rtclg0 << 2)) & 0x4U);
// RTCLG1 @ rtc[3]:
val[0] &= (uint8_t)~0x8U;
val[0] |= (uint8_t)(((uint8_t)(r->rtclg1 << 3)) & 0x8U);
// RTCSH0 @ rtc[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->rtcsh0) & 0x1U);
// RTCSH1 @ rtc[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->rtcsh1 << 1)) & 0x2U);
}
/**
* @brief Convert @ref struct fh101rf_rtc struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_rtc_pack_be(const struct fh101rf_rtc *r, uint8_t val[1]) {
// RTCLG0 @ rtc[2]:
val[0] &= (uint8_t)~0x4U;
val[0] |= (uint8_t)(((uint8_t)(r->rtclg0 << 2)) & 0x4U);
// RTCLG1 @ rtc[3]:
val[0] &= (uint8_t)~0x8U;
val[0] |= (uint8_t)(((uint8_t)(r->rtclg1 << 3)) & 0x8U);
// RTCSH0 @ rtc[0]:
val[0] &= (uint8_t)~0x1U;
val[0] |= (uint8_t)(((uint8_t)r->rtcsh0) & 0x1U);
// RTCSH1 @ rtc[1]:
val[0] &= (uint8_t)~0x2U;
val[0] |= (uint8_t)(((uint8_t)(r->rtcsh1 << 1)) & 0x2U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_rtc fh101rf_rtc_unpack_le(const uint8_t val[1]) {
struct fh101rf_rtc r = {0};
// RTCLG0 @ rtc[2]:
r.rtclg0 = (bool)(((val[0] & 0x4U) >> 2));
// RTCLG1 @ rtc[3]:
r.rtclg1 = (bool)(((val[0] & 0x8U) >> 3));
// RTCSH0 @ rtc[0]:
r.rtcsh0 = (bool)((val[0] & 0x1U));
// RTCSH1 @ rtc[1]:
r.rtcsh1 = (bool)(((val[0] & 0x2U) >> 1));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_rtc fh101rf_rtc_unpack_be(const uint8_t val[1]) {
struct fh101rf_rtc r = {0};
// RTCLG0 @ rtc[2]:
r.rtclg0 = (bool)(((val[0] & 0x4U) >> 2));
// RTCLG1 @ rtc[3]:
r.rtclg1 = (bool)(((val[0] & 0x8U) >> 3));
// RTCSH0 @ rtc[0]:
r.rtcsh0 = (bool)((val[0] & 0x1U));
// RTCSH1 @ rtc[1]:
r.rtcsh1 = (bool)(((val[0] & 0x2U) >> 1));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_rtc(const struct fh101rf_rtc *r) {
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_rtc_try_unpack_le(const uint8_t val[1], struct fh101rf_rtc *r) {
*r = fh101rf_rtc_unpack_le(val);
return fh101rf_validate_rtc(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_rtc_try_unpack_be(const uint8_t val[1], struct fh101rf_rtc *r) {
*r = fh101rf_rtc_unpack_be(val);
return fh101rf_validate_rtc(r);
}
// =============================================================================
// ==== ACTUAL_BANDSELECT Register =============================================
// =============================================================================
// This 3 bit register contains the actual selected frequency bands that are currently used.
// Fields:
// - [2:0] SELECTED_BANDS (layout BANDS)
// - [0] SELECTED_BANDS.BAND_433 (bool): True means on for 433MHz band.
// - [1] SELECTED_BANDS.BAND_868 (bool): True means on for 868/915MHz band.
// - [2] SELECTED_BANDS.BAND_2G4 (bool): True means on for 2.4GHz band.
#define FH101RF_ACTUAL_BANDSELECT_ADDRESS (0x6FU) //!< ACTUAL_BANDSELECT register address
#define FH101RF_ACTUAL_BANDSELECT_RESET_LE {0x7U} //!< ACTUAL_BANDSELECT register reset value
#define FH101RF_ACTUAL_BANDSELECT_RESET_BE {0x7U} //!< ACTUAL_BANDSELECT register reset value
// Register Layout Struct:
/**
* @brief This 3 bit register contains the actual selected frequency bands that are currently used.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
struct fh101rf_actual_bandselect {
struct fh101rf_bands selected_bands;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_actual_bandselect struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_bandselect_pack_le(const struct fh101rf_actual_bandselect *r, uint8_t val[1]) {
// SELECTED_BANDS @ actual_bandselect[2:0]:
uint8_t selected_bands[1] = {0};
fh101rf_bands_pack_le(&r->selected_bands, selected_bands);
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)((uint8_t)selected_bands[0] & 0x7U);
}
/**
* @brief Convert @ref struct fh101rf_actual_bandselect struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_bandselect_pack_be(const struct fh101rf_actual_bandselect *r, uint8_t val[1]) {
// SELECTED_BANDS @ actual_bandselect[2:0]:
uint8_t selected_bands[1] = {0};
fh101rf_bands_pack_be(&r->selected_bands, selected_bands);
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)((uint8_t)selected_bands[0] & 0x7U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_bandselect fh101rf_actual_bandselect_unpack_le(const uint8_t val[1]) {
struct fh101rf_actual_bandselect r = {0};
// SELECTED_BANDS @ actual_bandselect[2:0]:
uint8_t selected_bands[1] = {0};
selected_bands[0] |= (uint8_t)((val[0] & 0x7U));
r.selected_bands = fh101rf_bands_unpack_le(selected_bands);
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_bandselect fh101rf_actual_bandselect_unpack_be(const uint8_t val[1]) {
struct fh101rf_actual_bandselect r = {0};
// SELECTED_BANDS @ actual_bandselect[2:0]:
uint8_t selected_bands[1] = {0};
selected_bands[0] |= (uint8_t)((val[0] & 0x7U));
r.selected_bands = fh101rf_bands_unpack_be(selected_bands);
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_actual_bandselect(const struct fh101rf_actual_bandselect *r) {
if (fh101rf_validate_bands(&r->selected_bands)) return 1;
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_bandselect_try_unpack_le(const uint8_t val[1], struct fh101rf_actual_bandselect *r) {
*r = fh101rf_actual_bandselect_unpack_le(val);
return fh101rf_validate_actual_bandselect(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_bandselect_try_unpack_be(const uint8_t val[1], struct fh101rf_actual_bandselect *r) {
*r = fh101rf_actual_bandselect_unpack_be(val);
return fh101rf_validate_actual_bandselect(r);
}
// =============================================================================
// ==== ACTUAL_NFA_2G4 Register ================================================
// =============================================================================
// This register contains the actual NFA (sampling rate) value that is currently valid for 2.4GHz data reception.
// Fields:
// - [2:0] SLOW (enum SAMPLE_RATE)
// - [6:4] FAST (enum SAMPLE_RATE)
#define FH101RF_ACTUAL_NFA_2G4_ADDRESS (0x6EU) //!< ACTUAL_NFA_2G4 register address
#define FH101RF_ACTUAL_NFA_2G4_RESET_LE {0x25U} //!< ACTUAL_NFA_2G4 register reset value
#define FH101RF_ACTUAL_NFA_2G4_RESET_BE {0x25U} //!< ACTUAL_NFA_2G4 register reset value
// Register Layout Struct:
/**
* @brief This register contains the actual NFA (sampling rate) value that is currently valid for 2.4GHz data reception.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
struct fh101rf_actual_nfa_2g4 {
enum fh101rf_sample_rate fast;
enum fh101rf_sample_rate slow;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_actual_nfa_2g4 struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_nfa_2g4_pack_le(const struct fh101rf_actual_nfa_2g4 *r, uint8_t val[1]) {
// FAST @ actual_nfa_2g4[6:4]:
val[0] &= (uint8_t)~0x70U;
val[0] |= (uint8_t)(((uint8_t)(r->fast << 4)) & 0x70U);
// SLOW @ actual_nfa_2g4[2:0]:
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)(((uint8_t)r->slow) & 0x7U);
}
/**
* @brief Convert @ref struct fh101rf_actual_nfa_2g4 struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_nfa_2g4_pack_be(const struct fh101rf_actual_nfa_2g4 *r, uint8_t val[1]) {
// FAST @ actual_nfa_2g4[6:4]:
val[0] &= (uint8_t)~0x70U;
val[0] |= (uint8_t)(((uint8_t)(r->fast << 4)) & 0x70U);
// SLOW @ actual_nfa_2g4[2:0]:
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)(((uint8_t)r->slow) & 0x7U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_nfa_2g4 fh101rf_actual_nfa_2g4_unpack_le(const uint8_t val[1]) {
struct fh101rf_actual_nfa_2g4 r = {0};
// FAST @ actual_nfa_2g4[6:4]:
r.fast = (enum fh101rf_sample_rate)(((val[0] & 0x70U) >> 4));
// SLOW @ actual_nfa_2g4[2:0]:
r.slow = (enum fh101rf_sample_rate)((val[0] & 0x7U));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_nfa_2g4 fh101rf_actual_nfa_2g4_unpack_be(const uint8_t val[1]) {
struct fh101rf_actual_nfa_2g4 r = {0};
// FAST @ actual_nfa_2g4[6:4]:
r.fast = (enum fh101rf_sample_rate)(((val[0] & 0x70U) >> 4));
// SLOW @ actual_nfa_2g4[2:0]:
r.slow = (enum fh101rf_sample_rate)((val[0] & 0x7U));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_actual_nfa_2g4(const struct fh101rf_actual_nfa_2g4 *r) {
if (!(FH101RF_IS_VALID_SAMPLE_RATE(r->fast))) return 5;
if (!(FH101RF_IS_VALID_SAMPLE_RATE(r->slow))) return 1;
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_nfa_2g4_try_unpack_le(const uint8_t val[1], struct fh101rf_actual_nfa_2g4 *r) {
*r = fh101rf_actual_nfa_2g4_unpack_le(val);
return fh101rf_validate_actual_nfa_2g4(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_nfa_2g4_try_unpack_be(const uint8_t val[1], struct fh101rf_actual_nfa_2g4 *r) {
*r = fh101rf_actual_nfa_2g4_unpack_be(val);
return fh101rf_validate_actual_nfa_2g4(r);
}
// =============================================================================
// ==== ACTUAL_NFA_433 Register ================================================
// =============================================================================
// This register contains the actual NFA (sampling rate) value that is currently valid for 433MHz data reception.
// Fields:
// - [2:0] SLOW (enum SAMPLE_RATE)
// - [6:4] FAST (enum SAMPLE_RATE)
#define FH101RF_ACTUAL_NFA_433_ADDRESS (0x6CU) //!< ACTUAL_NFA_433 register address
#define FH101RF_ACTUAL_NFA_433_RESET_LE {0x25U} //!< ACTUAL_NFA_433 register reset value
#define FH101RF_ACTUAL_NFA_433_RESET_BE {0x25U} //!< ACTUAL_NFA_433 register reset value
// Register Layout Struct:
/**
* @brief This register contains the actual NFA (sampling rate) value that is currently valid for 433MHz data reception.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
struct fh101rf_actual_nfa_433 {
enum fh101rf_sample_rate fast;
enum fh101rf_sample_rate slow;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_actual_nfa_433 struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_nfa_433_pack_le(const struct fh101rf_actual_nfa_433 *r, uint8_t val[1]) {
// FAST @ actual_nfa_433[6:4]:
val[0] &= (uint8_t)~0x70U;
val[0] |= (uint8_t)(((uint8_t)(r->fast << 4)) & 0x70U);
// SLOW @ actual_nfa_433[2:0]:
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)(((uint8_t)r->slow) & 0x7U);
}
/**
* @brief Convert @ref struct fh101rf_actual_nfa_433 struct to packed big-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_nfa_433_pack_be(const struct fh101rf_actual_nfa_433 *r, uint8_t val[1]) {
// FAST @ actual_nfa_433[6:4]:
val[0] &= (uint8_t)~0x70U;
val[0] |= (uint8_t)(((uint8_t)(r->fast << 4)) & 0x70U);
// SLOW @ actual_nfa_433[2:0]:
val[0] &= (uint8_t)~0x7U;
val[0] |= (uint8_t)(((uint8_t)r->slow) & 0x7U);
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_nfa_433 fh101rf_actual_nfa_433_unpack_le(const uint8_t val[1]) {
struct fh101rf_actual_nfa_433 r = {0};
// FAST @ actual_nfa_433[6:4]:
r.fast = (enum fh101rf_sample_rate)(((val[0] & 0x70U) >> 4));
// SLOW @ actual_nfa_433[2:0]:
r.slow = (enum fh101rf_sample_rate)((val[0] & 0x7U));
return r;
}
/** @brief Convert packed {endian} binary value to struct. */
static inline struct fh101rf_actual_nfa_433 fh101rf_actual_nfa_433_unpack_be(const uint8_t val[1]) {
struct fh101rf_actual_nfa_433 r = {0};
// FAST @ actual_nfa_433[6:4]:
r.fast = (enum fh101rf_sample_rate)(((val[0] & 0x70U) >> 4));
// SLOW @ actual_nfa_433[2:0]:
r.slow = (enum fh101rf_sample_rate)((val[0] & 0x7U));
return r;
}
/**
* @brief Validate struct
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
* Confirms that all enums are valid, and all values fit into respective fields
*/
static inline int fh101rf_validate_actual_nfa_433(const struct fh101rf_actual_nfa_433 *r) {
if (!(FH101RF_IS_VALID_SAMPLE_RATE(r->fast))) return 5;
if (!(FH101RF_IS_VALID_SAMPLE_RATE(r->slow))) return 1;
return 0;
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_nfa_433_try_unpack_le(const uint8_t val[1], struct fh101rf_actual_nfa_433 *r) {
*r = fh101rf_actual_nfa_433_unpack_le(val);
return fh101rf_validate_actual_nfa_433(r);
}
/**
* @brief Attempt to convert packed {endian} binary value to struct.
* @returns 0 if valid.
* @returns the position of the first invalid field if invalid.
*/
static inline int fh101rf_actual_nfa_433_try_unpack_be(const uint8_t val[1], struct fh101rf_actual_nfa_433 *r) {
*r = fh101rf_actual_nfa_433_unpack_be(val);
return fh101rf_validate_actual_nfa_433(r);
}
// =============================================================================
// ==== ACTUAL_NFA_868 Register ================================================
// =============================================================================
// This register contains the actual NFA (sampling rate) value that is currently valid for 868MHz data reception.
// Fields:
// - [2:0] SLOW (enum SAMPLE_RATE)
// - [6:4] FAST (enum SAMPLE_RATE)
#define FH101RF_ACTUAL_NFA_868_ADDRESS (0x6DU) //!< ACTUAL_NFA_868 register address
#define FH101RF_ACTUAL_NFA_868_RESET_LE {0x15U} //!< ACTUAL_NFA_868 register reset value
#define FH101RF_ACTUAL_NFA_868_RESET_BE {0x15U} //!< ACTUAL_NFA_868 register reset value
// Register Layout Struct:
/**
* @brief This register contains the actual NFA (sampling rate) value that is currently valid for 868MHz data reception.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
struct fh101rf_actual_nfa_868 {
enum fh101rf_sample_rate fast;
enum fh101rf_sample_rate slow;
};
// Layout struct conversion functions:
/**
* @brief Convert @ref struct fh101rf_actual_nfa_868 struct to packed little-endian value.
* @note use pack/unpack functions for conversion to/from packed binary value
*/
static inline void fh101rf_actual_nfa_868_pack_le(const struct fh101rf_actual_nfa_868 *r, uint8_t val[1]) {