L14-Click
1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
lorawan_conf.h
Go to the documentation of this file.
1
/* USER CODE BEGIN Header */
2
/**
3
******************************************************************************
4
* @file lorawan_conf.h
5
* @author MCD Application Team
6
* @brief Header for LoRaWAN middleware instances
7
******************************************************************************
8
* @attention
9
*
10
* Copyright (c) 2026 STMicroelectronics.
11
* All rights reserved.
12
*
13
* This software is licensed under terms that can be found in the LICENSE file
14
* in the root directory of this software component.
15
* If no LICENSE file comes with this software, it is provided AS-IS.
16
*
17
******************************************************************************
18
*/
19
/* USER CODE END Header */
20
21
/* Define to prevent recursive inclusion -------------------------------------*/
22
#ifndef __LORAWAN_CONF_H__
23
#define __LORAWAN_CONF_H__
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
/* Includes ------------------------------------------------------------------*/
29
/* USER CODE BEGIN Includes */
30
31
/* USER CODE END Includes */
32
33
/* Exported types ------------------------------------------------------------*/
34
/* USER CODE BEGIN ET */
35
36
/* USER CODE END ET */
37
38
/* Exported constants --------------------------------------------------------*/
39
#if defined(__ICCARM__)
40
#define SOFT_SE_PLACE_IN_NVM_START _Pragma(" default_variable_attributes = @ \".USER_embedded_Keys\"")
41
#elif defined(__CC_ARM)
42
#define SOFT_SE_PLACE_IN_NVM_START _Pragma(" arm section rodata = \".USER_embedded_Keys\"")
43
#elif defined(__GNUC__)
44
#define SOFT_SE_PLACE_IN_NVM_START __attribute__((section(".USER_embedded_Keys")))
45
#endif
/* __ICCARM__ | __CC_ARM | __GNUC__ */
46
47
/* Stop placing data in specified section*/
48
#if defined(__ICCARM__)
49
#define SOFT_SE_PLACE_IN_NVM_STOP _Pragma("default_variable_attributes =")
50
#elif defined(__CC_ARM)
51
#define SOFT_SE_PLACE_IN_NVM_STOP _Pragma("arm section code")
52
#endif
/* __ICCARM__ | __CC_ARM | __GNUC__ */
53
54
/*!
55
* @brief LoRaWAN version definition
56
* @note 0x01000400: Link Layer TS001-1.0.4 + Regional Parameters RP002-1.0.1
57
*/
58
#define LORAMAC_SPECIFICATION_VERSION 0x01000400
59
60
/*!
61
* @brief Enable the additional LoRaWAN packages
62
* @note LoRaWAN Packages available when enabled:
63
* - Application Layer Clock Synchronization (Package ID: 1, Default Port: 202)
64
* - Remote Multicast Setup (Package ID: 2, Default Port: 200)
65
* - Fragmented Data Block Transport (Package ID: 3, Default Port: 201)
66
* - Firmware Management Protocol (Package ID: 4, Default Port: 203)
67
* The Certification Protocol is also defined as a mandatory package (Package ID: 0, Default Port: 224)
68
*/
69
#define LORAWAN_DATA_DISTRIB_MGT 0
70
71
/*!
72
* @brief LoRaWAN packages version
73
* @note When LORAWAN_DATA_DISTRIB_MGT is enabled, 2 possibles values:
74
* - 1: v1.0.0 packages including:
75
* - Application Layer Clock Synchronization v1.0.0
76
* - Remote Multicast Setup v1.0.0
77
* - Fragmented Data Block Transport v1.0.0
78
* - 2: v2.0.0 packages including:
79
* - Application Layer Clock Synchronization v2.0.0
80
* - Remote Multicast Setup v2.0.0
81
* - Fragmented Data Block Transport v2.0.0
82
* - Firmware Management Protocol v1.0.0
83
*/
84
#define LORAWAN_PACKAGES_VERSION 1
85
86
/* Region ------------------------------------*/
87
/* the region listed here will be linked in the MW code */
88
/* the application (on sys_conf.h) shall just configure one region at the time */
89
/*#define REGION_AS923*/
90
/*#define REGION_AU915*/
91
/*#define REGION_CN470*/
92
/*#define REGION_CN779*/
93
/*#define REGION_EU433*/
94
#define REGION_EU868
95
/*#define REGION_KR920*/
96
/*#define REGION_IN865*/
97
#define REGION_US915
98
/*#define REGION_RU864*/
99
100
/*!
101
* @brief Default channel plan for region AS923
102
* @note Possible selections:
103
* - CHANNEL_PLAN_GROUP_AS923_1 (Default configuration. Freq offset = 0.0 MHz / Freq range = 915-928MHz)
104
* - CHANNEL_PLAN_GROUP_AS923_2 (Freq offset = -1.80 MHz / Freq range = 915-928MHz)
105
* - CHANNEL_PLAN_GROUP_AS923_3 (Freq offset = -6.60 MHz / Freq range = 915-928MHz)
106
* - CHANNEL_PLAN_GROUP_AS923_4 (Freq offset = -5.90 MHz / Freq range = 917-920MHz)
107
* - CHANNEL_PLAN_GROUP_AS923_1_JP (Freq offset = 0.0 MHz / Freq range = 920.6-923.4MHz)
108
* - CHANNEL_PLAN_GROUP_AS923_1_JP_CH24_CH38_LBT (RP02-1.0.3)
109
* - CHANNEL_PLAN_GROUP_AS923_1_JP_CH24_CH38_DC (RP02-1.0.3)
110
* - CHANNEL_PLAN_GROUP_AS923_1_JP_CH33_CH61_LBT_DC (RP02-1.0.3)
111
*/
112
#define REGION_AS923_DEFAULT_CHANNEL_PLAN CHANNEL_PLAN_GROUP_AS923_1
113
114
/*!
115
* @brief Limits the number usable channels by default for AU915, CN470 and US915 regions
116
* @note the default channel mask with this option activates the first 8 channels. \
117
* this default mask can be modified in the RegionXXXXXInitDefaults function associated with the active region.
118
*/
119
#define HYBRID_ENABLED 0
120
121
/*!
122
* @brief Define the read access of the keys in memory
123
* @note this value should be disabled after the development process
124
*/
125
#define KEY_EXTRACTABLE 1
126
127
/*!
128
* @brief Enables/Disables the context storage management storage
129
* @note Must be enabled for LoRaWAN 1.0.4 or later.
130
*/
131
#define CONTEXT_MANAGEMENT_ENABLED 1
132
133
/* Class B ------------------------------------*/
134
/*!
135
* @brief Enables/Disables the LoRaWAN Class B (Periodic ping downlink slots + Beacon for synchronization)
136
*/
137
#define LORAMAC_CLASSB_ENABLED 0
138
139
#if ( LORAMAC_CLASSB_ENABLED == 1 )
140
/* CLASS B LSE crystal calibration*/
141
/*!
142
* @brief Temperature coefficient of the clock source
143
*/
144
#define RTC_TEMP_COEFFICIENT ( -0.035 )
145
146
/*!
147
* @brief Temperature coefficient deviation of the clock source
148
*/
149
#define RTC_TEMP_DEV_COEFFICIENT ( 0.0035 )
150
151
/*!
152
* @brief Turnover temperature of the clock source
153
*/
154
#define RTC_TEMP_TURNOVER ( 25.0 )
155
156
/*!
157
* @brief Turnover temperature deviation of the clock source
158
*/
159
#define RTC_TEMP_DEV_TURNOVER ( 5.0 )
160
#endif
/* LORAMAC_CLASSB_ENABLED == 1 */
161
162
/*!
163
* @brief Disable the ClassA receive windows after Tx (after the Join Accept if OTAA mode defined)
164
* @note Behavior to reduce power consumption but not compliant with LoRa Alliance recommendations.
165
* All device parameters (Spreading Factor, channels selection, Tx Power, ...) should be fixed
166
* and the adaptive datarate should be disabled.
167
* @warning This limitation may have consequences for the proper functioning of the device,
168
* if the LoRaMac ever generates MAC commands that require a response.
169
*/
170
#define DISABLE_LORAWAN_RX_WINDOW 0
171
172
/* USER CODE BEGIN EC */
173
174
/* USER CODE END EC */
175
176
/* External variables --------------------------------------------------------*/
177
/* USER CODE BEGIN EV */
178
179
/* USER CODE END EV */
180
181
/* Exported macro ------------------------------------------------------------*/
182
#ifndef CRITICAL_SECTION_BEGIN
183
#define CRITICAL_SECTION_BEGIN( ) UTILS_ENTER_CRITICAL_SECTION( )
184
#endif
/* !CRITICAL_SECTION_BEGIN */
185
#ifndef CRITICAL_SECTION_END
186
#define CRITICAL_SECTION_END( ) UTILS_EXIT_CRITICAL_SECTION( )
187
#endif
/* !CRITICAL_SECTION_END */
188
189
/* USER CODE BEGIN EM */
190
191
/* USER CODE END EM */
192
193
/* Exported functions prototypes ---------------------------------------------*/
194
/* USER CODE BEGIN EFP */
195
196
/* USER CODE END EFP */
197
198
#ifdef __cplusplus
199
}
200
#endif
201
202
#endif
/* __LORAWAN_CONF_H__ */
LoRaWAN
Target
lorawan_conf.h
Generated by
1.16.1