DISCO-L072CZ-LRWAN1-base
Dependencies: BufferedSerial LoRaWAN-lib-st-murata ST-DEVKIT-LRWAN mbed
Diff: board/board.cpp
- Revision:
- 0:60680ad16314
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/board/board.cpp Mon Dec 04 14:21:37 2017 +0000 @@ -0,0 +1,56 @@ +/* + / _____) _ | | +( (____ _____ ____ _| |_ _____ ____| |__ + \____ \| ___ | (_ _) ___ |/ ___) _ \ + _____) ) ____| | | || |_| ____( (___| | | | +(______/|_____)_|_|_| \__)_____)\____)_| |_| + (C)2015 Semtech + +Description: Target board general functions implementation + +License: Revised BSD License, see LICENSE.TXT file include in the project + +Maintainer: Miguel Luis and Gregory Cristian +*/ +#include "mbed.h" +#include "PinMap.h" +#include "board.h" + +//SX1276MB1xAS Radio( NULL ); +SX1276Generic Radio(NULL, MURATA_SX1276, + LORA_SPI_MOSI, LORA_SPI_MISO, LORA_SPI_SCLK, LORA_CS, LORA_RESET, + LORA_DIO0, LORA_DIO1, LORA_DIO2, LORA_DIO3, LORA_DIO4, LORA_DIO5, + LORA_ANT_RX, LORA_ANT_TX, LORA_ANT_BOOST, LORA_TCXO); + +/*! + * Nested interrupt counter. + * + * \remark Interrupt should only be fully disabled once the value is 0 + */ +static uint8_t IrqNestLevel = 0; + +void BoardDisableIrq( void ) +{ + __disable_irq( ); + IrqNestLevel++; +} + +void BoardEnableIrq( void ) +{ + IrqNestLevel--; + if( IrqNestLevel == 0 ) + { + __enable_irq( ); + } +} + +void BoardInit( void ) +{ + TimerTimeCounterInit( ); +} + + +uint8_t BoardGetBatteryLevel( void ) +{ + return 0xFE; +}