| SX126x-Arduino 2.0.1

RegionEU868.h
Go to the documentation of this file.
1
35 #ifndef __REGION_EU868_H__
36 #define __REGION_EU868_H__
37
38 extern "C"
39 {
40
44 #define EU868_MAX_NB_CHANNELS 16
45
49 #define EU868_NUMB_DEFAULT_CHANNELS 3
50
54 #define EU868_NUMB_CHANNELS_CF_LIST 5
55
59 #define EU868_TX_MIN_DATARATE DR_0
60
64 #define EU868_TX_MAX_DATARATE DR_7
65
69 #define EU868_RX_MIN_DATARATE DR_0
70
74 #define EU868_RX_MAX_DATARATE DR_7
75
79 #define EU868_DEFAULT_DATARATE DR_0
80
84 #define EU868_MIN_RX1_DR_OFFSET 0
85
89 #define EU868_MAX_RX1_DR_OFFSET 5
90
94 #define EU868_DEFAULT_RX1_DR_OFFSET 0
95
99 #define EU868_MIN_TX_POWER TX_POWER_7
100
104 #define EU868_MAX_TX_POWER TX_POWER_0
105
109 #define EU868_DEFAULT_TX_POWER TX_POWER_0
110
114 #define EU868_DEFAULT_MAX_EIRP 16.0f
115
119 #define EU868_DEFAULT_ANTENNA_GAIN 2.15f
120
124 #define EU868_ADR_ACK_LIMIT 64
125
129 #define EU868_ADR_ACK_DELAY 32
130
134 #define EU868_DUTY_CYCLE_ENABLED 1
135
139 #define EU868_MAX_RX_WINDOW 3000
140
144 #define EU868_RECEIVE_DELAY1 1000
145
149 #define EU868_RECEIVE_DELAY2 2000
150
154 #define EU868_JOIN_ACCEPT_DELAY1 5000
155
159 #define EU868_JOIN_ACCEPT_DELAY2 6000
160
164 #define EU868_MAX_FCNT_GAP 16384
165
169 #define EU868_ACKTIMEOUT 2000
170
174 #define EU868_ACK_TIMEOUT_RND 1000
175
176 #if (EU868_DEFAULT_DATARATE > DR_5)
177 #error "A default DR higher than DR_5 may lead to connectivity loss."
178 #endif
179
183 #define EU868_RX_WND_2_FREQ 869525000
184
188 #define EU868_RX_WND_2_DR DR_0
189
193 #define EU868_MAX_NB_BANDS 5
194
199 #define EU868_BAND0 \
200 { \
201 100, EU868_MAX_TX_POWER, 0, 0 \
202 } // 1.0 %
203
208 #define EU868_BAND1 \
209 { \
210 100, EU868_MAX_TX_POWER, 0, 0 \
211 } // 1.0 %
212
217 #define EU868_BAND2 \
218 { \
219 1000, EU868_MAX_TX_POWER, 0, 0 \
220 } // 0.1 %
221
226 #define EU868_BAND3 \
227 { \
228 10, EU868_MAX_TX_POWER, 0, 0 \
229 } // 10.0 %
230
235 #define EU868_BAND4 \
236 { \
237 100, EU868_MAX_TX_POWER, 0, 0 \
238 } // 1.0 %
239
244 #define EU868_LC1 \
245 { \
246 868100000, 0, {((DR_5 << 4) | DR_0)}, 1 \
247 }
248
253 #define EU868_LC2 \
254 { \
255 868300000, 0, {((DR_5 << 4) | DR_0)}, 1 \
256 }
257
262 #define EU868_LC3 \
263 { \
264 868500000, 0, {((DR_5 << 4) | DR_0)}, 1 \
265 }
266
270 #define EU868_JOIN_CHANNELS (uint16_t)(LC(1) | LC(2) | LC(3))
271
275 static const uint8_t DataratesEU868[] = {12, 11, 10, 9, 8, 7, 7, 50};
276
280 static const uint32_t BandwidthsEU868[] = {125000, 125000, 125000, 125000, 125000, 125000, 250000, 0};
281
285 static const uint8_t MaxPayloadOfDatarateEU868[] = {51, 51, 51, 115, 242, 242, 242, 242};
286
290 static const uint8_t MaxPayloadOfDatarateRepeaterEU868[] = {51, 51, 51, 115, 222, 222, 222, 222};
291
299 PhyParam_t RegionEU868GetPhyParam(GetPhyParams_t *getPhy);
300
306 void RegionEU868SetBandTxDone(SetBandTxDoneParams_t *txDone);
307
313 void RegionEU868InitDefaults(InitType_t type);
314
324 bool RegionEU868Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute);
325
332 void RegionEU868ApplyCFList(ApplyCFListParams_t *applyCFList);
333
341 bool RegionEU868ChanMaskSet(ChanMaskSetParams_t *chanMaskSet);
342
356 bool RegionEU868AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter);
357
371 void RegionEU868ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams);
372
382 bool RegionEU868RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate);
383
395 bool RegionEU868TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir);
396
412 uint8_t RegionEU868LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed);
413
421 uint8_t RegionEU868RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq);
422
430 uint8_t RegionEU868NewChannelReq(NewChannelReqParams_t *newChannelReq);
431
441 int8_t RegionEU868TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq);
442
450 uint8_t RegionEU868DlChannelReq(DlChannelReqParams_t *dlChannelReq);
451
459 int8_t RegionEU868AlternateDr(AlternateDrParams_t *alternateDr);
460
466 void RegionEU868CalcBackOff(CalcBackOffParams_t *calcBackOff);
467
482 bool RegionEU868NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff);
483
491 LoRaMacStatus_t RegionEU868ChannelAdd(ChannelAddParams_t *channelAdd);
492
500 bool RegionEU868ChannelsRemove(ChannelRemoveParams_t *channelRemove);
501
507 void RegionEU868SetContinuousWave(ContinuousWaveParams_t *continuousWave);
508
520 uint8_t RegionEU868ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset);
521
523 };
524 #endif // __REGION_EU868_H__
sChannelRemoveParams
Definition: Region.h:1217
RegionEU868NextChannel
bool RegionEU868NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
LoRaMacStatus_t
enum eLoRaMacStatus LoRaMacStatus_t
RegionEU868GetPhyParam
PhyParam_t RegionEU868GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
sTxConfigParams
Definition: Region.h:999
InitType_t
enum eInitType InitType_t
sSetBandTxDoneParams
Definition: Region.h:832
sRxParamSetupReqParams
Definition: Region.h:1065
uVerifyParams
Definition: Region.h:850
RegionEU868ChannelsRemove
bool RegionEU868ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.
sRxConfigParams
Definition: Region.h:948
RegionEU868DlChannelReq
uint8_t RegionEU868DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
RegionEU868ComputeRxWindowParameters
void RegionEU868ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
sAlternateDrParams
Definition: Region.h:1133
RegionEU868LinkAdrReq
uint8_t RegionEU868LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
sNewChannelReqParams
Definition: Region.h:1084
RegionEU868ApplyCFList
void RegionEU868ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
sContinuousWaveParams
Definition: Region.h:1228
sAdrNextParams
Definition: Region.h:917
MaxPayloadOfDatarateEU868
static const uint8_t MaxPayloadOfDatarateEU868[]
Definition: RegionEU868.h:285
RegionEU868AlternateDr
int8_t RegionEU868AlternateDr(AlternateDrParams_t *alternateDr)
Alternates the datarate of the channel for the join request.
RegionEU868ChannelAdd
LoRaMacStatus_t RegionEU868ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
sCalcBackOffParams
Definition: Region.h:1144
DataratesEU868
static const uint8_t DataratesEU868[]
Definition: RegionEU868.h:275
RegionEU868SetBandTxDone
void RegionEU868SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
sApplyCFListParams
Definition: Region.h:887
sTxParamSetupReqParams
Definition: Region.h:1099
RegionEU868InitDefaults
void RegionEU868InitDefaults(InitType_t type)
Initializes the channels masks and the channels.
sChanMaskSetParams
Definition: Region.h:902
RegionEU868RxParamSetupReq
uint8_t RegionEU868RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
sLinkAdrReqParams
Definition: Region.h:1030
RegionEU868NewChannelReq
uint8_t RegionEU868NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
RegionEU868AdrNext
bool RegionEU868AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter)
Calculates the next datarate to set, when ADR is on or off.
RegionEU868ChanMaskSet
bool RegionEU868ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
RegionEU868SetContinuousWave
void RegionEU868SetContinuousWave(ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
sNextChanParams
Definition: Region.h:1175
uPhyParam
Definition: Region.h:780
RegionEU868ApplyDrOffset
uint8_t RegionEU868ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
RegionEU868TxConfig
bool RegionEU868TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
sChannelAddParams
Definition: Region.h:1202
RegionEU868CalcBackOff
void RegionEU868CalcBackOff(CalcBackOffParams_t *calcBackOff)
Calculates the back-off time.
sDlChannelReqParams
Definition: Region.h:1118
sGetPhyParams
Definition: Region.h:803
RegionEU868Verify
bool RegionEU868Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
RegionEU868RxConfig
bool RegionEU868RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
PhyAttribute_t
enum ePhyAttribute PhyAttribute_t
BandwidthsEU868
static const uint32_t BandwidthsEU868[]
Definition: RegionEU868.h:280
TimerTime_t
uint32_t TimerTime_t
Timer time variable definition.
Definition: timer.h:69
RegionEU868TxParamSetupReq
int8_t RegionEU868TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
MaxPayloadOfDatarateRepeaterEU868
static const uint8_t MaxPayloadOfDatarateRepeaterEU868[]
Definition: RegionEU868.h:290