SafeDetect
/
LoRaWAN_XDOT
basic loraWAN sending, some settings done-- no keys or any of that though
lora_radio_helper.h@18:1720bc3831ea, 2018-05-15 (annotated)
- Committer:
- mbed_official
- Date:
- Tue May 15 13:15:17 2018 +0100
- Revision:
- 18:1720bc3831ea
- Parent:
- 3:8c7198d1a2a1
- Child:
- 46:a124538e2891
Remove usage of DEVICE_SPI and MBED_CONF_APP_LORAWAN_ENABLED flags
mbed-os-example-lorawan project is now CI tested only for targets
which really have lora HW. Therefore DEVICE_SPI and MBED_CONF_APP_LORAWAN_ENABLED
are no longer needed.
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-lorawan
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:7037ed05f54f | 1 | /** |
mbed_official | 0:7037ed05f54f | 2 | * Copyright (c) 2017, Arm Limited and affiliates. |
mbed_official | 0:7037ed05f54f | 3 | * SPDX-License-Identifier: Apache-2.0 |
mbed_official | 0:7037ed05f54f | 4 | * |
mbed_official | 0:7037ed05f54f | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
mbed_official | 0:7037ed05f54f | 6 | * you may not use this file except in compliance with the License. |
mbed_official | 0:7037ed05f54f | 7 | * You may obtain a copy of the License at |
mbed_official | 0:7037ed05f54f | 8 | * |
mbed_official | 0:7037ed05f54f | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 0:7037ed05f54f | 10 | * |
mbed_official | 0:7037ed05f54f | 11 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 0:7037ed05f54f | 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 0:7037ed05f54f | 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 0:7037ed05f54f | 14 | * See the License for the specific language governing permissions and |
mbed_official | 0:7037ed05f54f | 15 | * limitations under the License. |
mbed_official | 0:7037ed05f54f | 16 | */ |
mbed_official | 0:7037ed05f54f | 17 | |
mbed_official | 0:7037ed05f54f | 18 | #include "lorawan/LoRaRadio.h" |
mbed_official | 0:7037ed05f54f | 19 | |
mbed_official | 0:7037ed05f54f | 20 | #ifndef APP_LORA_RADIO_HELPER_H_ |
mbed_official | 0:7037ed05f54f | 21 | #define APP_LORA_RADIO_HELPER_H_ |
mbed_official | 0:7037ed05f54f | 22 | |
mbed_official | 2:dc95ac6d6d4e | 23 | #include "SX1272_LoRaRadio.h" |
mbed_official | 2:dc95ac6d6d4e | 24 | #include "SX1276_LoRaRadio.h" |
mbed_official | 2:dc95ac6d6d4e | 25 | |
mbed_official | 2:dc95ac6d6d4e | 26 | #define SX1272 0xFF |
mbed_official | 2:dc95ac6d6d4e | 27 | #define SX1276 0xEE |
mbed_official | 2:dc95ac6d6d4e | 28 | |
mbed_official | 2:dc95ac6d6d4e | 29 | #if (MBED_CONF_APP_LORA_RADIO == SX1272) |
mbed_official | 2:dc95ac6d6d4e | 30 | |
mbed_official | 2:dc95ac6d6d4e | 31 | SX1272_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, |
mbed_official | 2:dc95ac6d6d4e | 32 | MBED_CONF_APP_LORA_SPI_MISO, |
mbed_official | 2:dc95ac6d6d4e | 33 | MBED_CONF_APP_LORA_SPI_SCLK, |
mbed_official | 2:dc95ac6d6d4e | 34 | MBED_CONF_APP_LORA_CS, |
mbed_official | 2:dc95ac6d6d4e | 35 | MBED_CONF_APP_LORA_RESET, |
mbed_official | 2:dc95ac6d6d4e | 36 | MBED_CONF_APP_LORA_DIO0, |
mbed_official | 2:dc95ac6d6d4e | 37 | MBED_CONF_APP_LORA_DIO1, |
mbed_official | 2:dc95ac6d6d4e | 38 | MBED_CONF_APP_LORA_DIO2, |
mbed_official | 2:dc95ac6d6d4e | 39 | MBED_CONF_APP_LORA_DIO3, |
mbed_official | 2:dc95ac6d6d4e | 40 | MBED_CONF_APP_LORA_DIO4, |
mbed_official | 2:dc95ac6d6d4e | 41 | MBED_CONF_APP_LORA_DIO5, |
mbed_official | 2:dc95ac6d6d4e | 42 | MBED_CONF_APP_LORA_RF_SWITCH_CTL1, |
mbed_official | 2:dc95ac6d6d4e | 43 | MBED_CONF_APP_LORA_RF_SWITCH_CTL2, |
mbed_official | 2:dc95ac6d6d4e | 44 | MBED_CONF_APP_LORA_TXCTL, |
mbed_official | 2:dc95ac6d6d4e | 45 | MBED_CONF_APP_LORA_RXCTL, |
mbed_official | 2:dc95ac6d6d4e | 46 | MBED_CONF_APP_LORA_ANT_SWITCH, |
mbed_official | 2:dc95ac6d6d4e | 47 | MBED_CONF_APP_LORA_PWR_AMP_CTL, |
mbed_official | 2:dc95ac6d6d4e | 48 | MBED_CONF_APP_LORA_TCXO); |
mbed_official | 2:dc95ac6d6d4e | 49 | |
mbed_official | 2:dc95ac6d6d4e | 50 | #elif (MBED_CONF_APP_LORA_RADIO == SX1276) |
mbed_official | 2:dc95ac6d6d4e | 51 | |
mbed_official | 2:dc95ac6d6d4e | 52 | SX1276_LoRaRadio radio(MBED_CONF_APP_LORA_SPI_MOSI, |
mbed_official | 2:dc95ac6d6d4e | 53 | MBED_CONF_APP_LORA_SPI_MISO, |
mbed_official | 2:dc95ac6d6d4e | 54 | MBED_CONF_APP_LORA_SPI_SCLK, |
mbed_official | 2:dc95ac6d6d4e | 55 | MBED_CONF_APP_LORA_CS, |
mbed_official | 2:dc95ac6d6d4e | 56 | MBED_CONF_APP_LORA_RESET, |
mbed_official | 2:dc95ac6d6d4e | 57 | MBED_CONF_APP_LORA_DIO0, |
mbed_official | 2:dc95ac6d6d4e | 58 | MBED_CONF_APP_LORA_DIO1, |
mbed_official | 2:dc95ac6d6d4e | 59 | MBED_CONF_APP_LORA_DIO2, |
mbed_official | 2:dc95ac6d6d4e | 60 | MBED_CONF_APP_LORA_DIO3, |
mbed_official | 2:dc95ac6d6d4e | 61 | MBED_CONF_APP_LORA_DIO4, |
mbed_official | 2:dc95ac6d6d4e | 62 | MBED_CONF_APP_LORA_DIO5, |
mbed_official | 2:dc95ac6d6d4e | 63 | MBED_CONF_APP_LORA_RF_SWITCH_CTL1, |
mbed_official | 2:dc95ac6d6d4e | 64 | MBED_CONF_APP_LORA_RF_SWITCH_CTL2, |
mbed_official | 2:dc95ac6d6d4e | 65 | MBED_CONF_APP_LORA_TXCTL, |
mbed_official | 2:dc95ac6d6d4e | 66 | MBED_CONF_APP_LORA_RXCTL, |
mbed_official | 2:dc95ac6d6d4e | 67 | MBED_CONF_APP_LORA_ANT_SWITCH, |
mbed_official | 2:dc95ac6d6d4e | 68 | MBED_CONF_APP_LORA_PWR_AMP_CTL, |
mbed_official | 2:dc95ac6d6d4e | 69 | MBED_CONF_APP_LORA_TCXO); |
mbed_official | 2:dc95ac6d6d4e | 70 | |
mbed_official | 2:dc95ac6d6d4e | 71 | #else |
mbed_official | 2:dc95ac6d6d4e | 72 | #error "Unknown LoRa radio specified (SX1272,SX1276 are valid)" |
mbed_official | 2:dc95ac6d6d4e | 73 | #endif |
mbed_official | 0:7037ed05f54f | 74 | |
mbed_official | 0:7037ed05f54f | 75 | #endif /* APP_LORA_RADIO_HELPER_H_ */ |