DISCO-L072CZ-LRWAN1-base
Dependencies: BufferedSerial LoRaWAN-lib-st-murata ST-DEVKIT-LRWAN mbed
board/board.cpp@0:60680ad16314, 2017-12-04 (annotated)
- Committer:
- alphaemmeo
- Date:
- Mon Dec 04 14:21:37 2017 +0000
- Revision:
- 0:60680ad16314
base test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alphaemmeo | 0:60680ad16314 | 1 | /* |
alphaemmeo | 0:60680ad16314 | 2 | / _____) _ | | |
alphaemmeo | 0:60680ad16314 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
alphaemmeo | 0:60680ad16314 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
alphaemmeo | 0:60680ad16314 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
alphaemmeo | 0:60680ad16314 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
alphaemmeo | 0:60680ad16314 | 7 | (C)2015 Semtech |
alphaemmeo | 0:60680ad16314 | 8 | |
alphaemmeo | 0:60680ad16314 | 9 | Description: Target board general functions implementation |
alphaemmeo | 0:60680ad16314 | 10 | |
alphaemmeo | 0:60680ad16314 | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
alphaemmeo | 0:60680ad16314 | 12 | |
alphaemmeo | 0:60680ad16314 | 13 | Maintainer: Miguel Luis and Gregory Cristian |
alphaemmeo | 0:60680ad16314 | 14 | */ |
alphaemmeo | 0:60680ad16314 | 15 | #include "mbed.h" |
alphaemmeo | 0:60680ad16314 | 16 | #include "PinMap.h" |
alphaemmeo | 0:60680ad16314 | 17 | #include "board.h" |
alphaemmeo | 0:60680ad16314 | 18 | |
alphaemmeo | 0:60680ad16314 | 19 | //SX1276MB1xAS Radio( NULL ); |
alphaemmeo | 0:60680ad16314 | 20 | SX1276Generic Radio(NULL, MURATA_SX1276, |
alphaemmeo | 0:60680ad16314 | 21 | LORA_SPI_MOSI, LORA_SPI_MISO, LORA_SPI_SCLK, LORA_CS, LORA_RESET, |
alphaemmeo | 0:60680ad16314 | 22 | LORA_DIO0, LORA_DIO1, LORA_DIO2, LORA_DIO3, LORA_DIO4, LORA_DIO5, |
alphaemmeo | 0:60680ad16314 | 23 | LORA_ANT_RX, LORA_ANT_TX, LORA_ANT_BOOST, LORA_TCXO); |
alphaemmeo | 0:60680ad16314 | 24 | |
alphaemmeo | 0:60680ad16314 | 25 | /*! |
alphaemmeo | 0:60680ad16314 | 26 | * Nested interrupt counter. |
alphaemmeo | 0:60680ad16314 | 27 | * |
alphaemmeo | 0:60680ad16314 | 28 | * \remark Interrupt should only be fully disabled once the value is 0 |
alphaemmeo | 0:60680ad16314 | 29 | */ |
alphaemmeo | 0:60680ad16314 | 30 | static uint8_t IrqNestLevel = 0; |
alphaemmeo | 0:60680ad16314 | 31 | |
alphaemmeo | 0:60680ad16314 | 32 | void BoardDisableIrq( void ) |
alphaemmeo | 0:60680ad16314 | 33 | { |
alphaemmeo | 0:60680ad16314 | 34 | __disable_irq( ); |
alphaemmeo | 0:60680ad16314 | 35 | IrqNestLevel++; |
alphaemmeo | 0:60680ad16314 | 36 | } |
alphaemmeo | 0:60680ad16314 | 37 | |
alphaemmeo | 0:60680ad16314 | 38 | void BoardEnableIrq( void ) |
alphaemmeo | 0:60680ad16314 | 39 | { |
alphaemmeo | 0:60680ad16314 | 40 | IrqNestLevel--; |
alphaemmeo | 0:60680ad16314 | 41 | if( IrqNestLevel == 0 ) |
alphaemmeo | 0:60680ad16314 | 42 | { |
alphaemmeo | 0:60680ad16314 | 43 | __enable_irq( ); |
alphaemmeo | 0:60680ad16314 | 44 | } |
alphaemmeo | 0:60680ad16314 | 45 | } |
alphaemmeo | 0:60680ad16314 | 46 | |
alphaemmeo | 0:60680ad16314 | 47 | void BoardInit( void ) |
alphaemmeo | 0:60680ad16314 | 48 | { |
alphaemmeo | 0:60680ad16314 | 49 | TimerTimeCounterInit( ); |
alphaemmeo | 0:60680ad16314 | 50 | } |
alphaemmeo | 0:60680ad16314 | 51 | |
alphaemmeo | 0:60680ad16314 | 52 | |
alphaemmeo | 0:60680ad16314 | 53 | uint8_t BoardGetBatteryLevel( void ) |
alphaemmeo | 0:60680ad16314 | 54 | { |
alphaemmeo | 0:60680ad16314 | 55 | return 0xFE; |
alphaemmeo | 0:60680ad16314 | 56 | } |