📄 hal_led.h
字号:
#ifndef HAL_LED_H
#define HAL_LED_H
/*********************************************************************
Filename: hal_led.h
Revised: $Date: 2005/04/29 01:36:04 $
Revision: $Revision:$
Description:
This file contains the interface to the LED Service.
This also contains the Task functions.
Notes:
Copyright (c) 2006 by Texas Instruments, Inc.
All Rights Reserved. Permission to use, reproduce, copy, prepare
derivative works, modify, distribute, perform, display or sell this
software and/or its documentation for any purpose is prohibited
without the express written consent of Texas Instruments, Inc.
*********************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
/*********************************************************************
* INCLUDES
*/
#include "hal_board.h"
/*********************************************************************
* MACROS
*/
/*********************************************************************
* CONSTANTS
*/
/* LEDS - The LED number is the same as the bit position */
#define HAL_LED_1 0x01
#define HAL_LED_2 0x02
#define HAL_LED_3 0x04
#define HAL_LED_4 0x08
#define HAL_LED_ALL (HAL_LED_1 | HAL_LED_2 | HAL_LED_3 | HAL_LED_4)
/* Modes */
#define HAL_LED_MODE_OFF 0x00
#define HAL_LED_MODE_ON 0x01
#define HAL_LED_MODE_BLINK 0x02
#define HAL_LED_MODE_FLASH 0x04
#define HAL_LED_MODE_TOGGLE 0x08
/* Defaults */
#define HAL_LED_DEFAULT_MAX_LEDS 4
#define HAL_LED_DEFAULT_DUTY_CYCLE 5
#define HAL_LED_DEFAULT_FLASH_COUNT 50
#define HAL_LED_DEFAULT_FLASH_TIME 1000
/*********************************************************************
* TYPEDEFS
*/
/*********************************************************************
* GLOBAL VARIABLES
*/
/*
* Initialize LED Service.
*/
extern void HalLedInit( void );
/*
* Set the LED ON/OFF/TOGGLE.
*/
extern uint8 HalLedSet( uint8 led, uint8 mode );
/*
* Blink the LED.
*/
extern void HalLedBlink( uint8 leds, uint8 cnt, uint8 duty, uint16 time );
/*
* Put LEDs in sleep state - store current values
*/
extern void HalLedEnterSleep( void );
/*
* Retore LEDs from sleep state
*/
extern void HalLedExitSleep( void );
/*
* Return LED state
*/
extern uint8 HalLedGetState ( void );
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -