Slave program for ranging, open for improvements

Dependencies:   SX1280Lib mbed

Committer:
LuisRuiz
Date:
Mon Apr 23 22:08:14 2018 +0000
Revision:
0:871af6563674
Ranging Slave for SX1280

Who changed what in which revision?

UserRevisionLine numberNew contents of line
LuisRuiz 0:871af6563674 1 /*
LuisRuiz 0:871af6563674 2 ______ _
LuisRuiz 0:871af6563674 3 / _____) _ | |
LuisRuiz 0:871af6563674 4 ( (____ _____ ____ _| |_ _____ ____| |__
LuisRuiz 0:871af6563674 5 \____ \| ___ | (_ _) ___ |/ ___) _ \
LuisRuiz 0:871af6563674 6 _____) ) ____| | | || |_| ____( (___| | | |
LuisRuiz 0:871af6563674 7 (______/|_____)_|_|_| \__)_____)\____)_| |_|
LuisRuiz 0:871af6563674 8 (C)2016 Semtech
LuisRuiz 0:871af6563674 9
LuisRuiz 0:871af6563674 10 Description: Timers header
LuisRuiz 0:871af6563674 11
LuisRuiz 0:871af6563674 12 Maintainer: Gregory Cristian & Gilbert Menth
LuisRuiz 0:871af6563674 13 */
LuisRuiz 0:871af6563674 14
LuisRuiz 0:871af6563674 15 #ifndef TIMERS_H
LuisRuiz 0:871af6563674 16 #define TIMERS_H
LuisRuiz 0:871af6563674 17
LuisRuiz 0:871af6563674 18
LuisRuiz 0:871af6563674 19 #define TIM_MSEC ( uint32_t )1
LuisRuiz 0:871af6563674 20 #define TIM_SEC ( uint32_t )1000
LuisRuiz 0:871af6563674 21 #define TIM_MIN ( uint32_t )60000
LuisRuiz 0:871af6563674 22 #define TIM_HOUR ( uint32_t )3600000
LuisRuiz 0:871af6563674 23 #define MAX_TIMER_VALUE ( TIM_MIN * 150 ) // maximum time for timer
LuisRuiz 0:871af6563674 24
LuisRuiz 0:871af6563674 25
LuisRuiz 0:871af6563674 26 /*!
LuisRuiz 0:871af6563674 27 * \brief Initialses the hardware and variables associated with the timers.
LuisRuiz 0:871af6563674 28 */
LuisRuiz 0:871af6563674 29 void TimersInit( void );
LuisRuiz 0:871af6563674 30
LuisRuiz 0:871af6563674 31 /*!
LuisRuiz 0:871af6563674 32 * \brief Sets a timer to a specific value
LuisRuiz 0:871af6563674 33 *
LuisRuiz 0:871af6563674 34 * \param [in] *STimer Pointer to the timer value to be set.
LuisRuiz 0:871af6563674 35 * \param [in] TimeLength Value to set the timer to in milliseconds.
LuisRuiz 0:871af6563674 36 */
LuisRuiz 0:871af6563674 37 void TimersSetTimer( uint32_t *sTimer, uint32_t timeLength );
LuisRuiz 0:871af6563674 38
LuisRuiz 0:871af6563674 39 /*!
LuisRuiz 0:871af6563674 40 * \brief Checks if a timer has expired.
LuisRuiz 0:871af6563674 41 *
LuisRuiz 0:871af6563674 42 * \param [in] *STimer Pointer to the timer value to be read.
LuisRuiz 0:871af6563674 43 *
LuisRuiz 0:871af6563674 44 * \retval Status Non zero if the timer has not expired and is still
LuisRuiz 0:871af6563674 45 * running.
LuisRuiz 0:871af6563674 46 */
LuisRuiz 0:871af6563674 47 uint32_t TimersTimerHasExpired ( const uint32_t * sTimer );
LuisRuiz 0:871af6563674 48
LuisRuiz 0:871af6563674 49 /*!
LuisRuiz 0:871af6563674 50 * \brief Returns the value of the current time in milliseconds
LuisRuiz 0:871af6563674 51 *
LuisRuiz 0:871af6563674 52 * \param [in] refresh Flag indicates refresh display required (touch)
LuisRuiz 0:871af6563674 53 *
LuisRuiz 0:871af6563674 54 * \retval Value value of current time in milliseconds
LuisRuiz 0:871af6563674 55 */
LuisRuiz 0:871af6563674 56 uint32_t TimersTimerValue ( void );
LuisRuiz 0:871af6563674 57
LuisRuiz 0:871af6563674 58 #endif //TIMERS_H