comparison src/cs/drivers/drv_core/timer/timer.h @ 0:b6a5e36de839

src/cs: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b6a5e36de839
1 /*******************************************************************************
2 TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION
3
4 Property of Texas Instruments -- For Unrestricted Internal Use Only
5 Unauthorized reproduction and/or distribution is strictly prohibited. This
6 product is protected under copyright law and trade secret law as an
7 unpublished work. Created 1987, (C) Copyright 1997 Texas Instruments. All
8 rights reserved.
9
10
11 Filename : timer.h
12
13 Description : timer.c header
14
15 Project : drivers
16
17 Author : pmonteil@tif.ti.com Patrice Monteil.
18
19 Version number : 1.3
20
21 Date and time : 07/23/98 16:25:53
22 Previous delta : 07/23/98 16:25:52
23
24 SCCS file : /db/gsm_asp/db_ht96/dsp_0/gsw/rel_0/mcu_l1/release1.5/mod/emu/EMU_MCMP/eva3_drivers/source/SCCS/s.timer.h
25
26 Sccs Id (SID) : '@(#) timer.h 1.3 07/23/98 16:25:53 '
27
28
29 *****************************************************************************/
30
31 #include "l1sw.cfg"
32
33 #if (OP_L1_STANDALONE == 0)
34 #include "main/sys_types.h"
35 #else
36 #include "sys_types.h"
37 #endif
38
39 #define TIMER_CNTL_REG MEM_TIMER_ADDR /* watchdog Control Timer register */
40
41 #define TIMER_ST 0x0080
42 #define TIMER_AR 0x0100
43 #define TIMER_PTV 0x0e00
44 #define TIMER_CNTL_MASK 0x0f80
45 #define TIMER_MODE_MASK 0x80ff
46
47
48 #define TIMER_LOAD_REG (MEM_TIMER_ADDR + 0x02) /* Timer load register */
49 #define TIMER_READ_REG (MEM_TIMER_ADDR + 0x02) /* Timer read register */
50
51
52 #define TIMER_MODE_REG (MEM_TIMER_ADDR + 0x04) /* Timer mode register */
53 #define TIMER_WDOG 0x8000 /* watch dog */
54
55 #define START_STOP 1 /*to start or stop a timer */
56 #define AR 0x0002
57 #define PTV 0x001c
58 #define TIMER_CLK_EN 0x0020
59
60
61 #define TIMER1_CNTL (MEM_TIMER1 + 0x00)
62 #define TIMER1_LOAD_TIM (MEM_TIMER1 + 0x02)
63 #define TIMER1_READ_TIM (MEM_TIMER1 + 0x04)
64 #define TIMER2_CNTL (MEM_TIMER2 + 0x00)
65 #define TIMER2_LOAD_TIM (MEM_TIMER2 + 0x02)
66 #define TIMER2_READ_TIM (MEM_TIMER2 + 0x04)
67
68
69 /*--------------------------------------------------------------
70 * TIMER_START_STOP ()
71 *--------------------------------------------------------------
72 * Parameters : start or stop command
73 * Return : none
74 * Functionality : Start or Stop the timer
75 *--------------------------------------------------------------*/
76 #define TIMER_START_STOP(startStop) ((startStop) ? ((* (volatile SYS_UWORD16 *) TIMER_CNTL_REG) |= TIMER_ST) : \
77 ((* (volatile SYS_UWORD16 *) TIMER_CNTL_REG) &= ~TIMER_ST))
78
79
80 /* Prototype of the functions */
81
82 void TM_ResetTimer (SYS_UWORD16 timerNum, SYS_UWORD16 countValue,
83 SYS_UWORD16 autoReload, SYS_UWORD16 clockScale);
84 void TM_StopTimer (int timerNum);
85 void TM_StartTimer (int timerNum);
86 SYS_UWORD16 TM_ReadTimer (int timerNum);
87
88 void TM_DisableWatchdog(void);
89 void TM_EnableWatchdog(void);
90 void TM_ResetWatchdog(SYS_UWORD16 cnt);
91 void TM_EnableTimer (int timerNum);
92 void TM_DisableTimer (int timerNum);
93
94 SYS_UWORD16 TIMER_Read (unsigned short);
95 void TIMER_WriteValue (SYS_UWORD16);
96 unsigned short TIMER_ReadValue (void);
97