Marco Zecchini
/
example-ttn-workshop
example for iot course
Embed:
(wiki syntax)
Show/hide line numbers
lora_radio_helper.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 #include "lorawan/LoRaRadio.h" 00019 00020 #ifndef APP_LORA_RADIO_HELPER_H_ 00021 #define APP_LORA_RADIO_HELPER_H_ 00022 00023 #include "SX1272_LoRaRadio.h" 00024 #include "SX1276_LoRaRadio.h" 00025 00026 #define SX1272 0xFF 00027 #define SX1276 0xEE 00028 00029 #if (MBED_CONF_APP_LORA_RADIO == SX1272) 00030 00031 SX1272_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, 00032 MBED_CONF_APP_LORA_SPI_MISO, 00033 MBED_CONF_APP_LORA_SPI_SCLK, 00034 MBED_CONF_APP_LORA_CS, 00035 MBED_CONF_APP_LORA_RESET, 00036 MBED_CONF_APP_LORA_DIO0, 00037 MBED_CONF_APP_LORA_DIO1, 00038 MBED_CONF_APP_LORA_DIO2, 00039 MBED_CONF_APP_LORA_DIO3, 00040 MBED_CONF_APP_LORA_DIO4, 00041 MBED_CONF_APP_LORA_DIO5, 00042 MBED_CONF_APP_LORA_RF_SWITCH_CTL1, 00043 MBED_CONF_APP_LORA_RF_SWITCH_CTL2, 00044 MBED_CONF_APP_LORA_TXCTL, 00045 MBED_CONF_APP_LORA_RXCTL, 00046 MBED_CONF_APP_LORA_ANT_SWITCH, 00047 MBED_CONF_APP_LORA_PWR_AMP_CTL, 00048 MBED_CONF_APP_LORA_TCXO); 00049 00050 #elif (MBED_CONF_APP_LORA_RADIO == SX1276) 00051 00052 SX1276_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, 00053 MBED_CONF_APP_LORA_SPI_MISO, 00054 MBED_CONF_APP_LORA_SPI_SCLK, 00055 MBED_CONF_APP_LORA_CS, 00056 MBED_CONF_APP_LORA_RESET, 00057 MBED_CONF_APP_LORA_DIO0, 00058 MBED_CONF_APP_LORA_DIO1, 00059 MBED_CONF_APP_LORA_DIO2, 00060 MBED_CONF_APP_LORA_DIO3, 00061 MBED_CONF_APP_LORA_DIO4, 00062 MBED_CONF_APP_LORA_DIO5, 00063 MBED_CONF_APP_LORA_RF_SWITCH_CTL1, 00064 MBED_CONF_APP_LORA_RF_SWITCH_CTL2, 00065 MBED_CONF_APP_LORA_TXCTL, 00066 MBED_CONF_APP_LORA_RXCTL, 00067 MBED_CONF_APP_LORA_ANT_SWITCH, 00068 MBED_CONF_APP_LORA_PWR_AMP_CTL, 00069 MBED_CONF_APP_LORA_TCXO); 00070 00071 #else 00072 #error "Unknown LoRa radio specified (SX1272,SX1276 are valid)" 00073 #endif 00074 00075 #endif /* APP_LORA_RADIO_HELPER_H_ */
Generated on Fri Jul 22 2022 23:22:00 by 1.7.2