?? drv_led.c.bak
字號:
/********************************************************************************************************
* *
* 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 vSingleOn(unsigned char number);
void vSingleOff(unsigned char number);
void vInitLED( void )
{
*( volatile unsigned char * )0x402D0 &= 0x0F0;
*( volatile unsigned char * )0x402D2 |= 0x0F;
*( volatile unsigned char * )0x402D1 &= ~0x0F;
}
void vLEDOn( void )
{
*( volatile unsigned char * )0x402D1 |= 0x01;
}
void vLEDOff( void )
{
*( volatile unsigned char * )0x402D1 &= ~0x01;
}
void vSingleOn(unsigned char number)
{
switch(number)
{
case 1:
*( volatile unsigned char * )0x402D1 |=0x01;
break;
case 2:
*( volatile unsigned char * )0x402D1 |=0x02;
break;
case 3:
*( volatile unsigned char * )0x402D1 |=0x04;
break;
case 4:
*( volatile unsigned char * )0x402D1 |=0x08;
break;
default:
break;
}
}
void vSingleOff(unsigned char number)
{
switch(number)
{
case 1:
*( volatile unsigned char * )0x402D1 &=~0x01;
break;
case 2:
*( volatile unsigned char * )0x402D1 &=~0x02;
break;
case 3:
*( volatile unsigned char * )0x402D1 &=~0x04;
break;
case 4:
*( volatile unsigned char * )0x402D1 &=~0x08;
break;
default:
break;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -