Bootcamp application example using LoRaWAN-lib MAC layer implementation. Provides an application example controlling a 3 color LED and a light sensor.
Dependencies: mbed Chainable_RGB_LED DigitDisplay LoRaWAN-lib SX1276Lib
For a detailed description of the LoRaWAN operations, please visit the MBED dedicated page at https://developer.mbed.org/teams/Semtech/code/LoRaWAN-demo-76/
board/board.cpp@5:d87bb1eabccd, 2017-04-24 (annotated)
- Committer:
- mluis
- Date:
- Mon Apr 24 13:40:32 2017 +0000
- Revision:
- 5:d87bb1eabccd
- Parent:
- 0:cb80564f40e1
WARNING: Radio API timings changed from micro-seconds to milliseconds; ; Synchronized with https://github.com/Lora-net/LoRaMac-node git revision e506c246652fa44c3f24cecb89d0707b49ece739; Updated all libraries to the latest versions
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mluis | 0:cb80564f40e1 | 1 | /* |
mluis | 0:cb80564f40e1 | 2 | / _____) _ | | |
mluis | 0:cb80564f40e1 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
mluis | 0:cb80564f40e1 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
mluis | 0:cb80564f40e1 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
mluis | 0:cb80564f40e1 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
mluis | 0:cb80564f40e1 | 7 | (C)2015 Semtech |
mluis | 0:cb80564f40e1 | 8 | |
mluis | 0:cb80564f40e1 | 9 | Description: Target board general functions implementation |
mluis | 0:cb80564f40e1 | 10 | |
mluis | 0:cb80564f40e1 | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
mluis | 0:cb80564f40e1 | 12 | |
mluis | 0:cb80564f40e1 | 13 | Maintainer: Miguel Luis and Gregory Cristian |
mluis | 0:cb80564f40e1 | 14 | */ |
mluis | 0:cb80564f40e1 | 15 | #include "mbed.h" |
mluis | 0:cb80564f40e1 | 16 | #include "board.h" |
mluis | 0:cb80564f40e1 | 17 | |
mluis | 0:cb80564f40e1 | 18 | SX1276MB1xAS Radio( NULL ); |
mluis | 0:cb80564f40e1 | 19 | |
mluis | 5:d87bb1eabccd | 20 | /*! |
mluis | 5:d87bb1eabccd | 21 | * Nested interrupt counter. |
mluis | 5:d87bb1eabccd | 22 | * |
mluis | 5:d87bb1eabccd | 23 | * \remark Interrupt should only be fully disabled once the value is 0 |
mluis | 5:d87bb1eabccd | 24 | */ |
mluis | 5:d87bb1eabccd | 25 | static uint8_t IrqNestLevel = 0; |
mluis | 5:d87bb1eabccd | 26 | |
mluis | 5:d87bb1eabccd | 27 | void BoardDisableIrq( void ) |
mluis | 5:d87bb1eabccd | 28 | { |
mluis | 5:d87bb1eabccd | 29 | __disable_irq( ); |
mluis | 5:d87bb1eabccd | 30 | IrqNestLevel++; |
mluis | 5:d87bb1eabccd | 31 | } |
mluis | 5:d87bb1eabccd | 32 | |
mluis | 5:d87bb1eabccd | 33 | void BoardEnableIrq( void ) |
mluis | 5:d87bb1eabccd | 34 | { |
mluis | 5:d87bb1eabccd | 35 | IrqNestLevel--; |
mluis | 5:d87bb1eabccd | 36 | if( IrqNestLevel == 0 ) |
mluis | 5:d87bb1eabccd | 37 | { |
mluis | 5:d87bb1eabccd | 38 | __enable_irq( ); |
mluis | 5:d87bb1eabccd | 39 | } |
mluis | 5:d87bb1eabccd | 40 | } |
mluis | 5:d87bb1eabccd | 41 | |
mluis | 0:cb80564f40e1 | 42 | void BoardInit( void ) |
mluis | 0:cb80564f40e1 | 43 | { |
mluis | 0:cb80564f40e1 | 44 | TimerTimeCounterInit( ); |
mluis | 0:cb80564f40e1 | 45 | } |
mluis | 0:cb80564f40e1 | 46 | |
mluis | 0:cb80564f40e1 | 47 | |
mluis | 0:cb80564f40e1 | 48 | uint8_t BoardGetBatteryLevel( void ) |
mluis | 0:cb80564f40e1 | 49 | { |
mluis | 0:cb80564f40e1 | 50 | return 0xFE; |
mluis | 0:cb80564f40e1 | 51 | } |