Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers loraphy_target.h Source File

loraphy_target.h

00001 /**
00002  * Copyright (c) 2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef LORAPHY_TARGET
00019 #define LORAPHY_TARGET
00020 
00021 #ifdef MBED_CONF_LORA_PHY
00022 
00023 #define LORA_REGION_EU868           0x10
00024 #define LORA_REGION_AS923           0x11
00025 #define LORA_REGION_AU915           0x12
00026 #define LORA_REGION_CN470           0x13
00027 #define LORA_REGION_CN779           0x14
00028 #define LORA_REGION_EU433           0x15
00029 #define LORA_REGION_IN865           0x16
00030 #define LORA_REGION_KR920           0x17
00031 #define LORA_REGION_US915           0x18
00032 
00033 //DO NOT USE integer values in mbed_app.json!
00034 //These are defined for backward compatibility and
00035 //Will be DEPRECATED in the future
00036 #define LORA_REGION_0       0x10
00037 #define LORA_REGION_1       0x11
00038 #define LORA_REGION_2       0x12
00039 #define LORA_REGION_3       0x13
00040 #define LORA_REGION_4       0x14
00041 #define LORA_REGION_5       0x15
00042 #define LORA_REGION_6       0x16
00043 #define LORA_REGION_7       0x17
00044 #define LORA_REGION_8       0x18
00045 
00046 //Since 0 would be equal to any undefined value we need to handle this in a other way
00047 #define mbed_lora_concat_(x) LORA_REGION_##x
00048 #define mbed_lora_concat(x) mbed_lora_concat_(x)
00049 #define LORA_REGION mbed_lora_concat(MBED_CONF_LORA_PHY)
00050 
00051 #if LORA_REGION      == LORA_REGION_EU868
00052 #include "lorawan/lorastack/phy/LoRaPHYEU868.h"
00053 #define LoRaPHY_region LoRaPHYEU868
00054 #elif LORA_REGION    == LORA_REGION_AS923
00055 #include "lorawan/lorastack/phy/LoRaPHYAS923.h"
00056 #define LoRaPHY_region LoRaPHYAS923
00057 #elif LORA_REGION    == LORA_REGION_AU915
00058 #include "lorawan/lorastack/phy/LoRaPHYAU915.h"
00059 #define LoRaPHY_region LoRaPHYAU915
00060 #elif LORA_REGION    == LORA_REGION_CN470
00061 #include "lorawan/lorastack/phy/LoRaPHYCN470.h"
00062 #define LoRaPHY_region LoRaPHYCN470
00063 #elif LORA_REGION    == LORA_REGION_CN779
00064 #include "lorawan/lorastack/phy/LoRaPHYCN779.h"
00065 #define LoRaPHY_region LoRaPHYCN779
00066 #elif LORA_REGION    == LORA_REGION_EU433
00067 #include "lorawan/lorastack/phy/LoRaPHYEU433.h"
00068 #define LoRaPHY_region LoRaPHYEU433
00069 #elif LORA_REGION    == LORA_REGION_IN865
00070 #include "lorawan/lorastack/phy/LoRaPHYIN865.h"
00071 #define LoRaPHY_region LoRaPHYIN865
00072 #elif LORA_REGION    == LORA_REGION_KR920
00073 #include "lorawan/lorastack/phy/LoRaPHYKR920.h"
00074 #define LoRaPHY_region LoRaPHYKR920
00075 #elif LORA_REGION    == LORA_REGION_US915
00076 #include "lorawan/lorastack/phy/LoRaPHYUS915.h"
00077 #define LoRaPHY_region LoRaPHYUS915
00078 #else
00079 #error "Invalid region configuration, update mbed_app.json with correct MBED_CONF_LORA_PHY value"
00080 #endif //MBED_CONF_LORA_PHY == VALUE
00081 #else
00082 #error "Must set LoRa PHY layer parameters."
00083 #endif //MBED_CONF_LORA_PHY
00084 
00085 #endif // LORAPHY_TARGET
00086