SX126xDevKit
Dependencies: mbed DmTftLibrary SX126xLib
Peripherals/Timers.h@3:c3ab10127815, 2019-01-07 (annotated)
- Committer:
- mantoine
- Date:
- Mon Jan 07 23:02:45 2019 +0100
- Revision:
- 3:c3ab10127815
- Parent:
- 0:e5420f1a8a1a
Updated erroneous path to SX126xLib library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GregCr | 0:e5420f1a8a1a | 1 | /* |
GregCr | 0:e5420f1a8a1a | 2 | ______ _ |
GregCr | 0:e5420f1a8a1a | 3 | / _____) _ | | |
GregCr | 0:e5420f1a8a1a | 4 | ( (____ _____ ____ _| |_ _____ ____| |__ |
GregCr | 0:e5420f1a8a1a | 5 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
GregCr | 0:e5420f1a8a1a | 6 | _____) ) ____| | | || |_| ____( (___| | | | |
GregCr | 0:e5420f1a8a1a | 7 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
GregCr | 0:e5420f1a8a1a | 8 | (C)2016 Semtech |
GregCr | 0:e5420f1a8a1a | 9 | |
GregCr | 0:e5420f1a8a1a | 10 | Description: Timers header |
GregCr | 0:e5420f1a8a1a | 11 | |
GregCr | 0:e5420f1a8a1a | 12 | Maintainer: Gregory Cristian & Gilbert Menth |
GregCr | 0:e5420f1a8a1a | 13 | */ |
GregCr | 0:e5420f1a8a1a | 14 | |
GregCr | 0:e5420f1a8a1a | 15 | #ifndef TIMERS_H |
GregCr | 0:e5420f1a8a1a | 16 | #define TIMERS_H |
GregCr | 0:e5420f1a8a1a | 17 | |
GregCr | 0:e5420f1a8a1a | 18 | |
GregCr | 0:e5420f1a8a1a | 19 | #define TIM_MSEC ( uint32_t )1 |
GregCr | 0:e5420f1a8a1a | 20 | #define TIM_SEC ( uint32_t )1000 |
GregCr | 0:e5420f1a8a1a | 21 | #define TIM_MIN ( uint32_t )60000 |
GregCr | 0:e5420f1a8a1a | 22 | #define TIM_HOUR ( uint32_t )3600000 |
GregCr | 0:e5420f1a8a1a | 23 | #define MAX_TIMER_VALUE ( TIM_MIN * 150 ) // maximum time for timer |
GregCr | 0:e5420f1a8a1a | 24 | |
GregCr | 0:e5420f1a8a1a | 25 | |
GregCr | 0:e5420f1a8a1a | 26 | /*! |
GregCr | 0:e5420f1a8a1a | 27 | * \brief Initialses the hardware and variables associated with the timers. |
GregCr | 0:e5420f1a8a1a | 28 | */ |
GregCr | 0:e5420f1a8a1a | 29 | void TimersInit( void ); |
GregCr | 0:e5420f1a8a1a | 30 | |
GregCr | 0:e5420f1a8a1a | 31 | /*! |
GregCr | 0:e5420f1a8a1a | 32 | * \brief Sets a timer to a specific value |
GregCr | 0:e5420f1a8a1a | 33 | * |
GregCr | 0:e5420f1a8a1a | 34 | * \param [in] *STimer Pointer to the timer value to be set. |
GregCr | 0:e5420f1a8a1a | 35 | * \param [in] TimeLength Value to set the timer to in milliseconds. |
GregCr | 0:e5420f1a8a1a | 36 | */ |
GregCr | 0:e5420f1a8a1a | 37 | void TimersSetTimer( uint32_t *sTimer, uint32_t timeLength ); |
GregCr | 0:e5420f1a8a1a | 38 | |
GregCr | 0:e5420f1a8a1a | 39 | /*! |
GregCr | 0:e5420f1a8a1a | 40 | * \brief Checks if a timer has expired. |
GregCr | 0:e5420f1a8a1a | 41 | * |
GregCr | 0:e5420f1a8a1a | 42 | * \param [in] *STimer Pointer to the timer value to be read. |
GregCr | 0:e5420f1a8a1a | 43 | * |
GregCr | 0:e5420f1a8a1a | 44 | * \retval Status Non zero if the timer has not expired and is still |
GregCr | 0:e5420f1a8a1a | 45 | * running. |
GregCr | 0:e5420f1a8a1a | 46 | */ |
GregCr | 0:e5420f1a8a1a | 47 | uint32_t TimersTimerHasExpired ( const uint32_t * sTimer ); |
GregCr | 0:e5420f1a8a1a | 48 | |
GregCr | 0:e5420f1a8a1a | 49 | /*! |
GregCr | 0:e5420f1a8a1a | 50 | * \brief Returns the value of the current time in milliseconds |
GregCr | 0:e5420f1a8a1a | 51 | * |
GregCr | 0:e5420f1a8a1a | 52 | * \param [in] refresh Flag indicates refresh display required (touch) |
GregCr | 0:e5420f1a8a1a | 53 | * |
GregCr | 0:e5420f1a8a1a | 54 | * \retval Value value of current time in milliseconds |
GregCr | 0:e5420f1a8a1a | 55 | */ |
GregCr | 0:e5420f1a8a1a | 56 | uint32_t TimersTimerValue ( void ); |
GregCr | 0:e5420f1a8a1a | 57 | |
GregCr | 0:e5420f1a8a1a | 58 | #endif //TIMERS_H |