Ivano Calabrese / Mbed 2 deprecated DISCO-L072CZ-LRWAN1-base

Dependencies:   BufferedSerial LoRaWAN-lib-st-murata ST-DEVKIT-LRWAN mbed

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 "PinMap.h"
00017 #include "board.h"
00018 
00019 //SX1276MB1xAS Radio( NULL );
00020 SX1276Generic Radio(NULL, MURATA_SX1276,
00021             LORA_SPI_MOSI, LORA_SPI_MISO, LORA_SPI_SCLK, LORA_CS, LORA_RESET,
00022             LORA_DIO0, LORA_DIO1, LORA_DIO2, LORA_DIO3, LORA_DIO4, LORA_DIO5,
00023             LORA_ANT_RX, LORA_ANT_TX, LORA_ANT_BOOST, LORA_TCXO);
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 }