summaryrefslogtreecommitdiff
path: root/firmware/drivers/timer.h
blob: 1f16976fab9c5db7c7fe9e2af8dd37c5a1baed75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/****************************************************************************
 *   $Id:: timer.h 5823 2010-12-07 19:01:00Z usb00423                       $
 *   Project: NXP LPC17xx Timer example
 *
 *   Description:
 *     This file contains Timer code header definition.
 *
 ****************************************************************************
 * Software that is described herein is for illustrative purposes only
 * which provides customers with programming information regarding the
 * products. This software is supplied "AS IS" without any warranties.
 * NXP Semiconductors assumes no responsibility or liability for the
 * use of the software, conveys no license or title under any patent,
 * copyright, or mask work right to the product. NXP Semiconductors
 * reserves the right to make changes in the software without
 * notification. NXP Semiconductors also make no representation or
 * warranty that such application will be suitable for the specified
 * use without further testing or modification.
****************************************************************************/
#ifndef __TIMER_H 
#define __TIMER_H

/* The test is either MAT_OUT or CAP_IN. Default is MAT_OUT. */
/* If running DMA test, External match is not needed to trigger DMA, but still 
set timer as MATx instead of CAPx. */
#define TIMER_MATCH		1
	
/* TIME_INTERVALmS is a value to load the timer match register with
   to get a 1 mS delay */
#define TIME_INTERVALmS	1000

#define TIME_INTERVAL	(9000000/100 - 1)

extern void delayMs(uint8_t timer_num, uint32_t delayInMs);
extern uint32_t TimerInit( uint8_t timer_num, uint32_t timerInterval );
extern void enable_timer( uint8_t timer_num );
extern void disable_timer( uint8_t timer_num );
extern void reset_timer( uint8_t timer_num );
extern void TIMER0_interrupt  (void);
extern void TIMER1_interrupt (void);
extern void TIMER2_interrupt (void);
extern void TIMER3_interrupt (void);

#endif /* end __TIMER_H */
/*****************************************************************************
**                            End Of File
******************************************************************************/