1 |
588 |
jeremybenn |
/** ###################################################################
|
2 |
|
|
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
|
3 |
|
|
** Filename : TickTimer.H
|
4 |
|
|
** Project : RTOSDemo
|
5 |
|
|
** Processor : MC9S12C32CFU
|
6 |
|
|
** Beantype : TimerInt
|
7 |
|
|
** Version : Bean 02.063, Driver 01.05, CPU db: 2.87.276
|
8 |
|
|
** Compiler : Metrowerks HC12 C Compiler
|
9 |
|
|
** Date/Time : 18/06/2005, 17:53
|
10 |
|
|
** Abstract :
|
11 |
|
|
** This bean "TimerInt" implements a periodic interrupt.
|
12 |
|
|
** When the bean and its events are enabled, the "OnInterrupt"
|
13 |
|
|
** event is called periodically with the period that you specify.
|
14 |
|
|
** TimerInt supports also changing the period in runtime.
|
15 |
|
|
** The source of periodic interrupt can be timer compare or reload
|
16 |
|
|
** register or timer-overflow interrupt (of free running counter).
|
17 |
|
|
** Settings :
|
18 |
|
|
** Timer name : TIM (16-bit)
|
19 |
|
|
** Compare name : TC0
|
20 |
|
|
** Counter shared : No
|
21 |
|
|
**
|
22 |
|
|
** High-speed CPU mode
|
23 |
|
|
** Prescaler : divide-by-4
|
24 |
|
|
** Clock : 5999000 Hz
|
25 |
|
|
** Initial period/frequency
|
26 |
|
|
** Xtal ticks : 16000
|
27 |
|
|
** microseconds : 1000
|
28 |
|
|
** milliseconds : 1
|
29 |
|
|
** seconds (real) : 0.0010000
|
30 |
|
|
** Hz : 1000
|
31 |
|
|
** kHz : 1
|
32 |
|
|
**
|
33 |
|
|
** Runtime setting : period/frequency interval (continual setting)
|
34 |
|
|
** ticks : 16000 to 160000 ticks
|
35 |
|
|
** microseconds : 1000 to 10000 microseconds
|
36 |
|
|
** milliseconds : 1 to 10 milliseconds
|
37 |
|
|
** seconds (real) : 0.0010000 to 0.0100000 seconds
|
38 |
|
|
** Hz : 100 to 1000 Hz
|
39 |
|
|
**
|
40 |
|
|
** Initialization:
|
41 |
|
|
** Timer : Disabled
|
42 |
|
|
** Events : Enabled
|
43 |
|
|
**
|
44 |
|
|
** Timer registers
|
45 |
|
|
** Counter : TCNT [68]
|
46 |
|
|
** Mode : TIOS [64]
|
47 |
|
|
** Run : TSCR1 [70]
|
48 |
|
|
** Prescaler : TSCR2 [77]
|
49 |
|
|
**
|
50 |
|
|
** Compare registers
|
51 |
|
|
** Compare : TC0 [80]
|
52 |
|
|
**
|
53 |
|
|
** Flip-flop registers
|
54 |
|
|
** Mode : TCTL2 [73]
|
55 |
|
|
** Contents :
|
56 |
|
|
** Enable - byte TickTimer_Enable(void);
|
57 |
|
|
** SetFreqHz - byte TickTimer_SetFreqHz(word Freq);
|
58 |
|
|
**
|
59 |
|
|
** (c) Copyright UNIS, spol. s r.o. 1997-2002
|
60 |
|
|
** UNIS, spol. s r.o.
|
61 |
|
|
** Jundrovska 33
|
62 |
|
|
** 624 00 Brno
|
63 |
|
|
** Czech Republic
|
64 |
|
|
** http : www.processorexpert.com
|
65 |
|
|
** mail : info@processorexpert.com
|
66 |
|
|
** ###################################################################*/
|
67 |
|
|
|
68 |
|
|
#ifndef __TickTimer
|
69 |
|
|
#define __TickTimer
|
70 |
|
|
|
71 |
|
|
/* MODULE TickTimer. */
|
72 |
|
|
|
73 |
|
|
#include "Cpu.h"
|
74 |
|
|
|
75 |
|
|
#pragma CODE_SEG TickTimer_CODE /* Code section for this module. */
|
76 |
|
|
|
77 |
|
|
#define TickTimer_SFHzMin 100 /* Lower bound of interval for method SetFreqHz */
|
78 |
|
|
#define TickTimer_SFHzMax 1000 /* Upper bound of interval for method SetFreqHz */
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
byte TickTimer_Enable(void);
|
82 |
|
|
/*
|
83 |
|
|
** ===================================================================
|
84 |
|
|
** Method : TickTimer_Enable (bean TimerInt)
|
85 |
|
|
**
|
86 |
|
|
** Description :
|
87 |
|
|
** Enable the bean - it starts the timer. Events may be
|
88 |
|
|
** generated ("DisableEvent"/"EnableEvent").
|
89 |
|
|
** Parameters : None
|
90 |
|
|
** Returns :
|
91 |
|
|
** --- - Error code, possible codes:
|
92 |
|
|
** ERR_OK - OK
|
93 |
|
|
** ERR_SPEED - This device does not work in
|
94 |
|
|
** the active speed mode
|
95 |
|
|
** ===================================================================
|
96 |
|
|
*/
|
97 |
|
|
|
98 |
|
|
byte TickTimer_SetFreqHz(word Freq);
|
99 |
|
|
/*
|
100 |
|
|
** ===================================================================
|
101 |
|
|
** Method : TickTimer_SetFreqHz (bean TimerInt)
|
102 |
|
|
**
|
103 |
|
|
** Description :
|
104 |
|
|
** This method sets the new frequency of the generated
|
105 |
|
|
** events. The frequency is expressed in Hz as a 16-bit
|
106 |
|
|
** unsigned integer number.
|
107 |
|
|
** This method is available only if runtime setting type
|
108 |
|
|
** 'from interval' is selected in the Timing dialog box in
|
109 |
|
|
** Runtime setting area.
|
110 |
|
|
** Parameters :
|
111 |
|
|
** NAME - DESCRIPTION
|
112 |
|
|
** Freq - Frequency to set [in Hz]
|
113 |
|
|
** (100 to 1000 Hz)
|
114 |
|
|
** Returns :
|
115 |
|
|
** --- - Error code, possible codes:
|
116 |
|
|
** ERR_OK - OK
|
117 |
|
|
** ERR_SPEED - This device does not work in
|
118 |
|
|
** the active speed mode
|
119 |
|
|
** ERR_MATH - Overflow during evaluation
|
120 |
|
|
** ERR_RANGE - Parameter out of range
|
121 |
|
|
** ===================================================================
|
122 |
|
|
*/
|
123 |
|
|
|
124 |
|
|
#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
|
125 |
|
|
__interrupt void TickTimer_Interrupt(void);
|
126 |
|
|
#pragma CODE_SEG TickTimer_CODE /* Code section for this module. */
|
127 |
|
|
/*
|
128 |
|
|
** ===================================================================
|
129 |
|
|
** Method : TickTimer_Interrupt (bean TimerInt)
|
130 |
|
|
**
|
131 |
|
|
** Description :
|
132 |
|
|
** This method is internal. It is used by Processor Expert
|
133 |
|
|
** only.
|
134 |
|
|
** ===================================================================
|
135 |
|
|
*/
|
136 |
|
|
|
137 |
|
|
void TickTimer_Init(void);
|
138 |
|
|
/*
|
139 |
|
|
** ===================================================================
|
140 |
|
|
** Method : TickTimer_Init (bean TimerInt)
|
141 |
|
|
**
|
142 |
|
|
** Description :
|
143 |
|
|
** This method is internal. It is used by Processor Expert
|
144 |
|
|
** only.
|
145 |
|
|
** ===================================================================
|
146 |
|
|
*/
|
147 |
|
|
|
148 |
|
|
#pragma CODE_SEG DEFAULT /* Change code section to DEFAULT. */
|
149 |
|
|
|
150 |
|
|
/* END TickTimer. */
|
151 |
|
|
|
152 |
|
|
#endif /* ifndef __TickTimer */
|
153 |
|
|
/*
|
154 |
|
|
** ###################################################################
|
155 |
|
|
**
|
156 |
|
|
** This file was created by UNIS Processor Expert 03.33 for
|
157 |
|
|
** the Motorola HCS12 series of microcontrollers.
|
158 |
|
|
**
|
159 |
|
|
** ###################################################################
|
160 |
|
|
*/
|