📄 timer.ppl
字号:
291 : ** TM01 configure
292 : **
293 : ** Please set operation mode here
294 : ***************************************
295 : */
296 : /* if no use set nouse = 1, if use some function set function = 1 */
297 : #define TM01_NotUse 0
298 : #define TM01_Interval 0
299 : #define TM01_ExternalEvent 0
300 : #define TM01_SquareOut 0
301 : #define TM01_PPGOut 0
302 : #define TM01_OneshotOut 0
303 : #define TM01_PulseMeasurement 1
304 : /* if no use some method of pulse measurement set method = 1 */
305 : #define TM01_Pulse_TI00nAndTI01nFreeRunning 0
306 : #define TM01_Pulse_TI00nFreeRunning 1
307 : #define TM01_Pulse_TI00nRestart 0
308 :
309 : /* macro for setting of different functions */
310 :
311 : /*
312 : ***************************************
313 : ** TM01 pulse measurement
314 : **
315 : ** user set mode =
316 : ***************************************
317 : */
318 :
319 : /* Count clock */
320 : /* Use register bit macro
321 : TM0n_PRM0n_CountClock_Internal0 : fprs or
322 : TM0n_PRM0n_CountClock_Internal1 : fprs/2^4 or
323 : TM0n_PRM0n_CountClock_Internal2 : fprs/2^6 or
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 7
*/
324 : Note : Please select the higher frequency you can,
325 : so the precision will be higher.
326 : */
327 : #define TM01_Clock TM0n_PRM0n_CountClock_Internal0
328 :
329 :
330 : /* Register settings */
331 : #define TM01_TMC0nValue TM0n_TMC0n_Operation_FreeRunning
332 : #define TM01_PRM0nValue TM0n_PRM0n_TI01nEdge_Rising|
: TM0n_PRM0n_TI00nEdge_Rising| TM01_Clock /* internal
: count clock only */
333 : #define TM01_CRC0nValue TM0n_CRC0n_CR01nMode_Capture|
: TM0n_CRC0n_CR00nTrigger_TI00nEdgeReverse| TM0n_CRC0n_CR00nMode
: _Capture
334 :
335 : /* Interrupt settings */
336 : #define TM01_INTTM001 0
337 : #define TM01_INTTM011 1
338 :
339 :
340 :
341 : /*
342 : ***************************************
343 : ** TM50 configure
344 : **
345 : ** Please set operation mode here
346 : ***************************************
347 : */
348 : /* if no use set nouse = 1, if use some function set function = 1 */
349 : #define TM50_NotUse 1
350 : #define TM50_Interval 0
351 : #define TM50_ExternalEvent 0
352 : #define TM50_SquareOut 0
353 : #define TM50_PWMOut 0
354 :
355 :
356 : /* Interrupt settings */
357 : #define TM50_INTTM50 0
358 :
359 :
360 : /*
361 : ***************************************
362 : ** TM51 configure
363 : **
364 : ** Please set operation mode here
365 : ***************************************
366 : */
367 : /* if no use set nouse = 1, if use some function set function = 1 */
368 : #define TM51_NotUse 1
369 : #define TM51_Interval 0
370 : #define TM51_ExternalEvent 0
371 : #define TM51_SquareOut 0
372 : #define TM51_PWMOut 0
373 :
374 :
375 : /* Interrupt settings */
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 8
*/
376 : #define TM51_INTTM51 0
377 :
378 :
379 : /*
380 : ***************************************
381 : ** TMH0 configure
382 : **
383 : ** Please set operation mode here
384 : ***************************************
385 : */
386 : /* if no use set nouse = 1, if use some function set function = 1 */
387 : #define TMH0_NotUse 1
388 : #define TMH0_Interval 0
389 : #define TMH0_SquareOut 0
390 : #define TMH0_PWMOut 0
391 :
392 :
393 : /* Interrupt settings */
394 : #define TMH0_INTTMH0 0
395 :
396 :
397 : /*
398 : ***************************************
399 : ** TMH1 configure
400 : **
401 : ** Please set operation mode here
402 : ***************************************
403 : */
404 : /* if no use set nouse = 1, if use some function set function = 1 */
405 : #define TMH1_NotUse 1
406 : #define TMH1_Interval 0
407 : #define TMH1_SquareOut 0
408 : #define TMH1_PWMOut 0
409 : #define TMH1_CarrierOut 0
410 :
411 :
412 : /* Interrupt settings */
413 : #define TMH1_INTTMH1 0
414 :
415 :
416 :
417 :
418 : /*
419 : *******************************************************************************
420 : ** MacroDefine
421 : *******************************************************************************
422 : */
423 :
424 :
425 : /*
426 : **-----------------------------------------------------------------------------
427 : **
428 : ** Abstract:
429 : ** This function initializes TM00.
430 : **
431 : ** Parameters:
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 9
*/
432 : ** None
433 : **
434 : ** Returns:
435 : ** None
436 : **
437 : **-----------------------------------------------------------------------------
438 : */
439 : void TM00_Init(void)
440 : {
441 : /*
442 : TMC00 = TM0n_TMC0n_Operation_Disable;
443 : */
444 :
445 : PRM00 = TM00_PRM0nValue;
446 :
447 :
448 : CRC00 = TM00_CRC0nValue;
449 :
450 :
451 :
452 :
453 : /* TI000 and/or TI010 and/or TO00 pin setting */
454 : /* INTTM000 and/or INTTM010 priority */
455 : }
456 : /*
457 : **-----------------------------------------------------------------------------
458 : **
459 : ** Abstract:
460 : ** This function starts the TM00 counter.
461 : **
462 : ** Parameters:
463 : ** None
464 : **
465 : ** Returns:
466 : ** None
467 : **
468 : **-----------------------------------------------------------------------------
469 : */
470 : void TM00_Enable(void)
471 : {
472 :
473 : TMC00 = TM00_TMC0nValue;
474 :
475 : /* INTTM000 and/or INTTM010 enable */
476 : }
477 :
478 : /*
479 : **-----------------------------------------------------------------------------
480 : **
481 : ** Abstract:
482 : ** This function stops the TM00 counter and clear the count register.
483 : **
484 : ** Parameters:
485 : ** None
486 : **
487 : ** Returns:
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 10
*/
488 : ** None
489 : **
490 : **-----------------------------------------------------------------------------
491 : */
492 : void TM00_Disable(void)
493 : {
494 : /* Use register bit macro
495 : TM0n_TMC0n_Operation_Disable
496 : */
497 : TMC00 = TM0n_TMC0n_Operation_Disable;
498 :
499 : /* INTTM000 and/or INTTM010 disable */
500 : }
501 :
502 :
503 :
504 : /*
505 : **-----------------------------------------------------------------------------
506 : **
507 : ** Abstract:
508 : ** This function can initialize TM01_module.
509 : **
510 : ** Parameters:
511 : ** None
512 : **
513 : ** Returns:
514 : ** None
515 : **
516 : **-----------------------------------------------------------------------------
517 : */
518 : void TM01_Init(void)
519 : {
520 : /*
521 : TMC01 = TM0n_TMC0n_Operation_Disable;
522 : */
523 :
524 : PRM01 = TM01_PRM0nValue;
525 :
526 :
527 : CRC01 = TM01_CRC0nValue;
528 :
529 :
530 :
531 :
532 : /* TI001 and/or TI011 and/or TO01 pin setting */
533 : /* INTTM001 and/or INTTM011 priority */
534 : }
535 : /*
536 : **-----------------------------------------------------------------------------
537 : **
538 : ** Abstract:
539 : ** This function start the TM01 counter.
540 : **
541 : ** Parameters:
542 : ** None
543 : **
/*
78K/0 Series C Compiler V3.60 Preprocess List Date: 9 Oct 2005 Page: 11
*/
544 : ** Returns:
545 : ** None
546 : **
547 : **-----------------------------------------------------------------------------
548 : */
549 : void TM01_Enable(void)
550 : {
551 :
552 : TMC01 = TM01_TMC0nValue;
553 :
554 : /* INTTM001 and/or INTTM011 enable */
555 : }
556 :
557 : /*
558 : **-----------------------------------------------------------------------------
559 : **
560 : ** Abstract:
561 : ** This fnction stop the TM01 module.
562 : **
563 : ** Parameters:
564 : ** None
565 : **
566 : ** Returns:
567 : ** None
568 : **
569 : **-----------------------------------------------------------------------------
570 : */
571 : void TM01_Disable(void)
572 : {
573 : /* Use register bit macro
574 : TM0n_TMC0n_Operation_Disable
575 : */
576 : TMC01 = TM0n_TMC0n_Operation_Disable;
577 :
578 : /* INTTM001 and/or INTTM011 disable */
579 : }
580 :
581 :
582 :
583 :
584 :
585 :
586 :
587 :
588 :
/*
Target chip : uPD78F0547_80
Device file : V2.00
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -