?? evmdm642_led.c
字號:
/*
* Copyright 2003 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*/
/*
* ======== evmdm642_led.c ========
* LED module for the EVMDM642
*/
#include <csl.h>
#include "evmdm642.h"
#include "evmdm642_led.h"
static Int16 ledstate;
void EVMDM642_LED_init()
{
/* Turn all LEDs off */
ledstate = 0xff;
EVMDM642_rset(EVMDM642_LED, ledstate);
}
void EVMDM642_LED_off(Uint32 ledNum)
{
/* Check bounds for ledNum */
if (ledNum >= 8)
return;
/* Clear the LED bit */
ledstate |= 1 << ledNum;
EVMDM642_rset(EVMDM642_LED, ledstate);
}
void EVMDM642_LED_on(Uint32 ledNum)
{
/* Check bounds for ledNum */
if (ledNum >= 8)
return;
/* Set the LED bit */
ledstate &= ~(1 << ledNum);
EVMDM642_rset(EVMDM642_LED, ledstate);
}
void EVMDM642_LED_toggle(Uint32 ledNum)
{
/* Check bounds for ledNum */
if (ledNum >= 8)
return;
/* Toggle the LED bit */
if ((EVMDM642_rget(EVMDM642_LED) & (1 << ledNum)) != 0)
EVMDM642_LED_on(ledNum);
else
EVMDM642_LED_off(ledNum);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -