| SX126x-Arduino 2.0.1

RegionCN470.h
Go to the documentation of this file.
1
35 #ifndef __REGION_CN470_H__
36 #define __REGION_CN470_H__
37
38 extern "C"
39 {
40
44 #define CN470_MAX_NB_CHANNELS 96
45
49 #define CN470_TX_MIN_DATARATE DR_0
50
54 #define CN470_TX_MAX_DATARATE DR_5
55
59 #define CN470_RX_MIN_DATARATE DR_0
60
64 #define CN470_RX_MAX_DATARATE DR_5
65
69 #define CN470_DEFAULT_DATARATE DR_0
70
74 #define CN470_MIN_RX1_DR_OFFSET 0
75
79 #define CN470_MAX_RX1_DR_OFFSET 3
80
84 #define CN470_DEFAULT_RX1_DR_OFFSET 0
85
89 #define CN470_MIN_TX_POWER TX_POWER_7
90
94 #define CN470_MAX_TX_POWER TX_POWER_0
95
99 #define CN470_DEFAULT_TX_POWER TX_POWER_0
100
104 #define CN470_DEFAULT_MAX_EIRP 19.15f
105
109 #define CN470_DEFAULT_ANTENNA_GAIN 2.15f
110
114 #define CN470_ADR_ACK_LIMIT 64
115
119 #define CN470_ADR_ACK_DELAY 32
120
124 #define CN470_DUTY_CYCLE_ENABLED 0
125
129 #define CN470_MAX_RX_WINDOW 3000
130
134 #define CN470_RECEIVE_DELAY1 1000
135
139 #define CN470_RECEIVE_DELAY2 2000
140
144 #define CN470_JOIN_ACCEPT_DELAY1 5000
145
149 #define CN470_JOIN_ACCEPT_DELAY2 6000
150
154 #define CN470_MAX_FCNT_GAP 16384
155
159 #define CN470_ACKTIMEOUT 2000
160
164 #define CN470_ACK_TIMEOUT_RND 1000
165
169 #define CN470_RX_WND_2_FREQ 505300000
170
174 #define CN470_RX_WND_2_DR DR_0
175
179 #define CN470_MAX_NB_BANDS 1
180
185 #define CN470_BAND0 \
186 { \
187 1, CN470_MAX_TX_POWER, 0, 0 \
188 } // 100.0 %
189
193 #define CN470_FIRST_RX1_CHANNEL ((uint32_t)500300000)
194
198 #define CN470_LAST_RX1_CHANNEL ((uint32_t)509700000)
199
203 #define CN470_STEPWIDTH_RX1_CHANNEL ((uint32_t)200000)
204
208 static const uint8_t DataratesCN470[] = {12, 11, 10, 9, 8, 7};
209
213 static const uint32_t BandwidthsCN470[] = {125000, 125000, 125000, 125000, 125000, 125000};
214
218 static const uint8_t MaxPayloadOfDatarateCN470[] = {51, 51, 51, 115, 222, 222};
219
223 static const uint8_t MaxPayloadOfDatarateRepeaterCN470[] = {51, 51, 51, 115, 222, 222};
224
232 PhyParam_t RegionCN470GetPhyParam(GetPhyParams_t *getPhy);
233
239 void RegionCN470SetBandTxDone(SetBandTxDoneParams_t *txDone);
240
246 void RegionCN470InitDefaults(InitType_t type);
247
257 bool RegionCN470Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute);
258
265 void RegionCN470ApplyCFList(ApplyCFListParams_t *applyCFList);
266
274 bool RegionCN470ChanMaskSet(ChanMaskSetParams_t *chanMaskSet);
275
289 bool RegionCN470AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter);
290
304 void RegionCN470ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams);
305
315 bool RegionCN470RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate);
316
328 bool RegionCN470TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir);
329
345 uint8_t RegionCN470LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed);
346
354 uint8_t RegionCN470RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq);
355
363 uint8_t RegionCN470NewChannelReq(NewChannelReqParams_t *newChannelReq);
364
374 int8_t RegionCN470TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq);
375
383 uint8_t RegionCN470DlChannelReq(DlChannelReqParams_t *dlChannelReq);
384
392 int8_t RegionCN470AlternateDr(AlternateDrParams_t *alternateDr);
393
399 void RegionCN470CalcBackOff(CalcBackOffParams_t *calcBackOff);
400
415 bool RegionCN470NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff);
416
424 LoRaMacStatus_t RegionCN470ChannelAdd(ChannelAddParams_t *channelAdd);
425
433 bool RegionCN470ChannelsRemove(ChannelRemoveParams_t *channelRemove);
434
440 void RegionCN470SetContinuousWave(ContinuousWaveParams_t *continuousWave);
441
453 uint8_t RegionCN470ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset);
454
456 };
457 #endif // __REGION_CN470_H__
RegionCN470ComputeRxWindowParameters
void RegionCN470ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
BandwidthsCN470
static const uint32_t BandwidthsCN470[]
Definition: RegionCN470.h:213
sChannelRemoveParams
Definition: Region.h:1217
LoRaMacStatus_t
enum eLoRaMacStatus LoRaMacStatus_t
sTxConfigParams
Definition: Region.h:999
InitType_t
enum eInitType InitType_t
sSetBandTxDoneParams
Definition: Region.h:832
RegionCN470TxParamSetupReq
int8_t RegionCN470TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
sRxParamSetupReqParams
Definition: Region.h:1065
uVerifyParams
Definition: Region.h:850
sRxConfigParams
Definition: Region.h:948
RegionCN470SetBandTxDone
void RegionCN470SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
sAlternateDrParams
Definition: Region.h:1133
RegionCN470NewChannelReq
uint8_t RegionCN470NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
sNewChannelReqParams
Definition: Region.h:1084
sContinuousWaveParams
Definition: Region.h:1228
RegionCN470ChanMaskSet
bool RegionCN470ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
sAdrNextParams
Definition: Region.h:917
RegionCN470SetContinuousWave
void RegionCN470SetContinuousWave(ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
sCalcBackOffParams
Definition: Region.h:1144
RegionCN470CalcBackOff
void RegionCN470CalcBackOff(CalcBackOffParams_t *calcBackOff)
Calculates the back-off time.
RegionCN470Verify
bool RegionCN470Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
RegionCN470RxParamSetupReq
uint8_t RegionCN470RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
sApplyCFListParams
Definition: Region.h:887
DataratesCN470
static const uint8_t DataratesCN470[]
Definition: RegionCN470.h:208
sTxParamSetupReqParams
Definition: Region.h:1099
MaxPayloadOfDatarateRepeaterCN470
static const uint8_t MaxPayloadOfDatarateRepeaterCN470[]
Definition: RegionCN470.h:223
sChanMaskSetParams
Definition: Region.h:902
sLinkAdrReqParams
Definition: Region.h:1030
RegionCN470ChannelAdd
LoRaMacStatus_t RegionCN470ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
RegionCN470NextChannel
bool RegionCN470NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
RegionCN470AdrNext
bool RegionCN470AdrNext(AdrNextParams_t *adrNext, int8_t *drOut, int8_t *txPowOut, uint32_t *adrAckCounter)
Calculates the next datarate to set, when ADR is on or off.
MaxPayloadOfDatarateCN470
static const uint8_t MaxPayloadOfDatarateCN470[]
Definition: RegionCN470.h:218
RegionCN470TxConfig
bool RegionCN470TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
RegionCN470AlternateDr
int8_t RegionCN470AlternateDr(AlternateDrParams_t *alternateDr)
Alternates the datarate of the channel for the join request.
RegionCN470DlChannelReq
uint8_t RegionCN470DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
RegionCN470LinkAdrReq
uint8_t RegionCN470LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
sNextChanParams
Definition: Region.h:1175
RegionCN470ApplyCFList
void RegionCN470ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
uPhyParam
Definition: Region.h:780
RegionCN470InitDefaults
void RegionCN470InitDefaults(InitType_t type)
Initializes the channels masks and the channels.
RegionCN470GetPhyParam
PhyParam_t RegionCN470GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
sChannelAddParams
Definition: Region.h:1202
sDlChannelReqParams
Definition: Region.h:1118
sGetPhyParams
Definition: Region.h:803
RegionCN470RxConfig
bool RegionCN470RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
PhyAttribute_t
enum ePhyAttribute PhyAttribute_t
RegionCN470ApplyDrOffset
uint8_t RegionCN470ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
TimerTime_t
uint32_t TimerTime_t
Timer time variable definition.
Definition: timer.h:69
RegionCN470ChannelsRemove
bool RegionCN470ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.