BLE_BlueNRG for Nucleo board
Dependents: Nucleo_BLE_HeartRate Nucleo_BLE_UART Nucleo_BLE_UART
Warning: Deprecated!
Supported drivers and applications can be found at this link.
platform/inc/gp_timer.h@2:905715088a9b, 2014-12-24 (annotated)
- Committer:
- sjallouli
- Date:
- Wed Dec 24 18:01:41 2014 +0000
- Revision:
- 2:905715088a9b
- Parent:
- 0:a948f5f3904c
Add USER_BUTTON interrupt configuration
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sjallouli | 0:a948f5f3904c | 1 | /******************** (C) COPYRIGHT 2012 STMicroelectronics ******************** |
sjallouli | 0:a948f5f3904c | 2 | * File Name : gp_timer.h |
sjallouli | 0:a948f5f3904c | 3 | * Author : AMS - HEA&RF BU |
sjallouli | 0:a948f5f3904c | 4 | * Version : V1.0.0 |
sjallouli | 0:a948f5f3904c | 5 | * Date : 19-July-2012 |
sjallouli | 0:a948f5f3904c | 6 | * Description : General purpose timer library. |
sjallouli | 0:a948f5f3904c | 7 | ******************************************************************************** |
sjallouli | 0:a948f5f3904c | 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
sjallouli | 0:a948f5f3904c | 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
sjallouli | 0:a948f5f3904c | 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
sjallouli | 0:a948f5f3904c | 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
sjallouli | 0:a948f5f3904c | 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
sjallouli | 0:a948f5f3904c | 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
sjallouli | 0:a948f5f3904c | 14 | *******************************************************************************/ |
sjallouli | 0:a948f5f3904c | 15 | |
sjallouli | 0:a948f5f3904c | 16 | #ifndef __GP_TIMER_H__ |
sjallouli | 0:a948f5f3904c | 17 | #define __GP_TIMER_H__ |
sjallouli | 0:a948f5f3904c | 18 | |
sjallouli | 0:a948f5f3904c | 19 | #include "clock.h" |
sjallouli | 0:a948f5f3904c | 20 | |
sjallouli | 0:a948f5f3904c | 21 | /** |
sjallouli | 0:a948f5f3904c | 22 | * timer |
sjallouli | 0:a948f5f3904c | 23 | * |
sjallouli | 0:a948f5f3904c | 24 | * A structure that represents a timer. Use Timer_Set() to set the timer. |
sjallouli | 0:a948f5f3904c | 25 | * |
sjallouli | 0:a948f5f3904c | 26 | */ |
sjallouli | 0:a948f5f3904c | 27 | struct timer { |
sjallouli | 0:a948f5f3904c | 28 | |
sjallouli | 0:a948f5f3904c | 29 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
sjallouli | 0:a948f5f3904c | 30 | |
sjallouli | 0:a948f5f3904c | 31 | tClockTime start; |
sjallouli | 0:a948f5f3904c | 32 | tClockTime interval; |
sjallouli | 0:a948f5f3904c | 33 | |
sjallouli | 0:a948f5f3904c | 34 | #endif |
sjallouli | 0:a948f5f3904c | 35 | }; |
sjallouli | 0:a948f5f3904c | 36 | |
sjallouli | 0:a948f5f3904c | 37 | |
sjallouli | 0:a948f5f3904c | 38 | /** |
sjallouli | 0:a948f5f3904c | 39 | * Timer_Set |
sjallouli | 0:a948f5f3904c | 40 | * |
sjallouli | 0:a948f5f3904c | 41 | * @param[in] t Pointer to a timer structure |
sjallouli | 0:a948f5f3904c | 42 | * @param[in] interval timeout value |
sjallouli | 0:a948f5f3904c | 43 | * |
sjallouli | 0:a948f5f3904c | 44 | * This function sets the timeout value of a timer. |
sjallouli | 0:a948f5f3904c | 45 | * |
sjallouli | 0:a948f5f3904c | 46 | */ |
sjallouli | 0:a948f5f3904c | 47 | void Timer_Set(struct timer *t, tClockTime interval); |
sjallouli | 0:a948f5f3904c | 48 | |
sjallouli | 0:a948f5f3904c | 49 | /** |
sjallouli | 0:a948f5f3904c | 50 | * Timer_Reset |
sjallouli | 0:a948f5f3904c | 51 | * |
sjallouli | 0:a948f5f3904c | 52 | * @param[in] t Pointer to a timer structure |
sjallouli | 0:a948f5f3904c | 53 | * |
sjallouli | 0:a948f5f3904c | 54 | * This function resets the timer with the same interval given |
sjallouli | 0:a948f5f3904c | 55 | * with Timer_Set, starting from the time it previously expired. |
sjallouli | 0:a948f5f3904c | 56 | * |
sjallouli | 0:a948f5f3904c | 57 | */ |
sjallouli | 0:a948f5f3904c | 58 | void Timer_Reset(struct timer *t); |
sjallouli | 0:a948f5f3904c | 59 | |
sjallouli | 0:a948f5f3904c | 60 | /** |
sjallouli | 0:a948f5f3904c | 61 | * Timer_Restart |
sjallouli | 0:a948f5f3904c | 62 | * |
sjallouli | 0:a948f5f3904c | 63 | * @param[in] t Pointer to a timer structure |
sjallouli | 0:a948f5f3904c | 64 | * |
sjallouli | 0:a948f5f3904c | 65 | * This function resets the timer with the same interval given |
sjallouli | 0:a948f5f3904c | 66 | * with Timer_Set, starting from the current time. |
sjallouli | 0:a948f5f3904c | 67 | * |
sjallouli | 0:a948f5f3904c | 68 | */ |
sjallouli | 0:a948f5f3904c | 69 | void Timer_Restart(struct timer *t); |
sjallouli | 0:a948f5f3904c | 70 | |
sjallouli | 0:a948f5f3904c | 71 | /** |
sjallouli | 0:a948f5f3904c | 72 | * Timer_Expired |
sjallouli | 0:a948f5f3904c | 73 | * |
sjallouli | 0:a948f5f3904c | 74 | * @param[in] t Pointer to a timer structure |
sjallouli | 0:a948f5f3904c | 75 | * |
sjallouli | 0:a948f5f3904c | 76 | * This function returns TRUE if timer is expired, FALSE otherwise. |
sjallouli | 0:a948f5f3904c | 77 | * |
sjallouli | 0:a948f5f3904c | 78 | */ |
sjallouli | 0:a948f5f3904c | 79 | int Timer_Expired(struct timer *t); |
sjallouli | 0:a948f5f3904c | 80 | |
sjallouli | 0:a948f5f3904c | 81 | /** |
sjallouli | 0:a948f5f3904c | 82 | * Timer_Expired |
sjallouli | 0:a948f5f3904c | 83 | * |
sjallouli | 0:a948f5f3904c | 84 | * @param[in] t Pointer to a timer structure |
sjallouli | 0:a948f5f3904c | 85 | * |
sjallouli | 0:a948f5f3904c | 86 | * This function returns the time needed for expiration. |
sjallouli | 0:a948f5f3904c | 87 | * |
sjallouli | 0:a948f5f3904c | 88 | * @return Time before timer's expiration. |
sjallouli | 0:a948f5f3904c | 89 | */ |
sjallouli | 0:a948f5f3904c | 90 | tClockTime Timer_Remaining(struct timer *t); |
sjallouli | 0:a948f5f3904c | 91 | |
sjallouli | 0:a948f5f3904c | 92 | #endif /* __GP_TIMER_H__ */ |
sjallouli | 0:a948f5f3904c | 93 | |
sjallouli | 0:a948f5f3904c | 94 |