libamxp  1.4.0
Patterns C Implementation
amxp_timer.h File Reference

Ambiorix timer API header file. More...

#include <sys/time.h>

Go to the source code of this file.

Data Structures

struct  _amxp_timer
 The timer type. More...
 

Typedefs

typedef struct _amxp_timer amxp_timer_t
 
typedef void(* amxp_timer_cb_t) (amxp_timer_t *timer, void *priv)
 Timer timeout callback function. More...
 
typedef enum _amxp_timer_state amxp_timer_state_t
 The timer states. More...
 

Enumerations

enum  _amxp_timer_state {
  amxp_timer_off , amxp_timer_started , amxp_timer_running , amxp_timer_expired ,
  amxp_timer_deleted
}
 The timer states. More...
 

Functions

void amxp_timers_calculate (void)
 Caclulates the remaining time of all timers. More...
 
void amxp_timers_check (void)
 Check all timers and call the callback function when the timer is in Timer expired state. More...
 
void amxp_timers_enable (bool enable)
 Enable or disable all timers. More...
 
int amxp_timer_new (amxp_timer_t **timer, amxp_timer_cb_t cb, void *priv)
 Allocate and initializes a new timer. More...
 
void amxp_timer_delete (amxp_timer_t **timer)
 Deletes a timer. More...
 
int amxp_timer_set_interval (amxp_timer_t *timer, unsigned int msec)
 Sets the interval of a timer in milli seconds. More...
 
unsigned int amxp_timer_remaining_time (amxp_timer_t *timer)
 Get the remaining time of the timer. More...
 
int amxp_timer_start (amxp_timer_t *timer, unsigned int timeout_msec)
 Starts or resets a timer. More...
 
int amxp_timer_stop (amxp_timer_t *timer)
 Stops the timer. More...
 
amxp_timer_state_t amxp_timer_get_state (amxp_timer_t *timer)
 Get the timer's state. More...
 

Detailed Description

Ambiorix timer API header file.

Definition in file amxp_timer.h.

Typedef Documentation

◆ amxp_timer_t

typedef struct _amxp_timer amxp_timer_t

Definition at line 1 of file amxp_timer.h.