this is avaiable project
Fork of LoRaMacLib by
Diff: board/board.cpp
- Revision:
- 0:9be122c18509
- Child:
- 3:675d14219ad5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/board/board.cpp Wed Aug 12 14:08:29 2015 +0000 @@ -0,0 +1,72 @@ +/* + / _____) _ | | +( (____ _____ ____ _| |_ _____ ____| |__ + \____ \| ___ | (_ _) ___ |/ ___) _ \ + _____) ) ____| | | || |_| ____( (___| | | | +(______/|_____)_|_|_| \__)_____)\____)_| |_| + (C)2013 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 "board.h" +#include "NVIC_set_all_priorities.h" + +/*! + * Initializes the unused GPIO to a know status + */ +static void BoardUnusedIoInit( void ); + +/*! + * Flag to indicate if the MCU is Initialized + */ +static bool McuInitialized = false; + + + +void BoardInitPeriph( void ) +{ + +} + +void BoardInitMcu( void ) +{ + NVIC_set_all_irq_priorities( 4 ); + + // Disable Systick + SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; // Systick IRQ off + SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk; // Clear SysTick Exception pending flag + + TimerHwInit( ); +} + +void BoardDeInitMcu( void ) +{ + +} + +void BoardGetUniqueId( uint8_t *id ) +{ + id[0] = ( ( *( uint32_t* )ID1 )+ ( *( uint32_t* )ID3 ) ) >> 24; + id[1] = ( ( *( uint32_t* )ID1 )+ ( *( uint32_t* )ID3 ) ) >> 16; + id[2] = ( ( *( uint32_t* )ID1 )+ ( *( uint32_t* )ID3 ) ) >> 8; + id[3] = ( ( *( uint32_t* )ID1 )+ ( *( uint32_t* )ID3 ) ); + id[4] = ( ( *( uint32_t* )ID2 ) ) >> 24; + id[5] = ( ( *( uint32_t* )ID2 ) ) >> 16; + id[6] = ( ( *( uint32_t* )ID2 ) ) >> 8; + id[7] = ( ( *( uint32_t* )ID2 ) ); +} + +uint8_t BoardMeasureBatterieLevel( void ) +{ + return 0xFE; +} + +static void BoardUnusedIoInit( void ) +{ + +}