| BlueNRG-1 HAL drivers APIs

- Main Page
- Classes
- Files

- File List
- File Members

Classes | Functions
gp_timer.h File Reference

Header file for general purpose timer library. More...

`#include "clock.h"`

Go to the source code of this file.

## Classes

struct | timer
| A structure that represents a timer. Use Timer_Set() to set the timer. More...

## Functions

void | Timer_Set (struct timer *t, tClockTime interval)
| This function sets a timer for a time sometime in the future. The function timer_expired() will evaluate to true after the timer has expired. More...
void | Timer_Reset (struct timer *t)
| This function resets the timer with the same interval that was given to the timer_set() function. The start point of the interval is the exact time that the timer last expired. Therefore, this function will cause the timer to be stable over time, unlike the timer_restart() function. More...
void | Timer_Restart (struct timer *t)
| This function restarts a timer with the same interval that was given to the timer_set() function. The timer will start at the current time. A periodic timer will drift if this function is used to reset it. For preioric timers, use the timer_reset() function instead. More...
int | Timer_Expired (struct timer *t)
| This function tests if a timer has expired and returns true or false depending on its status. More...
tClockTime | Timer_Remaining (struct timer *t)
| This function returns the time until the timer expires. More...

## Detailed Description

Header file for general purpose timer library.

Author
  AMS - VMA RF Application team

Version
  V1.0.0

Date
  21-Sept-2015

Attention

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

##
© COPYRIGHT 2015 STMicroelectronics

Definition in file gp_timer.h.

## Function Documentation

int Timer_Expired | ( | struct timer * | t | ) |

This function tests if a timer has expired and returns true or false depending on its status.

Parameters

  [in] | t | Pointer to a timer structure

Return values

  Non-zero | if the timer has expired, zero otherwise.

tClockTime Timer_Remaining | ( | struct timer * | t | ) |

This function returns the time until the timer expires.

Parameters

  [in] | t | Pointer to a timer structure

Return values

  The | time until the timer expires

void Timer_Reset | ( | struct timer * | t | ) |

This function resets the timer with the same interval that was given to the timer_set() function. The start point of the interval is the exact time that the timer last expired. Therefore, this function will cause the timer to be stable over time, unlike the timer_restart() function.

Parameters

  [in] | t | Pointer to a timer structure

Return values

  None |

void Timer_Restart | ( | struct timer * | t | ) |

This function restarts a timer with the same interval that was given to the timer_set() function. The timer will start at the current time. A periodic timer will drift if this function is used to reset it. For preioric timers, use the timer_reset() function instead.

Parameters

  [in] | t | Pointer to a timer structure

Return values

  None |

void Timer_Set | ( | struct timer * | t,
|  | tClockTime | interval
| ) |  |

This function sets a timer for a time sometime in the future. The function timer_expired() will evaluate to true after the timer has expired.

Parameters

  [in] | t | Pointer to a timer structure
  [in] | interval | The interval before the timer expires.

Return values

  None |