iekc64_led.h
来自「TI公司的算法标准 Framework5的源代码」· C头文件 代码 · 共 132 行
H
132 行
/*
* Copyright 2002 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) RF5_IEK 2.00.02 12-11-02 (swat-c19)" */
/*! \verbatim
==============================================================================
Copyright (C) 2002 A.T.E.M.E.
All Rights Reserved
------------------------------------------------------------------------------
MODULE NAME... IEKC64_LED
FLENAME...... iekc64_led.h
PROJECT....... IEK C64x
------------------------------------------------------------------------------
HISTORY:
V1.0 04/02/2002 HCO
08/02/2002 HCO
------------------------------------------------------------------------------
\endverbatim <P> \file
\brief Header file for the IEK C64 interrupt board.
</P>*//*====================================================================*/
#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 This module manage the switching on and of of leds
</P>*//*==============================================================*//*@{*/
/*--------------------------------------------------------------------------*/
/*! Defines the possible state 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 placed on the top left of the board near the PCI bracket
ONBOARD_RED = 0,
//! Yellow led placed on the top left of the board near the PCI bracket
ONBOARD_YELLOW,
//! Green led placed on the top left of the board near the PCI bracket
ONBOARD_GREEN,
//! Red led placed on the PCI bracket (visible from outside PC)
BRACKET_RED,
//! Green led placed 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 )
};
/*--------------------------------------------------------------------------*/
/*! Set or change LED state
\param LedId
This should 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 succeed, 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 + =
减小字号Ctrl + -
显示快捷键?