dev_led.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /******************************************************************//**
  2. * @file dev_led.h
  3. * @brief LED driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. * @author Bernard, onelife
  6. * @version 0.4 beta
  7. **********************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file LICENSE in this
  10. * 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. *********************************************************************/
  18. #ifndef __DEV_LED_H__
  19. #define __DEV_LED_H__
  20. /* Includes -------------------------------------------------------------------*/
  21. /* Exported types -------------------------------------------------------------*/
  22. /* Exported constants ---------------------------------------------------------*/
  23. /* Exported macro -------------------------------------------------------------*/
  24. #if defined(EFM32_G890_STK)
  25. #define LEDS_MAX_NUMBER (4)
  26. /* Configure GPIO port C 0-3 for LEDs */
  27. #define LEDS_PIN_PORT_0 gpioPortC
  28. #define LEDS_PIN_NUMBER_0 (0)
  29. #define LEDS_PIN_PORT_1 gpioPortC
  30. #define LEDS_PIN_NUMBER_1 (1)
  31. #define LEDS_PIN_PORT_2 gpioPortC
  32. #define LEDS_PIN_NUMBER_2 (2)
  33. #define LEDS_PIN_PORT_3 gpioPortC
  34. #define LEDS_PIN_NUMBER_3 (3)
  35. #elif defined(EFM32_G290_DK)
  36. #define LEDS_MAX_NUMBER (16)
  37. #endif
  38. /* Exported functions --------------------------------------------------------- */
  39. rt_err_t rt_hw_led_init(void);
  40. void rt_hw_led_on(rt_uint8_t num);
  41. void rt_hw_led_off(rt_uint8_t num);
  42. void rt_hw_led_toggle(rt_uint8_t num);
  43. rt_uint8_t rt_hw_led_state(rt_uint8_t num);
  44. #endif /* __DEV_LED_H__ */