FreeCalypso > hg > tcs211-c139
comparison g23m/condat/ms/src/bmi/MmiBuzzer.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /******************************************************************************* | |
2 | |
3 CONDAT (UK) | |
4 | |
5 ******************************************************************************** | |
6 | |
7 This software product is the property of Condat (UK) Ltd and may not be | |
8 disclosed to any third party without the express permission of the owner. | |
9 | |
10 ******************************************************************************** | |
11 | |
12 $Project name: Basic MMI | |
13 $Project code: BMI (6349) | |
14 $Module: PhoneBook | |
15 $File: MmiBuzzer.h | |
16 $Revision: 1.0 | |
17 | |
18 $Author: Condat(UK) | |
19 $Date: 25/10/00 | |
20 | |
21 ******************************************************************************** | |
22 | |
23 Description: | |
24 | |
25 ******************************************************************************** | |
26 | |
27 $History: MmiBuzzer.h | |
28 | |
29 25/10/00 Original Condat(UK) BMI version. | |
30 | |
31 $End | |
32 | |
33 *******************************************************************************/ | |
34 | |
35 | |
36 #if !defined(BUZZER_H) | |
37 #define BUZZER_H | |
38 | |
39 #define USE_PWT // use build in tone generator cascade. | |
40 | |
41 | |
42 #define BUZZER_ASIC_CONF_REG ( *( ( volatile USHORT* ) 0xFFFEF008) ) | |
43 #define BUZZER_BZ_OR_PWT 0x20 // bit 5 = 0 for BZ =1 for PWT | |
44 #define BUZZER_FREE_BIT_CLOCK_EN 0xFF // See HER207 Section 7.4.5 | |
45 #define BUZZER_ARMIO_CNTL ( *( ( volatile USHORT* ) 0xFFFE4806) ) | |
46 | |
47 #define BUZZER_ON 0x01 // Set bit 0 | |
48 #define BUZZER_OFF 0xFE // Reset bit 0 | |
49 | |
50 #ifdef USE_PWT | |
51 | |
52 #define PWT_FRC_REG ( *( ( volatile UBYTE* ) 0xFFFE8800) ) | |
53 #define PWT_VCR_REG ( *( ( volatile UBYTE* ) 0xFFFE8801) ) | |
54 #define PWT_CGR_REG ( *( ( volatile UBYTE* ) 0xFFFE8802) ) | |
55 | |
56 #define BUZZER_MAX_VOL 0x3F | |
57 | |
58 | |
59 #else | |
60 // Bit definitions in CNTL | |
61 #define BUZZER_SET_GPIO 0x0FDF // Set bit 5 | |
62 #define BUZZER_FREQ_CLOCK 0xC65D40 // 13 MHz | |
63 #define BUZZER_2_POWER_9 0x0200 // See HER207 section 7.4.14 | |
64 | |
65 | |
66 #define BUZZER_LEVEL_REG ( *( ( volatile USHORT* ) 0xFFFE4812) ) | |
67 #define BUZZER_CNTL_REG ( *( ( volatile USHORT* ) 0xFFFE480E) ) | |
68 #define BUZZER_LOAD_TIM_REG ( *( ( volatile USHORT* ) 0xFFFE4808) ) | |
69 #endif | |
70 | |
71 | |
72 | |
73 | |
74 // define available buzzer tones | |
75 #if 0 | |
76 #define g1 41 | |
77 #define gs2 36 | |
78 #define a1 33 | |
79 #define as1 29 | |
80 #define b1 25 | |
81 #define c2 21 | |
82 #define cs2 17 | |
83 #define d2 13 | |
84 #define ds2 7 | |
85 #define e2 5 | |
86 #define f2 48 | |
87 #define fs2 44 | |
88 #define fs1 45 | |
89 #define g2 40 | |
90 #define gs2 36 | |
91 #define gs1 37 | |
92 #define a2 32 | |
93 #define as2 28 | |
94 #define b2 24 | |
95 #define c3 20 | |
96 #define cs3 16 | |
97 #define d3 12 | |
98 #define ds3 8 | |
99 #define e3 4 | |
100 #define f1 49 | |
101 #define f2 48 | |
102 #define f3 47 // 349 | |
103 #define fs3 43 // 370 | |
104 #define g3 39 // 392 | |
105 #define gs3 35 // 415 | |
106 #define a3 31 // 440 | |
107 #define as3 27 // 466 | |
108 #define b3 23 // 494 | |
109 #define c4 19 // 523 | |
110 #define cs4 15 // 554 | |
111 #define d4 11 // 587 | |
112 #define ds4 7 // 622 | |
113 #define e4 3 // 659 | |
114 #define f4 46 // 698 | |
115 #define fs4 42 // 740 | |
116 #define g4 38 // 784 | |
117 #define gs4 34 // 831 | |
118 #define a4 30 // 880 | |
119 #define as4 26 // 932 | |
120 #define b4 22 // 988 | |
121 #define c5 18 // 1047 | |
122 #define cs5 14 // 1109 | |
123 #define d5 10 // 1175 | |
124 #define ds5 6 // 1245 | |
125 #define e5 2 // 1319 | |
126 #define f5 45 // 1397 | |
127 #define fs5 41 // 1480 | |
128 #define g5 37 // 1568 | |
129 #define gs5 33 // 1661 | |
130 #define a5 29 // 1760 | |
131 #define as5 25 // 1865 | |
132 #define b5 21 // 1976 | |
133 #define c6 17 // 2093 | |
134 #define cs6 13 // 2217 | |
135 #define d6 9 // 2349 | |
136 #define ds6 5 // 2489 | |
137 #define e6 1 // 2637 | |
138 #define f6 44 // 2794 | |
139 #define fs6 40 // 2960 | |
140 #define g6 36 // 3136 | |
141 #define gs6 32 // 3322 | |
142 #define a6 28 // 3520 | |
143 #define as6 24 // 3729 | |
144 #define b6 20 // 3951 | |
145 #define c7 16 // 4186 | |
146 #define cs7 12 // 4435 | |
147 #define d7 8 // 4699 | |
148 #define ds7 4 // 4978 | |
149 #define e7 0 // 5274 | |
150 #endif | |
151 #define ds1 73 | |
152 #define e1 72 | |
153 #define f1 71 | |
154 #define fs1 70 | |
155 #define g1 69 | |
156 #define gs1 68 | |
157 #define a1 67 | |
158 #define as1 66 | |
159 #define b1 65 | |
160 #define c2 64 | |
161 #define cs2 63 | |
162 #define d2 62 | |
163 #define ds2 61 | |
164 #define e2 60 | |
165 #define f2 59 | |
166 #define fs2 58 | |
167 #define g2 57 | |
168 #define gs2 56 | |
169 #define a2 55 | |
170 #define as2 54 | |
171 #define b2 53 | |
172 #define c3 52 | |
173 #define cs3 51 | |
174 #define d3 50 | |
175 #define ds3 49 | |
176 #define e3 48 | |
177 #define f3 47 // 349 | |
178 #define fs3 46 // 370 | |
179 #define g3 45 // 392 | |
180 #define gs3 44 // 415 | |
181 #define a3 43 // 440 | |
182 #define as3 42 // 466 | |
183 #define b3 41 // 494 | |
184 #define c4 40 // 523 | |
185 #define cs4 39 // 554 | |
186 #define d4 38 // 587 | |
187 #define ds4 37 // 622 | |
188 #define e4 36 // 659 | |
189 #define f4 35 // 698 | |
190 #define fs4 34 // 740 | |
191 #define g4 33 // 784 | |
192 #define gs4 32 // 831 | |
193 #define a4 31 // 880 | |
194 #define as4 30 // 932 | |
195 #define b4 29 // 988 | |
196 #define c5 28 // 1047 | |
197 #define cs5 27 // 1109 | |
198 #define d5 26 // 1175 | |
199 #define ds5 25 // 1245 | |
200 #define e5 24 // 1319 | |
201 #define f5 23 // 1397 | |
202 #define fs5 22 // 1480 | |
203 #define g5 21 // 1568 | |
204 #define gs5 20 // 1661 | |
205 #define a5 19 // 1760 | |
206 #define as5 18 // 1865 | |
207 #define b5 17 // 1976 | |
208 #define c6 16 // 2093 | |
209 #define cs6 15 // 2217 | |
210 #define d6 14 // 2349 | |
211 #define ds6 13 // 2489 | |
212 #define e6 12 // 2637 | |
213 #define f6 11 // 2794 | |
214 #define fs6 10 // 2960 | |
215 #define g6 9 // 3136 | |
216 #define gs6 8 // 3322 | |
217 #define a6 7 // 3520 | |
218 #define as6 6 // 3729 | |
219 #define b6 5 // 3951 | |
220 #define c7 4 // 4186 | |
221 #define cs7 3 // 4435 | |
222 #define d7 2 // 4699 | |
223 #define ds7 1 // 4978 | |
224 #define e7 0 // 5274 | |
225 | |
226 #define bf1 as1 | |
227 #define bf2 as2 | |
228 #define bf3 as3 | |
229 #define bf1 as1 | |
230 #define BZ_REST 0x3F | |
231 #define BZ_TERM 0xFF | |
232 | |
233 | |
234 | |
235 | |
236 void buzzer_Initialize(void); | |
237 void buzzer_On(void); | |
238 void buzzer_Off(void); | |
239 void buzzer_Tone(int in_freqTone); | |
240 void buzzer_Volume(int in_Volume); | |
241 | |
242 | |
243 #endif |