summaryrefslogtreecommitdiff
path: root/firmware/drivers/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/timer.h')
-rw-r--r--firmware/drivers/timer.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/firmware/drivers/timer.h b/firmware/drivers/timer.h
new file mode 100644
index 0000000..1f16976
--- /dev/null
+++ b/firmware/drivers/timer.h
@@ -0,0 +1,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
+******************************************************************************/