Microchip® Advanced Software Framework

timer.h File Reference
#include <compiler.h>

Macros

#define INVALID_TIMER_ID   0xFFFFFFFF
 
#define TIMER_HZ   4
 

Enumerations

enum  {
  TIMEOUT_ONESHOT,
  TIMEOUT_PERIODIC
}
 

Functions

void timer_cancel_timeout (U32 id)
 
void timer_delay (U32 ms)
 
U32 timer_get_ms (void)
 
void timer_init (void(*tick_isr)(void *ctx), void *ctx)
 
int timer_interval_passed (U32 old, U32 new, U32 diff)
 
U32 timer_mod (U32 id, U32 ms, U8 type, void(*cb)(void *ctx), void *ctx)
 
void timer_poll (void)
 Called from application main loop to invoke any scheduled timeout cbs. More...
 
U32 timer_sched_timeout_cb (U32 ms, U8 type, void(*cb)(void *ctx), void *ctx)
 

#define INVALID_TIMER_ID   0xFFFFFFFF

Referenced by timer_mod().

#define TIMER_HZ   4

anonymous enum
Enumerator
TIMEOUT_ONESHOT 
TIMEOUT_PERIODIC 

void timer_cancel_timeout ( U32  id)

References timeout_t::expired, timer_t::timeout, and TIMER.

Referenced by timer_mod(), and ttcp_destroy().

void timer_delay ( U32  ms)
int timer_interval_passed ( U32  old,
U32  new,
U32  diff 
)
U32 timer_mod ( U32  id,
U32  ms,
U8  type,
void(*)(void *ctx cb,
void *  ctx 
)
void timer_poll ( void  )

Called from application main loop to invoke any scheduled timeout cbs.

This function might be called as often as possible rather than at each tick to support the timeout value '0', e.g a timeout within less than one tick.

References ARRAY_SIZE, timeout_t::cb, timeout_t::ctx, timeout_t::expire_at_tick, timeout_t::expired, i, timeout_t::tick, timer_t::tick, timer_t::timeout, TIMEOUT_PERIODIC, TIMER, and timeout_t::type.

Referenced by main(), and poll().

U32 timer_sched_timeout_cb ( U32  ms,
U8  type,
void(*)(void *ctx cb,
void *  ctx 
)