Semtech LoRaWAN-demo configured for 915MHz operation and multi-radio support (SX1276/SX1272)
Dependencies: mbed LoRaWAN-lib SX1272Lib SX1276Lib
Fork of LoRaWAN-demo-72 by
board/board.h@9:3811f426252c, 2017-06-28 (annotated)
- Committer:
- shaunkrnelson
- Date:
- Wed Jun 28 19:41:37 2017 +0000
- Revision:
- 9:3811f426252c
- Parent:
- 8:a35d5c979745
Set application dutycycle to 1 minute; Default to unconfirmed uplinks
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mluis | 0:45496a70a8a5 | 1 | /* |
mluis | 0:45496a70a8a5 | 2 | / _____) _ | | |
mluis | 0:45496a70a8a5 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
mluis | 0:45496a70a8a5 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
mluis | 0:45496a70a8a5 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
mluis | 0:45496a70a8a5 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
mluis | 0:45496a70a8a5 | 7 | (C)2015 Semtech |
mluis | 0:45496a70a8a5 | 8 | |
mluis | 0:45496a70a8a5 | 9 | Description: Target board general functions implementation |
mluis | 0:45496a70a8a5 | 10 | |
mluis | 0:45496a70a8a5 | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
mluis | 0:45496a70a8a5 | 12 | |
mluis | 0:45496a70a8a5 | 13 | Maintainer: Miguel Luis and Gregory Cristian |
mluis | 0:45496a70a8a5 | 14 | */ |
mluis | 0:45496a70a8a5 | 15 | #ifndef __BOARD_H__ |
mluis | 0:45496a70a8a5 | 16 | #define __BOARD_H__ |
mluis | 0:45496a70a8a5 | 17 | |
mluis | 0:45496a70a8a5 | 18 | #include "mbed.h" |
mluis | 0:45496a70a8a5 | 19 | #include "system/timer.h" |
mluis | 0:45496a70a8a5 | 20 | #include "debug.h" |
mluis | 0:45496a70a8a5 | 21 | #include "system/utilities.h" |
shaunkrnelson | 8:a35d5c979745 | 22 | |
shaunkrnelson | 8:a35d5c979745 | 23 | // Configure LoRaWAN for US (915MHz) |
shaunkrnelson | 8:a35d5c979745 | 24 | #define USE_BAND_915 |
shaunkrnelson | 8:a35d5c979745 | 25 | |
shaunkrnelson | 8:a35d5c979745 | 26 | // Uncomment if using SX1276 |
shaunkrnelson | 8:a35d5c979745 | 27 | //#define USE_SX1276 |
mluis | 0:45496a70a8a5 | 28 | |
shaunkrnelson | 8:a35d5c979745 | 29 | // Radio selection |
shaunkrnelson | 8:a35d5c979745 | 30 | #ifdef USE_SX1276 |
shaunkrnelson | 8:a35d5c979745 | 31 | #include "sx1276-hal.h" |
shaunkrnelson | 8:a35d5c979745 | 32 | extern SX1276MB1xAS Radio; |
shaunkrnelson | 8:a35d5c979745 | 33 | #else |
shaunkrnelson | 8:a35d5c979745 | 34 | #include "sx1272-hal.h" |
shaunkrnelson | 8:a35d5c979745 | 35 | extern SX1272MB2xAS Radio; |
shaunkrnelson | 8:a35d5c979745 | 36 | #endif |
mluis | 0:45496a70a8a5 | 37 | |
mluis | 0:45496a70a8a5 | 38 | |
mluis | 0:45496a70a8a5 | 39 | /*! |
mluis | 7:5077515c163b | 40 | * \brief Disable interrupts |
mluis | 7:5077515c163b | 41 | * |
mluis | 7:5077515c163b | 42 | * \remark IRQ nesting is managed |
mluis | 7:5077515c163b | 43 | */ |
mluis | 7:5077515c163b | 44 | void BoardDisableIrq( void ); |
mluis | 7:5077515c163b | 45 | |
mluis | 7:5077515c163b | 46 | /*! |
mluis | 7:5077515c163b | 47 | * \brief Enable interrupts |
mluis | 7:5077515c163b | 48 | * |
mluis | 7:5077515c163b | 49 | * \remark IRQ nesting is managed |
mluis | 7:5077515c163b | 50 | */ |
mluis | 7:5077515c163b | 51 | void BoardEnableIrq( void ); |
mluis | 7:5077515c163b | 52 | |
mluis | 7:5077515c163b | 53 | /*! |
mluis | 0:45496a70a8a5 | 54 | * \brief Initializes the target board peripherals. |
mluis | 0:45496a70a8a5 | 55 | */ |
mluis | 0:45496a70a8a5 | 56 | void BoardInit( void ); |
mluis | 0:45496a70a8a5 | 57 | |
mluis | 0:45496a70a8a5 | 58 | /*! |
mluis | 0:45496a70a8a5 | 59 | * \brief Measure the Battery level |
mluis | 0:45496a70a8a5 | 60 | * |
mluis | 0:45496a70a8a5 | 61 | * \retval value battery level ( 0: very low, 254: fully charged ) |
mluis | 0:45496a70a8a5 | 62 | */ |
mluis | 0:45496a70a8a5 | 63 | uint8_t BoardGetBatteryLevel( void ); |
mluis | 0:45496a70a8a5 | 64 | |
mluis | 0:45496a70a8a5 | 65 | #endif // __BOARD_H__ |