📄 lpc2103_paypass_ttal1_functions.lst
字号:
183 // OUT : - none -
184 // RETURN : - none -
185 // Notes : Here Timer 1 of the LP2129 is used
186 // This function set the Timer 1 Matching Register value of the LP2129
187 // with "Timer 1 Matching register value"= delayus * (Timer value of 1祍), then start the timer 1 from
- 0,
188 // End wait until "Timer 1 value" < "Time 1 Matching Register value" (until a timer event occurs)
189 //
190 //-----------------------------------------------------------------------------
191 void delay_us(unsigned short delayus)
192 {
193 1
194 1 unsigned short l_bdelay1us=ONE_U_SECOND; // Process l_bdelay1us according to the PLL settings for 1祍 v
-alue
*** ERROR C67 IN LINE 194 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'O
-NE_U_SECOND': undefined identifier
195 1 // If a fixed PLL is used, or the PCLK is fast enough
196 1 // ,remove PLL_MSEL & PLL_PSEL from the l_bdelay1us calculation
197 1 // i.e "unsigned long l_bdelay1us=0x03;" 0x03 should be change according to the tar
-get internal clock
198 1 // in order that when "delayus"=1, the function wait 1 祍
199 1
200 1
201 1 //STOP TIMER1
202 1
203 1 T1TC=(unsigned long)0x00000000; // Reset Timer Counter
*** ERROR C67 IN LINE 203 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1TC': undefined identifier
204 1 T1MCR = (unsigned long)0x00000001; // Interrupt on MR0 and don't rese
-t TC on match
*** ERROR C67 IN LINE 204 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1MCR': undefined identifier
205 1 T1MR0 = (unsigned long)(l_bdelay1us * delayus); // TC Init //ASSIGN TIME OUT
*** ERROR C67 IN LINE 205 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1MR0': undefined identifier
206 1 T1IR = (unsigned long)0x01; // Clear interrupt flag
*** ERROR C67 IN LINE 206 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1IR': undefined identifier
207 1 T1PR =(unsigned long) 0x00 ; // Prescale 0
*** ERROR C67 IN LINE 207 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1PR': undefined identifier
208 1
209 1 //START TIMER1
210 1 T1TCR = (unsigned long)0x01;
*** ERROR C67 IN LINE 210 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1TCR': undefined identifier
211 1 while(!(bit_testTimer1MR0IF()));
*** WARNING C140 IN LINE 211 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C:
- 'bit_testTimer1MR0IF' undefined; assuming 'extern int bit_testTimer1MR0IF()'
212 1 T1TCR = (unsigned long)0x02; // Timer1 Disable
*** ERROR C67 IN LINE 212 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-1TCR': undefined identifier
213 1
214 1 }
215
216 //-----------------------------------------------------------------------------
217 // Function name : delay_ms
218 //-----------------------------------------------------------------------------
219 // Description : This function waits X ms
220 //
ARM COMPILER V2.40e, LPC2103_PayPass_TTAL1_functions 12/12/07 14:35:10 PAGE 5
221 // IN : delayus : Number of ms to wait (here MINIMUM IS 50)
222 // OUT : - none -
223 // RETURN : - none -
224 // Notes : Here Timer 1 of the LP2129 is used
225 // This function set the Timer 1 Matching Register value of the LP2129
226 // with "Timer 1 Matching register value"= delayus * (Timer value of 1祍), then start the timer 1 from
- 0,
227 // End wait until "Timer 1 value" < "Time 1 Matching Register value" (until a timer event occurs)
228 //
229 //-----------------------------------------------------------------------------
230 void delay_ms(unsigned char delayms)
231 {
232 1 unsigned char l_iTemp;
233 1
234 1 for(l_iTemp=0;l_iTemp<delayms;l_iTemp++)
235 1 {
236 2 delay_us(1000);
237 2 }
238 1
239 1 }
240
241 //-----------------------------------------------------------------------------
242 // Function name : GetPowerTwo
243 //-----------------------------------------------------------------------------
244 // Description : This function get 2 raised to power "p_lTimeout"
245 //
246 // IN : p_lTimeout : power value
247 // OUT : result of operation -
248 // RETURN : - none -
249 // Notes : This function
250 //-----------------------------------------------------------------------------
251 long GetPowerTwo(long p_lTimeout)
252 {
253 1 long Result,i,temp=2;
254 1 if(p_lTimeout==0) {return 1;}
255 1 if(p_lTimeout==1) {return 2;}
256 1 for(i=1;i<p_lTimeout;i++)
257 1 {
258 2 Result=temp*2;
259 2 temp=Result;
260 2 }
261 1 return Result;
262 1 }
263
264 //-----------------------------------------------------------------------------
265 // Function : v_fnDefineTimeout(unsigned char p_bTimeout)
266 //-----------------------------------------------------------------------------
267 // Description : Define TMR0 initialization (Set the timeout value into Timer 0 Matching register)
268 //
269 // IN : p_bTimeOut : If p_bTimeOut <0E, Timeout will be set according to :
270 // 0x00 TimeOut = 302祍
271 // 0x01 TimeOut = 604祍
272 // 0x02 TimeOut = 1,24ms
273 // 0x03 TimeOut = 2,42ms
274 // 0x04 ...etc...
275 //
276 // If p_bTimeOut >=0E, TimeOut= p_bTimeOut(a value in 祍)
277 //
278 // OUT : - none -
279 //
280 // RETURN : - none -
281 //
282 // Notes : Here Timer 0 of the LPC2129 is used
283 // -This function set the Timer 0 Matching Register value of the LP2129 as the time out value :
284 // -If p_lTimeout<0x0E ---> "Timer 0 Matching register value" = (Timer value of 1祍)*pow(2,p_lTimeout
-)
ARM COMPILER V2.40e, LPC2103_PayPass_TTAL1_functions 12/12/07 14:35:10 PAGE 6
285 // -If p_lTimeout>=0x0E ---> "Timer 0 Matching register value" = p_lTimeout(in 祍)
286 // -A value of 530 祍 is added at each timeout definition to concider
287 // communication timings between MCU and Picoread (only if p_lTimeout<0x0E)
288 //-----------------------------------------------------------------------------
289 void v_fnDefineTimeout(unsigned long p_lTimeout)
290 {
291 1 //extern double pow(double,double);
292 1 unsigned long l_lTimeout=0x0FFF;
293 1
294 1
295 1
296 1 if(p_lTimeout<=0x0E)
297 1 {
298 2
299 2 // 0x3FF as been defined according to 13.56MHz Oscillator and should correspond to 302祍 for each PLL s
-ettings
300 2 l_lTimeout=ONE_U_SECOND*0x12E*GetPowerTwo(p_lTimeout);
*** ERROR C67 IN LINE 300 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'O
-NE_U_SECOND': undefined identifier
301 2
302 2 //Add Offset of 530祍
303 2
304 2 // 0x706 as been defined according to 13.56MHz Oscillator and should correspond to 530祍 for each PLL s
-ettings
305 2 l_lTimeout+=ONE_U_SECOND*0x212; // Process TimeOut according to XTAL and PLL settings
*** ERROR C67 IN LINE 305 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'O
-NE_U_SECOND': undefined identifier
306 2
307 2
308 2 }else
309 1 {
310 2 l_lTimeout =(unsigned long)(p_lTimeout * ONE_U_SECOND);
*** ERROR C67 IN LINE 310 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'O
-NE_U_SECOND': undefined identifier
311 2
312 2 }
313 1
314 1
315 1
316 1 //STOP TIMER0
317 1 T0TCR = (unsigned long)0x02; // Timer0 Disable
*** ERROR C67 IN LINE 317 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0TCR': undefined identifier
318 1 T0TC = (unsigned long)0x00000000; // Reset TC
*** ERROR C67 IN LINE 318 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0TC': undefined identifier
319 1 T0MCR = (unsigned long)0x00000001; // Interrupt on MR0 and reset TC on match
*** ERROR C67 IN LINE 319 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0MCR': undefined identifier
320 1 T0MR0 = (unsigned long)l_lTimeout; // TC Init //ASSIGN TIME OUT
*** ERROR C67 IN LINE 320 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0MR0': undefined identifier
321 1 T0IR = (unsigned long)0x01; // Clear interrupt flag
*** ERROR C67 IN LINE 321 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0IR': undefined identifier
322 1 T0PR = TIMER_0_PRESCALER ; // Prescale 0
*** ERROR C67 IN LINE 322 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-0PR': undefined identifier
*** ERROR C67 IN LINE 322 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
-IMER_0_PRESCALER': undefined identifier
323 1 }
324
325
326
327 //-----------------------------------------------------------------------------
328 // Function name : v_fnTimeOutStart
ARM COMPILER V2.40e, LPC2103_PayPass_TTAL1_functions 12/12/07 14:35:10 PAGE 7
329 //-----------------------------------------------------------------------------
330 // Description : This function starts the TIMER0.--> Start Timeout Timer.
331 //
332 // IN : - none -
333 // OUT : - none -
334 // RETURN : - none -
335 // Notes : This function use the timer 0 of the LP2129
336 // This function is used in association with v_fnDefineTimeout function
337 //-----------------------------------------------------------------------------
338 void v_fnTimeOutStart()
339 {
340 1 //START TIMER0
341 1 T0TCR = 1;
*** ERROR C67 IN LINE 341 OF ..\..\..\..\LIB\TARGETS\LPC2103\PAYPASS_TTAL1\SOURCES\LPC2103_PAYPASS_TTAL1_FUNCTIONS.C: 'T
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -