NetBurner 3.5.6
PDF Version
timer_dispatch.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
5
#ifndef _TIMER_DISPATCH_H
6
#define _TIMER_DISPATCH_H
7
8
#include <predef.h>
9
#include <constants.h>
10
#include <sim.h>
11
12
/* Adds a timer dispatch capability to the system so timers can be used for multiple independent functions */
13
14
// ISR callback will have timer number and a channel object
15
typedef
void (*TimerIsrHandler)(
int
timer_num, TcChannel &tc,
void
*pExtra);
16
17
// Returns timer allocated, or -1 if timer selected is in use, or -2 if none are available
18
int
AllocateTimer( TimerIsrHandler tisr,
void
*pExtra,
int
timer = FIRST_UNUSED_TIMER);
19
void
FreeTimer(
int
timer);
20
21
// helper functions
22
IRQn GetTimerPeriphID(
int
timer);
23
TcChannel *GetTc(
int
timer);
24
25
#endif