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