LoRaMAC  4.5.2
Documentation of the API
RegionNvm.h
Go to the documentation of this file.
1 
33 #ifndef __REGIONNVM_H__
34 #define __REGIONNVM_H__
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 #include "LoRaMacTypes.h"
42 
46 typedef enum eRegionCN470ChannelPlan
47 {
48  CHANNEL_PLAN_UNKNOWN,
49  CHANNEL_PLAN_20MHZ_TYPE_A,
50  CHANNEL_PLAN_20MHZ_TYPE_B,
51  CHANNEL_PLAN_26MHZ_TYPE_A,
52  CHANNEL_PLAN_26MHZ_TYPE_B
54 
55 // Selection of REGION_NVM_MAX_NB_CHANNELS
56 #if defined( REGION_CN470 )
57  #define REGION_NVM_MAX_NB_CHANNELS 96
58 #elif defined( REGION_US915 ) || defined( REGION_AU915 )
59  #define REGION_NVM_MAX_NB_CHANNELS 72
60 #elif defined( REGION_AS923 ) || defined( REGION_CN779 ) || \
61  defined( REGION_EU433 ) || defined( REGION_EU868 ) || \
62  defined( REGION_IN865 ) || defined( REGION_KR920 )
63  #define REGION_NVM_MAX_NB_CHANNELS 16
64 #else
65  // Region_RU864
66  #define REGION_NVM_MAX_NB_CHANNELS 8
67 #endif
68 
69 // Selection of REGION_NVM_MAX_NB_BANDS
70 #if defined( REGION_EU868 )
71  #define REGION_NVM_MAX_NB_BANDS 6
72 #else
73  // All others
74  #define REGION_NVM_MAX_NB_BANDS 1
75 #endif
76 
77 // Selection of REGION_NVM_CHANNELS_MASK_SIZE
78 #if defined( REGION_CN470 ) || defined( REGION_US915 ) || \
79  defined( REGION_AU915 )
80  #define REGION_NVM_CHANNELS_MASK_SIZE 6
81 #else
82  // All others
83  #define REGION_NVM_CHANNELS_MASK_SIZE 1
84 #endif
85 
89 typedef struct sRegionNvmDataGroup1
90 {
91 #if defined( REGION_US915 ) || defined( REGION_AU915 ) || defined( REGION_CN470 )
92 
95  uint16_t ChannelsMaskRemaining[ REGION_NVM_CHANNELS_MASK_SIZE ];
96 #endif
97 #if defined( REGION_US915 ) || defined( REGION_AU915 )
98 
102  uint8_t JoinChannelGroupsCurrentIndex;
106  uint8_t JoinTrialsCounter;
107 #endif
108 
111  uint32_t Crc32;
113 
118 typedef struct sRegionNvmDataGroup2
119 {
123  ChannelParams_t Channels[ REGION_NVM_MAX_NB_CHANNELS ];
127  uint16_t ChannelsMask[ REGION_NVM_CHANNELS_MASK_SIZE ];
131  uint16_t ChannelsDefaultMask[ REGION_NVM_CHANNELS_MASK_SIZE ];
132 #if defined( REGION_CN470 )
133 
136  RegionCN470ChannelPlan_t ChannelPlan;
141  uint8_t CommonJoinChannelIndex;
146  bool IsOtaaDevice;
147 #endif
148 
151  uint32_t Crc32;
153 
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif // __REGIONNVM_H__
RegionNvmDataGroup1_t
Definition: RegionNvm.h:89
LoRaMacTypes.h
LoRa MAC layer internal types definition. Please do not include in application sources.
ChannelParams_t
Definition: LoRaMacTypes.h:1169
RegionNvmDataGroup2_t
Definition: RegionNvm.h:118
RegionNvmDataGroup1_t::Crc32
uint32_t Crc32
Definition: RegionNvm.h:111
RegionCN470ChannelPlan_t
RegionCN470ChannelPlan_t
Definition: RegionNvm.h:46