dev_led.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /***************************************************************************//**
  2. * @file dev_led.h
  3. * @brief LED driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. * @author onelife
  6. * @version 1.0
  7. *******************************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. *******************************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2009-01-05 Bernard the first version
  15. * 2010-12-27 onelife Modify for EFM32
  16. * 2011-05-06 onelife Add EFM32 development kit support
  17. * 2011-12-08 onelife Add giant gecko development kit support
  18. ******************************************************************************/
  19. #ifndef __DEV_LED_H__
  20. #define __DEV_LED_H__
  21. /* Includes ------------------------------------------------------------------*/
  22. /* Exported types ------------------------------------------------------------*/
  23. /* Exported constants --------------------------------------------------------*/
  24. /* Exported macro ------------------------------------------------------------*/
  25. #if defined(EFM32_G8XX_STK)
  26. #define LEDS_MAX_NUMBER (4)
  27. /* Configure GPIO port C 0-3 for LEDs */
  28. #define LEDS_PIN_PORT_0 gpioPortC
  29. #define LEDS_PIN_NUMBER_0 (0)
  30. #define LEDS_PIN_PORT_1 gpioPortC
  31. #define LEDS_PIN_NUMBER_1 (1)
  32. #define LEDS_PIN_PORT_2 gpioPortC
  33. #define LEDS_PIN_NUMBER_2 (2)
  34. #define LEDS_PIN_PORT_3 gpioPortC
  35. #define LEDS_PIN_NUMBER_3 (3)
  36. #elif (defined(EFM32_GXXX_DK) || defined(EFM32GG_DK3750))
  37. #define LEDS_MAX_NUMBER (16)
  38. #endif
  39. /* Exported functions ------------------------------------------------------- */
  40. rt_err_t rt_hw_led_init(void);
  41. void rt_hw_led_on(rt_uint8_t num);
  42. void rt_hw_led_off(rt_uint8_t num);
  43. void rt_hw_led_toggle(rt_uint8_t num);
  44. rt_uint8_t rt_hw_led_state(rt_uint8_t num);
  45. #endif /* __DEV_LED_H__ */