this is avaiable project

Dependents:   LoRaWAN_MBED

Fork of LoRaMacLib by LoRa All

Committer:
GregCr
Date:
Wed Aug 12 14:08:29 2015 +0000
Revision:
0:9be122c18509
First Implementation

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregCr 0:9be122c18509 1 /*
GregCr 0:9be122c18509 2 / _____) _ | |
GregCr 0:9be122c18509 3 ( (____ _____ ____ _| |_ _____ ____| |__
GregCr 0:9be122c18509 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
GregCr 0:9be122c18509 5 _____) ) ____| | | || |_| ____( (___| | | |
GregCr 0:9be122c18509 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
GregCr 0:9be122c18509 7 (C)2013 Semtech
GregCr 0:9be122c18509 8
GregCr 0:9be122c18509 9 Description: Target board general functions implementation
GregCr 0:9be122c18509 10
GregCr 0:9be122c18509 11 License: Revised BSD License, see LICENSE.TXT file include in the project
GregCr 0:9be122c18509 12
GregCr 0:9be122c18509 13 Maintainer: Miguel Luis and Gregory Cristian
GregCr 0:9be122c18509 14 */
GregCr 0:9be122c18509 15 #ifndef __BOARD_H__
GregCr 0:9be122c18509 16 #define __BOARD_H__
GregCr 0:9be122c18509 17
GregCr 0:9be122c18509 18 #include "mbed.h"
GregCr 0:9be122c18509 19 #include "timer.h"
GregCr 0:9be122c18509 20 #include "debug.h"
GregCr 0:9be122c18509 21
GregCr 0:9be122c18509 22 /*!
GregCr 0:9be122c18509 23 * NULL definition
GregCr 0:9be122c18509 24 */
GregCr 0:9be122c18509 25 #ifndef NULL
GregCr 0:9be122c18509 26 #define NULL ( ( void * )0 )
GregCr 0:9be122c18509 27 #endif
GregCr 0:9be122c18509 28
GregCr 0:9be122c18509 29 /*!
GregCr 0:9be122c18509 30 * Generic definition
GregCr 0:9be122c18509 31 */
GregCr 0:9be122c18509 32 #ifndef SUCCESS
GregCr 0:9be122c18509 33 #define SUCCESS 1
GregCr 0:9be122c18509 34 #endif
GregCr 0:9be122c18509 35
GregCr 0:9be122c18509 36 #ifndef FAIL
GregCr 0:9be122c18509 37 #define FAIL 0
GregCr 0:9be122c18509 38 #endif
GregCr 0:9be122c18509 39
GregCr 0:9be122c18509 40 /*!
GregCr 0:9be122c18509 41 * Unique Devices IDs register set ( STM32L1xxx )
GregCr 0:9be122c18509 42 */
GregCr 0:9be122c18509 43 #define ID1 ( 0x1FF80050 )
GregCr 0:9be122c18509 44 #define ID2 ( 0x1FF80054 )
GregCr 0:9be122c18509 45 #define ID3 ( 0x1FF80064 )
GregCr 0:9be122c18509 46
GregCr 0:9be122c18509 47 /*!
GregCr 0:9be122c18509 48 * Random seed generated using the MCU Unique ID
GregCr 0:9be122c18509 49 */
GregCr 0:9be122c18509 50 #define RAND_SEED ( ( *( uint32_t* )ID1 ) ^ \
GregCr 0:9be122c18509 51 ( *( uint32_t* )ID2 ) ^ \
GregCr 0:9be122c18509 52 ( *( uint32_t* )ID3 ) )
GregCr 0:9be122c18509 53
GregCr 0:9be122c18509 54 /*!
GregCr 0:9be122c18509 55 * \brief Initializes the target board peripherals.
GregCr 0:9be122c18509 56 */
GregCr 0:9be122c18509 57 void BoardInitMcu( void );
GregCr 0:9be122c18509 58
GregCr 0:9be122c18509 59 /*!
GregCr 0:9be122c18509 60 * \brief Initializes the boards peripherals.
GregCr 0:9be122c18509 61 */
GregCr 0:9be122c18509 62 void BoardInitPeriph( void );
GregCr 0:9be122c18509 63
GregCr 0:9be122c18509 64 /*!
GregCr 0:9be122c18509 65 * \brief De-initializes the target board peripherals to decrease power
GregCr 0:9be122c18509 66 * consumption.
GregCr 0:9be122c18509 67 */
GregCr 0:9be122c18509 68 void BoardDeInitMcu( void );
GregCr 0:9be122c18509 69
GregCr 0:9be122c18509 70 /*!
GregCr 0:9be122c18509 71 * \brief Measure the Battery level
GregCr 0:9be122c18509 72 *
GregCr 0:9be122c18509 73 * \retval value battery level ( 0: very low, 254: fully charged )
GregCr 0:9be122c18509 74 */
GregCr 0:9be122c18509 75 uint8_t BoardMeasureBatterieLevel( void );
GregCr 0:9be122c18509 76
GregCr 0:9be122c18509 77 /*!
GregCr 0:9be122c18509 78 * \brief Gets the board 64 bits unique ID
GregCr 0:9be122c18509 79 *
GregCr 0:9be122c18509 80 * \param [IN] id Pointer to an array that will contain the Unique ID
GregCr 0:9be122c18509 81 */
GregCr 0:9be122c18509 82 void BoardGetUniqueId( uint8_t *id );
GregCr 0:9be122c18509 83
GregCr 0:9be122c18509 84
GregCr 0:9be122c18509 85 #endif // __BOARD_H__