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 Semtech

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers board.cpp Source File

board.cpp

00001 /*
00002  / _____)             _              | |
00003 ( (____  _____ ____ _| |_ _____  ____| |__
00004  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00005  _____) ) ____| | | || |_| ____( (___| | | |
00006 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00007     (C)2015 Semtech
00008 
00009 Description: Target board general functions implementation
00010 
00011 License: Revised BSD License, see LICENSE.TXT file include in the project
00012 
00013 Maintainer: Miguel Luis and Gregory Cristian
00014 */
00015 #include "mbed.h"
00016 #include "board.h"
00017 
00018 #ifdef USE_SX1276
00019 #warning board.cpp USE_SX1276
00020 SX1276MB1xAS Radio( NULL );
00021 #else
00022 SX1272MB2xAS Radio( NULL );
00023 #endif
00024 
00025 /*!
00026  * Nested interrupt counter.
00027  *
00028  * \remark Interrupt should only be fully disabled once the value is 0
00029  */
00030 static uint8_t IrqNestLevel = 0;
00031 
00032 void BoardDisableIrq( void )
00033 {
00034     __disable_irq( );
00035     IrqNestLevel++;
00036 }
00037 
00038 void BoardEnableIrq( void )
00039 {
00040     IrqNestLevel--;
00041     if( IrqNestLevel == 0 )
00042     {
00043         __enable_irq( );
00044     }
00045 }
00046 
00047 void BoardInit( void )
00048 {
00049     TimerTimeCounterInit( );
00050 }
00051 
00052 
00053 uint8_t BoardGetBatteryLevel( void ) 
00054 {
00055     return 0xFE;
00056 }