📄 main.ppl
字号:
238 : /* TMHn register TMCYC1(TMH1 only) */
239 : #define TMHn_TMCYC1_Remote 0x06
240 : #define TMHn_TMCYC1_Remote_Low 0x00
241 : #define TMHn_TMCYC1_Remote_High 0x02
242 : #define TMHn_TMCYC1_Remote_Low2 0x04
243 : #define TMHn_TMCYC1_Remote_Carrier 0x06
244 :
245 : #define TMHn_TMCYC1_CarrierStatus 0x01
246 : #define TMHn_TMCYC1_Carrier_Disable 0x00
247 : #define TMHn_TMCYC1_Carrier_Enable 0x01
248 :
249 :
250 :
251 :
252 : #define _TIMERCFG_
253 :
254 : /*
255 : *******************************************************************************
256 : ** User control macro define
257 : *******************************************************************************
258 : */
259 :
260 : /*
261 : ***************************************
262 : ** TM00 configure
263 : **
264 : ** Please set operation mode here
265 : ***************************************
266 : */
267 : /* if no use set nouse = 1, if use some function set function = 1 */
268 : #define TM00_NotUse 0
269 : #define TM00_Interval 1
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 6
*/
270 : #define TM00_ExternalEvent 0
271 : #define TM00_SquareOut 0
272 : #define TM00_PPGOut 0
273 : #define TM00_OneshotOut 0
274 : #define TM00_PulseMeasurement 0
275 : /* if no use some method of pulse measurement set method = 1 */
276 : #define TM00_Pulse_TI00nAndTI01nFreeRunning 1
277 : #define TM00_Pulse_TI00nFreeRunning 0
278 : #define TM00_Pulse_TI00nRestart 0
279 :
280 : /* macro for setting of different functions */
281 :
282 : /*
283 : ***************************************
284 : ** TM00 interval
285 : **
286 : ** user set interval time = 0.5s
287 : ***************************************
288 : */
289 :
290 : /* Count clock and compare value */
291 : /* Use register bit macro
292 : TM0n_PRM0n_CountClock_Internal0 : fprs or
293 : TM0n_PRM0n_CountClock_Internal1 : fprs/2^2 or
294 : TM0n_PRM0n_CountClock_Internal2 : fprs/2^8 or
295 : TM0n_PRM0n_CountClock_TI00nEdge
296 : TM0n_PRM0n_TI00nEdge_Falling or
297 : TM0n_PRM0n_TI01nEdge_Rising or
298 : TM0n_PRM0n_TI01nEdge_Both
299 : Note : Please select the higher frequency you can,
300 : so the precision will be higher.
301 : */
302 : #define TM00_Clock TM0n_PRM0n_CountClock_Internal2
303 : /*
304 : Value range : 0x0001 - 0xffff
305 : Interval time = (CR00n_value + 1) * count_clock
306 : */
307 : #define TM00_CR00nValue 0x3d08
308 : #define TM00_CR01nValue 0xffff
309 :
310 : /* Register settings */
311 : #define TM00_TMC0nValue TM0n_TMC0n_Operation_ClearByMatchCR00n
312 : #define TM00_PRM0nValue TM00_Clock
313 : #define TM00_CRC0nValue TM0n_CRC0n_CR00nMode_Compare
314 :
315 : /* Interrupt settings */
316 : #define TM00_INTTM000 1
317 : #define TM00_INTTM010 0
318 :
319 :
320 : /*
321 : ***************************************
322 : ** TM01 configure
323 : **
324 : ** Please set operation mode here
325 : ***************************************
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 7
*/
326 : */
327 : /* if no use set nouse = 1, if use some function set function = 1 */
328 : #define TM01_NotUse 0
329 : #define TM01_Interval 1
330 : #define TM01_ExternalEvent 0
331 : #define TM01_SquareOut 0
332 : #define TM01_PPGOut 0
333 : #define TM01_OneshotOut 0
334 : #define TM01_PulseMeasurement 0
335 : /* if no use some method of pulse measurement set method = 1 */
336 : #define TM01_Pulse_TI00nAndTI01nFreeRunning 0
337 : #define TM01_Pulse_TI00nFreeRunning 1
338 : #define TM01_Pulse_TI00nRestart 0
339 :
340 : /* macro for setting of different functions */
341 :
342 : /*
343 : ***************************************
344 : ** TM01 interval
345 : **
346 : ** user set interval time = 0.5s
347 : ***************************************
348 : */
349 :
350 : /* Count clock and compare value */
351 : /* Use register bit macro
352 : TM0n_PRM0n_CountClock_Internal0 : fprs or
353 : TM0n_PRM0n_CountClock_Internal1 : fprs/2^4 or
354 : TM0n_PRM0n_CountClock_Internal2 : fprs/2^6 or
355 : TM0n_PRM0n_CountClock_TI00nEdge
356 : TM0n_PRM0n_TI00nEdge_Falling or
357 : TM0n_PRM0n_TI01nEdge_Rising or
358 : TM0n_PRM0n_TI01nEdge_Both
359 : Note : Please select the higher frequency you can,
360 : so the precision will be higher.
361 : */
362 : #define TM01_Clock TM0n_PRM0n_CountClock_Internal2
363 : /*
364 : Value range : 0x0001 - 0xffff
365 : Interval time = (CR00n_value + 1) * count_clock
366 : */
367 : #define TM01_CR00nValue 0xf423
368 : #define TM01_CR01nValue 0xffff
369 :
370 : /* Register settings */
371 : #define TM01_TMC0nValue TM0n_TMC0n_Operation_ClearByMatchCR00n
372 : #define TM01_PRM0nValue TM01_Clock
373 : #define TM01_CRC0nValue TM0n_CRC0n_CR00nMode_Compare
374 :
375 : /* Interrupt settings */
376 : #define TM01_INTTM001 1
377 : #define TM01_INTTM011 0
378 :
379 :
380 : /*
381 : ***************************************
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 8
*/
382 : ** TM50 configure
383 : **
384 : ** Please set operation mode here
385 : ***************************************
386 : */
387 : /* if no use set nouse = 1, if use some function set function = 1 */
388 : #define TM50_NotUse 0
389 : #define TM50_Interval 1
390 : #define TM50_ExternalEvent 0
391 : #define TM50_SquareOut 0
392 : #define TM50_PWMOut 0
393 :
394 :
395 : /*
396 : ***************************************
397 : ** TM50 interval
398 : **
399 : ** user set interval time = 0.25s
400 : ***************************************
401 : */
402 :
403 : /* Count clock and compare value */
404 : /* Use register bit macro
405 : TM5n_TCL5n_CountClock_TI5nFalling
406 : TM5n_TCL5n_CountClock_TI5nRising
407 : TM5n_TCL5n_CountClock_Internal0 : fprs
408 : TM5n_TCL5n_CountClock_Internal1 : fprs/2
409 : TM5n_TCL5n_CountClock_Internal2 : fprs/2^2
410 : TM5n_TCL5n_CountClock_Internal3 : fprs/2^6
411 : TM5n_TCL5n_CountClock_Internal4 : fprs/2^8
412 : TM5n_TCL5n_CountClock_Internal5 : fprs/2^13
413 : Note : Please select the higher frequency you can,
414 : so the precision will be higher.
415 : */
416 : #define TM50_Clock TM5n_TCL5n_CountClock_Internal5
417 : /*
418 : Value range : 0x00 - 0xff
419 : Interval time = (CR5n_value + 1) * count_clock
420 : */
421 : #define TM50_CR5nValue 0xf3
422 :
423 : /* Register settings */
424 : #define TM50_TCL5nValue TM50_Clock
425 : #define TM50_TMC5nValue TM5n_TMC5n_Operation_Start| TM5n_TMC5n_M
: ode_ClearByMatchCR5n
426 :
427 : /* Interrupt settings */
428 : #define TM50_INTTM50 1
429 :
430 :
431 : /*
432 : ***************************************
433 : ** TM51 configure
434 : **
435 : ** Please set operation mode here
436 : ***************************************
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 9
*/
437 : */
438 : /* if no use set nouse = 1, if use some function set function = 1 */
439 : #define TM51_NotUse 0
440 : #define TM51_Interval 1
441 : #define TM51_ExternalEvent 0
442 : #define TM51_SquareOut 0
443 : #define TM51_PWMOut 0
444 :
445 :
446 : /*
447 : ***************************************
448 : ** TM51 interval
449 : **
450 : ** user set interval time = 0.125s
451 : ***************************************
452 : */
453 :
454 : /* Count clock and compare value */
455 : /* Use register bit macro
456 : TM5n_TCL5n_CountClock_TI5nFalling
457 : TM5n_TCL5n_CountClock_TI5nRising
458 : TM5n_TCL5n_CountClock_Internal0 : fprs
459 : TM5n_TCL5n_CountClock_Internal1 : fprs/2
460 : TM5n_TCL5n_CountClock_Internal2 : fprs/2^4
461 : TM5n_TCL5n_CountClock_Internal3 : fprs/2^6
462 : TM5n_TCL5n_CountClock_Internal4 : fprs/2^8
463 : TM5n_TCL5n_CountClock_Internal5 : fprs/2^12
464 : Note : Please select the higher frequency you can,
465 : so the precision will be higher.
466 : */
467 : #define TM51_Clock TM5n_TCL5n_CountClock_Internal5
468 : /*
469 : Value range : 0x00 - 0xff
470 : Interval time = (CR5n_value + 1) * count_clock
471 : */
472 : #define TM51_CR5nValue 0xf3
473 :
474 : /* Register settings */
475 : #define TM51_TCL5nValue TM51_Clock
476 : #define TM51_TMC5nValue TM5n_TMC5n_Operation_Start| TM5n_TMC5n_M
: ode_ClearByMatchCR5n
477 :
478 : /* Interrupt settings */
479 : #define TM51_INTTM51 1
480 :
481 :
482 : /*
483 : ***************************************
484 : ** TMH0 configure
485 : **
486 : ** Please set operation mode here
487 : ***************************************
488 : */
489 : /* if no use set nouse = 1, if use some function set function = 1 */
490 : #define TMH0_NotUse 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -