LoRaMAC  4.4.5
Documentation of the API
RegionUS915.h
Go to the documentation of this file.
1 
37 #ifndef __REGION_US915_H__
38 #define __REGION_US915_H__
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 #include "region/Region.h"
46 
50 #define US915_MAX_NB_CHANNELS 72
51 
55 #define US915_TX_MIN_DATARATE DR_0
56 
60 #define US915_TX_MAX_DATARATE DR_4
61 
65 #define US915_RX_MIN_DATARATE DR_8
66 
70 #define US915_RX_MAX_DATARATE DR_13
71 
75 #define US915_DEFAULT_DATARATE DR_0
76 
80 #define US915_MIN_RX1_DR_OFFSET 0
81 
85 #define US915_MAX_RX1_DR_OFFSET 3
86 
90 #define US915_MIN_TX_POWER TX_POWER_14
91 
95 #define US915_MAX_TX_POWER TX_POWER_0
96 
100 #define US915_DEFAULT_TX_POWER TX_POWER_0
101 
105 #define US915_DEFAULT_MAX_ERP 30.0f
106 
110 #define US915_DUTY_CYCLE_ENABLED 0
111 
115 #define US915_MAX_RX_WINDOW 3000
116 
120 #define US915_RX_WND_2_FREQ 923300000
121 
125 #define US915_RX_WND_2_DR DR_8
126 
130 #define US915_DEFAULT_UPLINK_DWELL_TIME 0
131 
132 /*
133  * CLASS B
134  */
138 #define US915_BEACON_CHANNEL_FREQ 923300000
139 
143 #define US915_BEACON_CHANNEL_STEPWIDTH 600000
144 
148 #define US915_PING_SLOT_CHANNEL_FREQ 923300000
149 
153 #define US915_BEACON_NB_CHANNELS 8
154 
158 #define US915_BEACON_SIZE 23
159 
163 #define US915_RFU1_SIZE 5
164 
168 #define US915_RFU2_SIZE 3
169 
173 #define US915_BEACON_CHANNEL_DR DR_8
174 
178 #define US915_BEACON_CHANNEL_BW 2
179 
183 #define US915_PING_SLOT_CHANNEL_DR DR_8
184 
188 #define US915_MAX_NB_BANDS 1
189 
194 #define US915_BAND0 { 1, US915_MAX_TX_POWER, 0, 0, 0, 0, 0 } // 100.0 %
195 
199 #define US915_FIRST_RX1_CHANNEL ( (uint32_t) 923300000 )
200 
204 #define US915_LAST_RX1_CHANNEL ( (uint32_t) 927500000 )
205 
209 #define US915_STEPWIDTH_RX1_CHANNEL ( (uint32_t) 600000 )
210 
214 static const uint8_t DataratesUS915[] = { 10, 9, 8, 7, 8, 0, 0, 0, 12, 11, 10, 9, 8, 7, 0, 0 };
215 
219 static const uint32_t BandwidthsUS915[] = { 125000, 125000, 125000, 125000, 500000, 0, 0, 0, 500000, 500000, 500000, 500000, 500000, 500000, 0, 0 };
220 
224 static const int8_t DatarateOffsetsUS915[5][4] =
225 {
226  { DR_10, DR_9 , DR_8 , DR_8 }, // DR_0
227  { DR_11, DR_10, DR_9 , DR_8 }, // DR_1
228  { DR_12, DR_11, DR_10, DR_9 }, // DR_2
229  { DR_13, DR_12, DR_11, DR_10 }, // DR_3
230  { DR_13, DR_13, DR_12, DR_11 }, // DR_4
231 };
232 
236 static const uint8_t MaxPayloadOfDatarateUS915[] = { 11, 53, 125, 242, 242, 0, 0, 0, 53, 129, 242, 242, 242, 242, 0, 0 };
237 
246 
253 
260 
268 void* RegionUS915GetNvmCtx( GetNvmCtxParams_t* params );
269 
279 bool RegionUS915Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute );
280 
287 void RegionUS915ApplyCFList( ApplyCFListParams_t* applyCFList );
288 
296 bool RegionUS915ChanMaskSet( ChanMaskSetParams_t* chanMaskSet );
297 
311 void RegionUS915ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams );
312 
322 bool RegionUS915RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate );
323 
335 bool RegionUS915TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, TimerTime_t* txTimeOnAir );
336 
344 uint8_t RegionUS915LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed );
345 
353 uint8_t RegionUS915RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq );
354 
362 uint8_t RegionUS915NewChannelReq( NewChannelReqParams_t* newChannelReq );
363 
373 int8_t RegionUS915TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq );
374 
382 uint8_t RegionUS915DlChannelReq( DlChannelReqParams_t* dlChannelReq );
383 
393 int8_t RegionUS915AlternateDr( int8_t currentDr, AlternateDrType_t type );
394 
407 LoRaMacStatus_t RegionUS915NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, TimerTime_t* time, TimerTime_t* aggregatedTimeOff );
408 
417 
425 bool RegionUS915ChannelsRemove( ChannelRemoveParams_t* channelRemove );
426 
433 
445 uint8_t RegionUS915ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset );
446 
452 void RegionUS915RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr );
453 
456 #ifdef __cplusplus
457 }
458 #endif
459 
460 #endif // __REGION_US915_H__
RegionUS915RxParamSetupReq
uint8_t RegionUS915RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
RegionUS915RxBeaconSetup
void RegionUS915RxBeaconSetup(RxBeaconSetup_t *rxBeaconSetup, uint8_t *outDr)
Sets the radio into beacon reception mode.
AlternateDrType_t
AlternateDrType_t
Definition: Region.h:1264
Region.h
Region implementation.
GetPhyParams_t
Definition: Region.h:921
RegionUS915InitDefaults
void RegionUS915InitDefaults(InitDefaultsParams_t *params)
Initializes the channels masks and the channels.
DR_8
#define DR_8
Definition: Region.h:223
LoRaMacStatus_t
LoRaMacStatus_t
Definition: LoRaMac.h:2153
RegionUS915GetPhyParam
PhyParam_t RegionUS915GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
RegionUS915ApplyCFList
void RegionUS915ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
RegionUS915ChannelAdd
LoRaMacStatus_t RegionUS915ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
ChanMaskSetParams_t
Definition: Region.h:1064
ContinuousWaveParams_t
Definition: Region.h:1344
NextChanParams_t
Definition: Region.h:1279
RxBeaconSetup_t
Definition: Region.h:1375
RegionUS915ChanMaskSet
bool RegionUS915ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
DR_13
#define DR_13
Definition: Region.h:303
NewChannelReqParams_t
Definition: Region.h:1215
RegionUS915SetContinuousWave
void RegionUS915SetContinuousWave(ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
RegionUS915TxParamSetupReq
int8_t RegionUS915TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
RegionUS915ChannelsRemove
bool RegionUS915ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.
TxParamSetupReqParams_t
Definition: Region.h:1230
DR_9
#define DR_9
Definition: Region.h:239
RegionUS915ApplyDrOffset
uint8_t RegionUS915ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
PhyAttribute_t
PhyAttribute_t
Definition: Region.h:589
GetNvmCtxParams_t
Definition: Region.h:1000
DR_10
#define DR_10
Definition: Region.h:255
DR_11
#define DR_11
Definition: Region.h:271
RegionUS915LinkAdrReq
uint8_t RegionUS915LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
ChannelAddParams_t
Definition: Region.h:1318
RegionUS915SetBandTxDone
void RegionUS915SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
RxConfigParams_t
Definition: Region.h:1079
ApplyCFListParams_t
Definition: Region.h:1049
RegionUS915TxConfig
bool RegionUS915TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
DlChannelReqParams_t
Definition: Region.h:1249
TxConfigParams_t
Definition: Region.h:1126
RegionUS915Verify
bool RegionUS915Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
RegionUS915NextChannel
LoRaMacStatus_t RegionUS915NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
RegionUS915DlChannelReq
uint8_t RegionUS915DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
RegionUS915NewChannelReq
uint8_t RegionUS915NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
InitDefaultsParams_t
Definition: Region.h:985
SetBandTxDoneParams_t
Definition: Region.h:958
RxParamSetupReqParams_t
Definition: Region.h:1196
VerifyParams_t
Definition: Region.h:1012
PhyParam_t
Definition: Region.h:890
RegionUS915ComputeRxWindowParameters
void RegionUS915ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
RegionUS915RxConfig
bool RegionUS915RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
RegionUS915AlternateDr
int8_t RegionUS915AlternateDr(int8_t currentDr, AlternateDrType_t type)
Alternates the datarate of the channel for the join request.
RegionUS915GetNvmCtx
void * RegionUS915GetNvmCtx(GetNvmCtxParams_t *params)
Returns a pointer to the internal context and its size.
DR_12
#define DR_12
Definition: Region.h:287
ChannelRemoveParams_t
Definition: Region.h:1333