drv_led.c

来自「Epson系列芯片开发的例子」· C语言 代码 · 共 34 行

C
34
字号
/********************************************************************************************************
 *													*
 *	Copyright (C) SEIKO EPSON CORP. 2002								*
 *													*
 *	File name: Drv_led.c										*
 *	  This is LED driver for c33 star.								*
 *													*
 *	Revision history										*
 *		2002.06.4	Andrew Yin	Start.							*
 *													*
 *******************************************************************************************************/
#include "common.h"

void vInitLED( void );
void vLEDOn( void );
void vLEDOff( void );

void vInitLED( void )
{
	*( volatile unsigned char * )0x402D0 &= 0x0F7;
	*( volatile unsigned char * )0x402D2 |= 0x08;
	*( volatile unsigned char * )0x402D1 &= ~0x08;
}

void vLEDOn( void )
{
	*( volatile unsigned char * )0x402D1 |= 0x08;
}

void vLEDOff( void )
{
	*( volatile unsigned char * )0x402D1 &= ~0x08;
}

⌨️ 快捷键说明

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