📄 iekc64_led.h
字号:
#ifndef _IEKC64_LED_H_
#define _IEKC64_LED_H_
#include <csl_stdinc.h>
#include "iekc64.h"
#ifdef __cplusplus
extern "C" {
#endif
/*=======================================================================*//*!
\defgroup LED LED - LED control module
\brief TThis module manages the switching ON and OFF of LEDs.
</P>*//*==============================================================*//*@{*/
/*--------------------------------------------------------------------------*/
/*! Defines the possible states of a LED
*/
typedef enum
{
//! Used to set a LED off
OFF = 0,
//! Used to set a LED on
ON
}
IEKC64_LED_STATE;
/*--------------------------------------------------------------------------*/
/*! Defines the available leds on the IEKC64x board
*/
typedef enum
{
//! Red led located on the top left of the board near the PCI bracket
ONBOARD_RED = 0,
//! Yellow led located on the top left of the board near the PCI bracket
ONBOARD_YELLOW,
//! Green led located on the top left of the board near the PCI bracket
ONBOARD_GREEN,
//! Red led located on the PCI bracket (visible from outside PC)
BRACKET_RED,
//! Green led located on the PCI bracket (visible from outside PC)
BRACKET_GREEN
}
IEKC64_LED_ID;
/*--------------------------------------------------------------------------*/
/*! Module error codes.<br>
If status returned from a module call is negative (or
IEKC64_SUCCESS(return code) is false), the value represents en error
from the list below
*/
enum IEKC64_LED_STATUS
{
//! Generic error code
IEKC64_LED_ERROR = IEKC64_ERR_CODE( IEKC64_LED, 1 )
};
/*--------------------------------------------------------------------------*/
/*! Sets or changes LED state
\param LedId
This must be an LED identifer from the IEKC64_LED_ID list
\param LedState
This should be a new LED state from IEKC64_LED_STATE list
\return An IEKC64_STATUS. If the call succeeds, the value will be IEKC64_OK.
Otherwise it holds an error code. The status code can be tested by
the IEKC64_SUCCESS(return code) macro that is true is the value
represents a successful call.
\b Example:
\verbatim
// makes two leds flash
for ( i = 0 ; i < 10 ; i++ )
{
LED_set( ONBOARD_RED, ON );
LED_set( BRACKET_GREEN, OFF );
delay( 500 );
LED_set( ONBOARD_RED, OFF );
LED_set( BRACKET_GREEN, ON );
}
\endverbatim
You can find usage of this function in <a href="../../example/loopback_video_vga">example/loopback_video_vga</a>
/<a href="../../example/loopback_video_vga/loopback_VGA.c">loopback_VGA.c</a>.
*/
IEKC64_STATUS LED_set( IEKC64_LED_ID ledId, IEKC64_LED_STATE ledState );
/*@}*//* end of group LED */
#ifdef __cplusplus
}
#endif
#endif /* ifndef _IEKC64_LED_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -