2011-03-08 14:04:00 +08:00
|
|
|
/*
|
|
|
|
* File : led.h
|
|
|
|
* This file is part of RT-Thread RTOS
|
|
|
|
* COPYRIGHT (C) 2011, RT-Thread Develop Team
|
|
|
|
*
|
|
|
|
* The license and distribution terms for this file may be
|
|
|
|
* found in the file LICENSE in this distribution or at
|
|
|
|
* http://www.rt-thread.org/license/LICENSE
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2011-03-03 lgnq
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LED_H__
|
|
|
|
#define __LED_H__
|
|
|
|
|
|
|
|
#include "mb9bf506r.h"
|
|
|
|
|
|
|
|
#define LEDS_MAX_NUMBER 4
|
|
|
|
|
|
|
|
/*LEDs*/
|
|
|
|
#define LED1 (1UL<<10)
|
|
|
|
#define LED2 (1UL<<11)
|
|
|
|
#define LED3 (1UL<<12)
|
|
|
|
#define LED_MASK (LED1 | LED2 | LED3)
|
|
|
|
|
|
|
|
#define LED_PFR (FM3_GPIO->PFR3)
|
|
|
|
#define LED_DDR (FM3_GPIO->DDR3)
|
|
|
|
#define LED_PDOR (FM3_GPIO->PDOR3)
|
|
|
|
|
|
|
|
#define RT_DEVICE_CTRL_LED_ON 0
|
|
|
|
#define RT_DEVICE_CTRL_LED_OFF 1
|
|
|
|
#define RT_DEVICE_CTRL_LED_TOGGLE 2
|
|
|
|
|
|
|
|
void rt_hw_led_init(void);
|
|
|
|
void rt_hw_led_on(rt_uint8_t num);
|
|
|
|
void rt_hw_led_off(rt_uint8_t num);
|
|
|
|
void rt_hw_led_toggle(rt_uint8_t num);
|
2011-03-11 17:44:54 +08:00
|
|
|
void pwm_update(rt_uint16_t value);
|
2011-03-08 14:04:00 +08:00
|
|
|
|
|
|
|
#endif
|