| SX126x-Arduino 2.0.1

RegionIN865.h
Go to the documentation of this file.
1
35 #ifndef __REGION_IN865_H__
36 #define __REGION_IN865_H__
37
38 extern "C"
39 {
40
44 #define IN865_MAX_NB_CHANNELS 16
45
49 #define IN865_NUMB_DEFAULT_CHANNELS 3
50
54 #define IN865_NUMB_CHANNELS_CF_LIST 5
55
59 #define IN865_TX_MIN_DATARATE DR_0
60
64 #define IN865_TX_MAX_DATARATE DR_7
65
69 #define IN865_RX_MIN_DATARATE DR_0
70
74 #define IN865_RX_MAX_DATARATE DR_7
75
79 #define IN865_DEFAULT_DATARATE DR_0
80
84 #define IN865_MIN_RX1_DR_OFFSET 0
85
89 #define IN865_MAX_RX1_DR_OFFSET 7
90
94 #define IN865_DEFAULT_RX1_DR_OFFSET 0
95
99 #define IN865_MIN_TX_POWER TX_POWER_10
100
104 #define IN865_MAX_TX_POWER TX_POWER_0
105
109 #define IN865_DEFAULT_TX_POWER TX_POWER_0
110
114 #define IN865_DEFAULT_MAX_EIRP 30.0f
115
119 #define IN865_DEFAULT_ANTENNA_GAIN 2.15f
120
124 #define IN865_ADR_ACK_LIMIT 64
125
129 #define IN865_ADR_ACK_DELAY 32
130
134 #define IN865_DUTY_CYCLE_ENABLED 1
135
139 #define IN865_MAX_RX_WINDOW 3000
140
144 #define IN865_RECEIVE_DELAY1 1000
145
149 #define IN865_RECEIVE_DELAY2 2000
150
154 #define IN865_JOIN_ACCEPT_DELAY1 5000
155
159 #define IN865_JOIN_ACCEPT_DELAY2 6000
160
164 #define IN865_MAX_FCNT_GAP 16384
165
169 #define IN865_ACKTIMEOUT 2000
170
174 #define IN865_ACK_TIMEOUT_RND 1000
175
176 #if (IN865_DEFAULT_DATARATE > DR_5)
177 #error "A default DR higher than DR_5 may lead to connectivity loss."
178 #endif
179
183 #define IN865_RX_WND_2_FREQ 866550000
184
188 #define IN865_RX_WND_2_DR DR_2
189
193 #define IN865_MAX_NB_BANDS 1
194
199 #define IN865_BAND0 \
200 { \
201 1, IN865_MAX_TX_POWER, 0, 0 \
202 } // 100.0 %
203
208 #define IN865_LC1 \
209 { \
210 865062500, 0, {((DR_5 << 4) | DR_0)}, 0 \
211 }
212
217 #define IN865_LC2 \
218 { \
219 865402500, 0, {((DR_5 << 4) | DR_0)}, 0 \
220 }
221
226 #define IN865_LC3 \
227 { \
228 865985000, 0, {((DR_5 << 4) | DR_0)}, 0 \
229 }
230
234 #define IN865_JOIN_CHANNELS (uint16_t)(LC(1) | LC(2) | LC(3))
235
239 static const uint8_t DataratesIN865[] = {12, 11, 10, 9, 8, 7, 7, 50};
240
244 static const uint32_t BandwidthsIN865[] = {125000, 125000, 125000, 125000, 125000, 125000, 250000, 0};
245
249 static const uint8_t MaxPayloadOfDatarateIN865[] = {51, 51, 51, 115, 242, 242, 242, 242};
250
254 static const uint8_t MaxPayloadOfDatarateRepeaterIN865[] = {51, 51, 51, 115, 222, 222, 222, 222};
255
259 static const int8_t EffectiveRx1DrOffsetIN865[] = {0, 1, 2, 3, 4, 5, -1, -2};
260
268 PhyParam_t RegionIN865GetPhyParam(GetPhyParams_t *getPhy);
269
275 void RegionIN865SetBandTxDone(SetBandTxDoneParams_t *txDone);
276
282 void RegionIN865InitDefaults(InitType_t type);
283
293 bool RegionIN865Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute);
294
301 void RegionIN865ApplyCFList(ApplyCFListParams_t *applyCFList);
302
310 bool RegionIN865ChanMaskSet(ChanMaskSetParams_t *chanMaskSet);
311
325 bool RegionIN865AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter);
326
340 void RegionIN865ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams);
341
351 bool RegionIN865RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate);
352
364 bool RegionIN865TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir);
365
381 uint8_t RegionIN865LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed);
382
390 uint8_t RegionIN865RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq);
391
399 uint8_t RegionIN865NewChannelReq(NewChannelReqParams_t *newChannelReq);
400
410 int8_t RegionIN865TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq);
411
419 uint8_t RegionIN865DlChannelReq(DlChannelReqParams_t *dlChannelReq);
420
428 int8_t RegionIN865AlternateDr(AlternateDrParams_t *alternateDr);
429
435 void RegionIN865CalcBackOff(CalcBackOffParams_t *calcBackOff);
436
451 bool RegionIN865NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff);
452
460 LoRaMacStatus_t RegionIN865ChannelAdd(ChannelAddParams_t *channelAdd);
461
469 bool RegionIN865ChannelsRemove(ChannelRemoveParams_t *channelRemove);
470
476 void RegionIN865SetContinuousWave(ContinuousWaveParams_t *continuousWave);
477
489 uint8_t RegionIN865ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset);
490
492 };
493 #endif // __REGION_IN865_H__
RegionIN865DlChannelReq
uint8_t RegionIN865DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
RegionIN865CalcBackOff
void RegionIN865CalcBackOff(CalcBackOffParams_t *calcBackOff)
Calculates the back-off time.
sChannelRemoveParams
Definition: Region.h:1217
MaxPayloadOfDatarateIN865
static const uint8_t MaxPayloadOfDatarateIN865[]
Definition: RegionIN865.h:249
LoRaMacStatus_t
enum eLoRaMacStatus LoRaMacStatus_t
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
sRxConfigParams
Definition: Region.h:948
RegionIN865LinkAdrReq
uint8_t RegionIN865LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
sAlternateDrParams
Definition: Region.h:1133
sNewChannelReqParams
Definition: Region.h:1084
RegionIN865ChannelAdd
LoRaMacStatus_t RegionIN865ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
sContinuousWaveParams
Definition: Region.h:1228
sAdrNextParams
Definition: Region.h:917
RegionIN865ChanMaskSet
bool RegionIN865ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
sCalcBackOffParams
Definition: Region.h:1144
RegionIN865InitDefaults
void RegionIN865InitDefaults(InitType_t type)
Initializes the channels masks and the channels.
sApplyCFListParams
Definition: Region.h:887
sTxParamSetupReqParams
Definition: Region.h:1099
RegionIN865GetPhyParam
PhyParam_t RegionIN865GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
sChanMaskSetParams
Definition: Region.h:902
RegionIN865NextChannel
bool RegionIN865NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
sLinkAdrReqParams
Definition: Region.h:1030
RegionIN865SetBandTxDone
void RegionIN865SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
RegionIN865AdrNext
bool RegionIN865AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter)
Calculates the next datarate to set, when ADR is on or off.
RegionIN865NewChannelReq
uint8_t RegionIN865NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
RegionIN865TxParamSetupReq
int8_t RegionIN865TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
sNextChanParams
Definition: Region.h:1175
uPhyParam
Definition: Region.h:780
RegionIN865SetContinuousWave
void RegionIN865SetContinuousWave(ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
RegionIN865RxParamSetupReq
uint8_t RegionIN865RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
sChannelAddParams
Definition: Region.h:1202
RegionIN865ComputeRxWindowParameters
void RegionIN865ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
RegionIN865TxConfig
bool RegionIN865TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
RegionIN865ApplyCFList
void RegionIN865ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
sDlChannelReqParams
Definition: Region.h:1118
sGetPhyParams
Definition: Region.h:803
RegionIN865Verify
bool RegionIN865Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
MaxPayloadOfDatarateRepeaterIN865
static const uint8_t MaxPayloadOfDatarateRepeaterIN865[]
Definition: RegionIN865.h:254
RegionIN865ApplyDrOffset
uint8_t RegionIN865ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
RegionIN865ChannelsRemove
bool RegionIN865ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.
DataratesIN865
static const uint8_t DataratesIN865[]
Definition: RegionIN865.h:239
RegionIN865RxConfig
bool RegionIN865RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
EffectiveRx1DrOffsetIN865
static const int8_t EffectiveRx1DrOffsetIN865[]
Definition: RegionIN865.h:259
RegionIN865AlternateDr
int8_t RegionIN865AlternateDr(AlternateDrParams_t *alternateDr)
Alternates the datarate of the channel for the join request.
PhyAttribute_t
enum ePhyAttribute PhyAttribute_t
TimerTime_t
uint32_t TimerTime_t
Timer time variable definition.
Definition: timer.h:69
BandwidthsIN865
static const uint32_t BandwidthsIN865[]
Definition: RegionIN865.h:244