led.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. /* LED */
  19. #define USER_LED1 (1UL<<0x9)
  20. #define USER_LED2 (1UL<<0xa)
  21. #define USER_LED3 (1UL<<0xb)
  22. #define USER_LED_MASK (USER_LED1 | USER_LED2 | USER_LED3)
  23. #define USER_LED_PFR FM3_GPIO->PFR1
  24. #define USER_LED_PCR FM3_GPIO->PCR1
  25. #define USER_LED_PDOR FM3_GPIO->PDOR1
  26. #define USER_LED_DDR FM3_GPIO->DDR1
  27. #define RT_DEVICE_CTRL_LED_ON 0
  28. #define RT_DEVICE_CTRL_LED_OFF 1
  29. #define RT_DEVICE_CTRL_LED_TOGGLE 2
  30. void rt_hw_led_init(void);
  31. void rt_hw_led_on(rt_uint8_t num);
  32. void rt_hw_led_off(rt_uint8_t num);
  33. void rt_hw_led_toggle(rt_uint8_t num);
  34. void pwm_update(rt_uint16_t value);
  35. #endif