led.h 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * File : led.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2011, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2011-03-03 lgnq
  13. */
  14. #ifndef __LED_H__
  15. #define __LED_H__
  16. #include "mb9bf506r.h"
  17. #define LEDS_MAX_NUMBER 4
  18. /*LEDs*/
  19. #define LED1 (1UL<<10)
  20. #define LED2 (1UL<<11)
  21. #define LED3 (1UL<<12)
  22. #define LED_MASK (LED1 | LED2 | LED3)
  23. #define LED_PFR (FM3_GPIO->PFR3)
  24. #define LED_DDR (FM3_GPIO->DDR3)
  25. #define LED_PDOR (FM3_GPIO->PDOR3)
  26. #define RT_DEVICE_CTRL_LED_ON 0
  27. #define RT_DEVICE_CTRL_LED_OFF 1
  28. #define RT_DEVICE_CTRL_LED_TOGGLE 2
  29. void rt_hw_led_init(void);
  30. void rt_hw_led_on(rt_uint8_t num);
  31. void rt_hw_led_off(rt_uint8_t num);
  32. void rt_hw_led_toggle(rt_uint8_t num);
  33. void pwm_update(rt_uint16_t value);
  34. #endif