|
37 | 37 | */
|
38 | 38 | #define AS923_NUMB_DEFAULT_CHANNELS 2
|
39 | 39 |
|
| 40 | +/*! |
| 41 | + * Set default SUB region if not defined |
| 42 | + */ |
| 43 | +#ifndef MBED_CONF_LORA_PHY_AS923_SUB_REGION |
| 44 | +#define MBED_CONF_LORA_PHY_AS923_SUB_REGION AS1 |
| 45 | +#warning "MBED_CONF_LORA_PHY_AS923_SUB_REGION is not set in mbed_app.json, default to `AS1`!" |
| 46 | +#endif |
| 47 | + |
| 48 | +/*! |
| 49 | + * Define the SUB-REGION's |
| 50 | + */ |
| 51 | +#define LORA_AS923_SUB_REGION_AS1 0x01 |
| 52 | +#define LORA_AS923_SUB_REGION_AS2 0x02 |
| 53 | +#define LORA_AS923_SUB_REGION_AS3 0x03 |
| 54 | +#define LORA_AS923_SUB_REGION_AS4 0x04 |
| 55 | + |
| 56 | +/*! |
| 57 | + * Parse SUB-REGION config |
| 58 | + */ |
| 59 | +#define mbed_lora_concat_(x) LORA_AS923_SUB_REGION_##x |
| 60 | +#define mbed_lora_concat(x) mbed_lora_concat_(x) |
| 61 | +#define LORA_AS923_SUB_REGION mbed_lora_concat(MBED_CONF_LORA_PHY_AS923_SUB_REGION) |
| 62 | + |
| 63 | + |
| 64 | +/*! |
| 65 | + * Define the Frequencies for teh SUB REGION within AS923 for AS1,AS2, AS3,AS4. |
| 66 | + */ |
| 67 | +#if ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS1 ) |
| 68 | +// Singapore, Japan, Malaysia, Myanmar .... |
| 69 | +// Historical AS923 =>RP002-1.0.0 LoRaWAN - 923..928Mhz |
| 70 | +/*! |
| 71 | +* Default transmit channel frequency's definition. |
| 72 | +*/ |
| 73 | +#define AS923_LC1_FREQ 923200000 |
| 74 | +#define AS923_LC2_FREQ 923400000 |
| 75 | +/*! |
| 76 | +* channel frequnetie range. |
| 77 | +*/ |
| 78 | +#define AS923_LOWER_FREQ 923000000 |
| 79 | +#define AS923_UPPER_FREQ 928000000 |
| 80 | +/*! |
| 81 | +* Second reception window channel frequency definition. |
| 82 | +*/ |
| 83 | +#define AS923_RX_WND_2_FREQ 923200000 |
| 84 | +#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS2 ) |
| 85 | +// Brunei, Hong Kong, Indonesia, Laos, Cambodia, Thaland, Taiwan, Vietnam |
| 86 | +// OFFSET -1.8 MHz AS923-1 =>RP002-1.0.1 LoRaWAN - 920..923Mhz |
| 87 | +#define AS923_LC1_FREQ 921400000 |
| 88 | +#define AS923_LC2_FREQ 921600000 |
| 89 | +#define AS923_LOWER_FREQ 920000000 |
| 90 | +#define AS923_UPPER_FREQ 923000000 |
| 91 | +#define AS923_RX_WND_2_FREQ 921400000 |
| 92 | +#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS3 ) |
| 93 | +// Philipines, Quatar, Switzerland, Hungary, Cuba, Denmark .... 18 countries |
| 94 | +// OFFSET -6.6Mhz AS923-1 =>RP002-1.0.1 LoRaWAN - 915..921Mhz |
| 95 | +#define AS923_LC1_FREQ 916600000 |
| 96 | +#define AS923_LC2_FREQ 916800000 |
| 97 | +#define AS923_LOWER_FREQ 915000000 |
| 98 | +#define AS923_UPPER_FREQ 921000000 |
| 99 | +#define AS923_RX_WND_2_FREQ 916600000 |
| 100 | +#elif ( LORA_AS923_SUB_REGION == LORA_AS923_SUB_REGION_AS4 ) |
| 101 | +// Israel |
| 102 | +// OFFSET -5.9MHz AS923-1 =>RP002-1.0.3 LoRaWAN - 917..920Mhz |
| 103 | +#define AS923_LC1_FREQ 917300000 |
| 104 | +#define AS923_LC2_FREQ 917500000 |
| 105 | +#define AS923_LOWER_FREQ 917000000 |
| 106 | +#define AS923_UPPER_FREQ 920000000 |
| 107 | +#define AS923_RX_WND_2_FREQ 917300000 |
| 108 | +#else |
| 109 | +#error "Invalid SUB region configuration, update mbed_app.json with correct MBED_CONF_LORA_PHY_AS923_SUB_REGION value" |
| 110 | +#endif |
| 111 | + |
| 112 | + |
| 113 | + |
40 | 114 | /*!
|
41 | 115 | * Number of channels to apply for the CF list
|
42 | 116 | */
|
|
0 commit comments