Level measurement using range finder and lora technology

Dependencies:   Cayenne-LPP SDBlockDevice

Committer:
wamae
Date:
Wed Jun 26 10:35:50 2019 +0000
Revision:
0:f930f0440fd5
better copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wamae 0:f930f0440fd5 1 /**
wamae 0:f930f0440fd5 2 * Copyright (c) 2017, Arm Limited and affiliates.
wamae 0:f930f0440fd5 3 * SPDX-License-Identifier: Apache-2.0
wamae 0:f930f0440fd5 4 *
wamae 0:f930f0440fd5 5 * Licensed under the Apache License, Version 2.0 (the "License");
wamae 0:f930f0440fd5 6 * you may not use this file except in compliance with the License.
wamae 0:f930f0440fd5 7 * You may obtain a copy of the License at
wamae 0:f930f0440fd5 8 *
wamae 0:f930f0440fd5 9 * http://www.apache.org/licenses/LICENSE-2.0
wamae 0:f930f0440fd5 10 *
wamae 0:f930f0440fd5 11 * Unless required by applicable law or agreed to in writing, software
wamae 0:f930f0440fd5 12 * distributed under the License is distributed on an "AS IS" BASIS,
wamae 0:f930f0440fd5 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
wamae 0:f930f0440fd5 14 * See the License for the specific language governing permissions and
wamae 0:f930f0440fd5 15 * limitations under the License.
wamae 0:f930f0440fd5 16 */
wamae 0:f930f0440fd5 17
wamae 0:f930f0440fd5 18 #include "lorawan/LoRaRadio.h"
wamae 0:f930f0440fd5 19
wamae 0:f930f0440fd5 20 #ifndef APP_LORA_RADIO_HELPER_H_
wamae 0:f930f0440fd5 21 #define APP_LORA_RADIO_HELPER_H_
wamae 0:f930f0440fd5 22
wamae 0:f930f0440fd5 23 #include "SX1272_LoRaRadio.h"
wamae 0:f930f0440fd5 24 #include "SX1276_LoRaRadio.h"
wamae 0:f930f0440fd5 25
wamae 0:f930f0440fd5 26 #define SX1272 0xFF
wamae 0:f930f0440fd5 27 #define SX1276 0xEE
wamae 0:f930f0440fd5 28
wamae 0:f930f0440fd5 29 #if (MBED_CONF_APP_LORA_RADIO == SX1272)
wamae 0:f930f0440fd5 30
wamae 0:f930f0440fd5 31 SX1272_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI,
wamae 0:f930f0440fd5 32 MBED_CONF_APP_LORA_SPI_MISO,
wamae 0:f930f0440fd5 33 MBED_CONF_APP_LORA_SPI_SCLK,
wamae 0:f930f0440fd5 34 MBED_CONF_APP_LORA_CS,
wamae 0:f930f0440fd5 35 MBED_CONF_APP_LORA_RESET,
wamae 0:f930f0440fd5 36 MBED_CONF_APP_LORA_DIO0,
wamae 0:f930f0440fd5 37 MBED_CONF_APP_LORA_DIO1,
wamae 0:f930f0440fd5 38 MBED_CONF_APP_LORA_DIO2,
wamae 0:f930f0440fd5 39 MBED_CONF_APP_LORA_DIO3,
wamae 0:f930f0440fd5 40 MBED_CONF_APP_LORA_DIO4,
wamae 0:f930f0440fd5 41 MBED_CONF_APP_LORA_DIO5,
wamae 0:f930f0440fd5 42 MBED_CONF_APP_LORA_RF_SWITCH_CTL1,
wamae 0:f930f0440fd5 43 MBED_CONF_APP_LORA_RF_SWITCH_CTL2,
wamae 0:f930f0440fd5 44 MBED_CONF_APP_LORA_TXCTL,
wamae 0:f930f0440fd5 45 MBED_CONF_APP_LORA_RXCTL,
wamae 0:f930f0440fd5 46 MBED_CONF_APP_LORA_ANT_SWITCH,
wamae 0:f930f0440fd5 47 MBED_CONF_APP_LORA_PWR_AMP_CTL,
wamae 0:f930f0440fd5 48 MBED_CONF_APP_LORA_TCXO);
wamae 0:f930f0440fd5 49
wamae 0:f930f0440fd5 50 #elif (MBED_CONF_APP_LORA_RADIO == SX1276)
wamae 0:f930f0440fd5 51
wamae 0:f930f0440fd5 52 SX1276_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI,
wamae 0:f930f0440fd5 53 MBED_CONF_APP_LORA_SPI_MISO,
wamae 0:f930f0440fd5 54 MBED_CONF_APP_LORA_SPI_SCLK,
wamae 0:f930f0440fd5 55 MBED_CONF_APP_LORA_CS,
wamae 0:f930f0440fd5 56 MBED_CONF_APP_LORA_RESET,
wamae 0:f930f0440fd5 57 MBED_CONF_APP_LORA_DIO0,
wamae 0:f930f0440fd5 58 MBED_CONF_APP_LORA_DIO1,
wamae 0:f930f0440fd5 59 MBED_CONF_APP_LORA_DIO2,
wamae 0:f930f0440fd5 60 MBED_CONF_APP_LORA_DIO3,
wamae 0:f930f0440fd5 61 MBED_CONF_APP_LORA_DIO4,
wamae 0:f930f0440fd5 62 MBED_CONF_APP_LORA_DIO5,
wamae 0:f930f0440fd5 63 MBED_CONF_APP_LORA_RF_SWITCH_CTL1,
wamae 0:f930f0440fd5 64 MBED_CONF_APP_LORA_RF_SWITCH_CTL2,
wamae 0:f930f0440fd5 65 MBED_CONF_APP_LORA_TXCTL,
wamae 0:f930f0440fd5 66 MBED_CONF_APP_LORA_RXCTL,
wamae 0:f930f0440fd5 67 MBED_CONF_APP_LORA_ANT_SWITCH,
wamae 0:f930f0440fd5 68 MBED_CONF_APP_LORA_PWR_AMP_CTL,
wamae 0:f930f0440fd5 69 MBED_CONF_APP_LORA_TCXO);
wamae 0:f930f0440fd5 70
wamae 0:f930f0440fd5 71 #else
wamae 0:f930f0440fd5 72 #error "Unknown LoRa radio specified (SX1272,SX1276 are valid)"
wamae 0:f930f0440fd5 73 #endif
wamae 0:f930f0440fd5 74
wamae 0:f930f0440fd5 75
wamae 0:f930f0440fd5 76 #endif /* APP_LORA_RADIO_HELPER_H_ */