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.cpp@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 | #include "mbed.h" |
mluis | 0:45496a70a8a5 | 16 | #include "board.h" |
mluis | 0:45496a70a8a5 | 17 | |
shaunkrnelson | 8:a35d5c979745 | 18 | #ifdef USE_SX1276 |
shaunkrnelson | 8:a35d5c979745 | 19 | #warning board.cpp USE_SX1276 |
shaunkrnelson | 8:a35d5c979745 | 20 | SX1276MB1xAS Radio( NULL ); |
shaunkrnelson | 8:a35d5c979745 | 21 | #else |
mluis | 1:263aa4ff29cd | 22 | SX1272MB2xAS Radio( NULL ); |
shaunkrnelson | 8:a35d5c979745 | 23 | #endif |
mluis | 0:45496a70a8a5 | 24 | |
mluis | 7:5077515c163b | 25 | /*! |
mluis | 7:5077515c163b | 26 | * Nested interrupt counter. |
mluis | 7:5077515c163b | 27 | * |
mluis | 7:5077515c163b | 28 | * \remark Interrupt should only be fully disabled once the value is 0 |
mluis | 7:5077515c163b | 29 | */ |
mluis | 7:5077515c163b | 30 | static uint8_t IrqNestLevel = 0; |
mluis | 7:5077515c163b | 31 | |
mluis | 7:5077515c163b | 32 | void BoardDisableIrq( void ) |
mluis | 7:5077515c163b | 33 | { |
mluis | 7:5077515c163b | 34 | __disable_irq( ); |
mluis | 7:5077515c163b | 35 | IrqNestLevel++; |
mluis | 7:5077515c163b | 36 | } |
mluis | 7:5077515c163b | 37 | |
mluis | 7:5077515c163b | 38 | void BoardEnableIrq( void ) |
mluis | 7:5077515c163b | 39 | { |
mluis | 7:5077515c163b | 40 | IrqNestLevel--; |
mluis | 7:5077515c163b | 41 | if( IrqNestLevel == 0 ) |
mluis | 7:5077515c163b | 42 | { |
mluis | 7:5077515c163b | 43 | __enable_irq( ); |
mluis | 7:5077515c163b | 44 | } |
mluis | 7:5077515c163b | 45 | } |
mluis | 7:5077515c163b | 46 | |
mluis | 0:45496a70a8a5 | 47 | void BoardInit( void ) |
mluis | 0:45496a70a8a5 | 48 | { |
mluis | 0:45496a70a8a5 | 49 | TimerTimeCounterInit( ); |
mluis | 0:45496a70a8a5 | 50 | } |
mluis | 0:45496a70a8a5 | 51 | |
mluis | 0:45496a70a8a5 | 52 | |
mluis | 0:45496a70a8a5 | 53 | uint8_t BoardGetBatteryLevel( void ) |
mluis | 0:45496a70a8a5 | 54 | { |
mluis | 0:45496a70a8a5 | 55 | return 0xFE; |
mluis | 0:45496a70a8a5 | 56 | } |