FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/bsp/timer.h @ 143:afceeeb2cba1
Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Tue, 12 Nov 2013 05:35:48 +0000 |
parents | nuc-fw/bsp/timer.h@91460c8957f0 |
children |
comparison
equal
deleted
inserted
replaced
142:15d5977390c2 | 143:afceeeb2cba1 |
---|---|
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 "../include/sys_types.h" | |
32 | |
33 #define TIMER_CNTL_REG MEM_TIMER_ADDR /* watchdog Control Timer register */ | |
34 | |
35 #define TIMER_ST 0x0080 | |
36 #define TIMER_AR 0x0100 | |
37 #define TIMER_PTV 0x0e00 | |
38 #define TIMER_CNTL_MASK 0x0f80 | |
39 #define TIMER_MODE_MASK 0x80ff | |
40 | |
41 | |
42 #define TIMER_LOAD_REG (MEM_TIMER_ADDR + 0x02) /* Timer load register */ | |
43 #define TIMER_READ_REG (MEM_TIMER_ADDR + 0x02) /* Timer read register */ | |
44 | |
45 | |
46 #define TIMER_MODE_REG (MEM_TIMER_ADDR + 0x04) /* Timer mode register */ | |
47 #define TIMER_WDOG 0x8000 /* watch dog */ | |
48 | |
49 #define START_STOP 1 /*to start or stop a timer */ | |
50 #define AR 0x0002 | |
51 #define PTV 0x001c | |
52 #define TIMER_CLK_EN 0x0020 | |
53 | |
54 | |
55 #define TIMER1_CNTL (MEM_TIMER1 + 0x00) | |
56 #define TIMER1_LOAD_TIM (MEM_TIMER1 + 0x02) | |
57 #define TIMER1_READ_TIM (MEM_TIMER1 + 0x04) | |
58 #define TIMER2_CNTL (MEM_TIMER2 + 0x00) | |
59 #define TIMER2_LOAD_TIM (MEM_TIMER2 + 0x02) | |
60 #define TIMER2_READ_TIM (MEM_TIMER2 + 0x04) | |
61 | |
62 | |
63 /*---------------------------------------------------------------/ | |
64 /* TIMER_START_STOP () */ | |
65 /*--------------------------------------------------------------*/ | |
66 /* Parameters : start or stop command */ | |
67 /* Return : none */ | |
68 /* Functionality : Start or Stop the timer */ | |
69 /*--------------------------------------------------------------*/ | |
70 #define TIMER_START_STOP(startStop) ((startStop) ? ((* (volatile SYS_UWORD16 *) TIMER_CNTL_REG) |= TIMER_ST) : \ | |
71 ((* (volatile SYS_UWORD16 *) TIMER_CNTL_REG) &= ~TIMER_ST)) | |
72 | |
73 | |
74 /* Prototype of the functions */ | |
75 | |
76 void TM_ResetTimer (SYS_UWORD16 timerNum, SYS_UWORD16 countValue, | |
77 SYS_UWORD16 autoReload, SYS_UWORD16 clockScale); | |
78 void TM_StopTimer (int timerNum); | |
79 void TM_StartTimer (int timerNum); | |
80 SYS_UWORD16 TM_ReadTimer (int timerNum); | |
81 | |
82 void TM_DisableWatchdog(void); | |
83 void TM_EnableWatchdog(void); | |
84 void TM_ResetWatchdog(SYS_UWORD16 cnt); | |
85 void TM_EnableTimer (int timerNum); | |
86 void TM_DisableTimer (int timerNum); | |
87 | |
88 SYS_UWORD16 TIMER_Read (unsigned short); | |
89 void TIMER_WriteValue (SYS_UWORD16); | |
90 unsigned short TIMER_ReadValue (void); | |
91 |