Application example using LoRaWAN-lib MAC layer implementation

Dependencies:   mbed LoRaWAN-lib SX1276Lib

Dependents:   LoRaWAN-mbed-client-ttn0

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 SX1276MB1xAS Radio( NULL );
00019 
00020 /*!
00021  * Nested interrupt counter.
00022  *
00023  * \remark Interrupt should only be fully disabled once the value is 0
00024  */
00025 static uint8_t IrqNestLevel = 0;
00026 
00027 void BoardDisableIrq( void )
00028 {
00029     __disable_irq( );
00030     IrqNestLevel++;
00031 }
00032 
00033 void BoardEnableIrq( void )
00034 {
00035     IrqNestLevel--;
00036     if( IrqNestLevel == 0 )
00037     {
00038         __enable_irq( );
00039     }
00040 }
00041 
00042 void BoardInit( void )
00043 {
00044     TimerTimeCounterInit( );
00045 }
00046 
00047 
00048 uint8_t BoardGetBatteryLevel( void ) 
00049 {
00050     return 0xFE;
00051 }