NetBurner 3.5.6
PDF Version
pitr_sem.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
5extern volatile uint32_t gPitCount[4];
6
7/*-------------------------------------------------------------------
8 * Initialize a PIT timer to interrupt the specified numbe of times
9 * per second. Maximum is 20,000 providing 50us per tick.
10 *
11 * PARAMETERS
12 * timer Select PIT timer. Value can be 1 or 2.
13 * 0 is reserved for the rtos system clock,
14 * 3 is reserved for the debugger
15 *
16 * pit_per_sec Number of interrupts per second
17 *
18 * RETURNS
19 * 0 = success
20 * -1 = invalid channel
21 *------------------------------------------------------------------*/
22
23// Posts a semaphore when timer expires
24int InitPitOSSem(int timer, OS_SEM *p_toSem, int pit_per_sec);
25
26// Sets a flag when timer expires
27int InitPitOSFlag(int timer, OS_FLAGS *p_toFlag, uint32_t fv, int pit_per_sec);
28
29// Calls a function when timer expires
30int InitPitInterruptCallback(int timer, void (*p_toCallbackFunc)(), int pit_per_sec);
31
32// Clear semaphore/flag/callback associated with a timer
33void ClearTimerVariables(int timer);