SysIo  1.9.0
Embedded Library and tools
timer.h
1 
9 #ifndef _SYSIO_TIMER_H_
10 #define _SYSIO_TIMER_H_
11 #include <sysio/defs.h>
12 #ifdef __cplusplus
13  extern "C" {
14 #endif
15 /* ========================================================================== */
16 
24 /* structures =============================================================== */
25 
26 struct xTimer;
27 
32 typedef struct xTimer xTimer;
33 
46 typedef int (*iTimerCallback) (xTimer * tm);
47 
48 /* internal public functions ================================================ */
49 
54 xTimer * xTimerNew (void);
55 
61 int iTimerDelete (xTimer * tm);
62 
68 int iTimerStart (xTimer * tm);
69 
75 int iTimerStop (xTimer * tm);
76 
82 void vTimerSetInterval (xTimer * tm, long msec);
83 
89 long lTimerInterval (const xTimer * tm);
90 
96 bool bTimerIsSingleShot (const xTimer * tm);
97 
103 void vTimerSetSingleShot (xTimer * tm, bool singleShot);
104 
110 bool bTimerIsActive (const xTimer * tm);
111 
117 bool bTimerIsTimeout (xTimer * tm);
118 
124 int iTimerWait(xTimer * tm);
125 
136 long lTimerRemainingTime (const xTimer * tm);
137 
147 int iTimerSetCallback (xTimer * tm, iTimerCallback callback, void * udata);
148 
154 int iTimerUnsetCallback (xTimer * tm);
155 
161 void * pvTimerUserData (xTimer * tm);
162 
167 /* ========================================================================== */
168 #ifdef __cplusplus
169  }
170 #endif
171 #endif /* _SYSIO_TIMER_H_ defined */
void * pvTimerUserData(xTimer *tm)
Données utilisateur d&#39;un timer.
int iTimerStop(xTimer *tm)
Arrête un timer.
void vTimerSetSingleShot(xTimer *tm, bool singleShot)
Valide/Invalide le single shot.
long lTimerRemainingTime(const xTimer *tm)
Renvoie la valeur restante de la minuterie en millisecondes.
int iTimerStart(xTimer *tm)
Démarre un timer.
void vTimerSetInterval(xTimer *tm, long msec)
Modifie l&#39;intervalle d&#39;un timer.
bool bTimerIsSingleShot(const xTimer *tm)
Teste si single shot actif.
int iTimerWait(xTimer *tm)
Attente d&#39;un timer.
int iTimerSetCallback(xTimer *tm, iTimerCallback callback, void *udata)
Installation d&#39;un gestionnaire de timeout.
bool bTimerIsActive(const xTimer *tm)
Teste si un timer est en marche.
struct xTimer xTimer
Objet timer Structure opaque pour l&#39;utilisateur.
Definition: timer.h:32
bool bTimerIsTimeout(xTimer *tm)
Teste la fin d&#39;un timer single shot.
long lTimerInterval(const xTimer *tm)
Lecture de l&#39;intervalle d&#39;un timer.
int iTimerUnsetCallback(xTimer *tm)
Retire un gestionnaire de timeout.
xTimer * xTimerNew(void)
Création d&#39;un timer.
int iTimerDelete(xTimer *tm)
Suppression d&#39;un timer.
int(* iTimerCallback)(xTimer *tm)
Definition: timer.h:46