txutl.c

来自「一个瑞萨单片机的程序。。。供大家学习用。。。。。。。。。。。。。。。。。。」· C语言 代码 · 共 73 行

C
73
字号
/*""FILE COMMENT""*************************************************************
*  System Name : for eduction (NO TRANSFERRING)
*  File Name   : txutl.c
*  Contents    : control timer X
*  Model       : for OAKS8-LCD Board
*  CPU         : R8C/Tiny series
*  Compiler    : NC30WA(V.5.30 Release 1)
*  OS          : not be used
*  Programer   : RENESAS Semiconductor Training Center
*  Note        : for OAKS8-R5F21114FP(R8C/11 group,20MHz)
*******************************************************************************
* COPYRIGHT(C) 2004 RENESAS TECHNOLOGY CORPORATION
* AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED
*******************************************************************************
* History      : ---
*""FILE COMMENT END""*********************************************************/

/*===== include file =====*/
#include "defs.h"					/* define common symbol					*/
#include "target.h"					/* SFR section definition file 			*/
#include "txutl.h"					/* header file for controlling timer X	*/

/*===== define macro =====*/

/*===== define function prototype =====*/

/*===== define variable =====*/
static int init_hard;				/* variable for hardware initialization management	 */
									/* 0:not be initialized, 1:initialized			 */


/*""FUNC COMMENT""*************************************************************
* ID              : ---
* function name   : void TX__initialize(void)
* function        : initialize timer X(timer mode, set period as 2ms)
* parameter       : none
* return          : none
* function used   : none
* notice          : none
* History	      : ---
*""FUNC	COMMENT	END""*********************************************************/
void TX__initialize(void)
{
	init_hard = TRUE;				/* timer X "initialized"				*/

	txmr = 0x00 ;					/* set timer X mode regiter			*/
									/* 0000000								*/
									/* |||||||+ timer mode  		*/
									/* |||||++- not be used 				*/
									/* ||||+--- stop count				*/
									/* ++++---- set 0 at this mode		*/
	tcss |= 0x01 ;					/* timer count source setting bit		*/
									/* ?????01								*/
									/* ||||||++ select f8(2.5MHz:400ns)		*/
									/* ||||++-- bit related to timer Y			*/
									/* ||++---- bit related to timer Z			*/
									/* ++------ reservation bit					*/
	prex = 125 - 1;					/* set count value						*/
	tx   = 100 - 1;					/* 		5ms = 400ns * (125 * 100)			*/

	txs  = 1 ; 						/* start count							*/
}


/* #############################################################################
 * ###	private function
 */


/******************************************************************************
	end	of file
******************************************************************************/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?