README.LED 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Status LED
  2. ========================================
  3. This README describes the status LED API.
  4. The API is defined by the include file include/status_led.h
  5. The first step is to enable CONFIG_LED_STATUS in menuconfig:
  6. > Device Drivers > LED Support.
  7. If the LED support is only for specific board, enable
  8. CONFIG_LED_STATUS_BOARD_SPECIFIC in the menuconfig.
  9. Status LEDS 0 to 5 are enabled by the following configurations at menuconfig:
  10. CONFIG_STATUS_LED0, CONFIG_STATUS_LED1, ... CONFIG_STATUS_LED5
  11. The following should be configured for each of the enabled LEDs:
  12. CONFIG_STATUS_LED_BIT<n>
  13. CONFIG_STATUS_LED_STATE<n>
  14. CONFIG_STATUS_LED_FREQ<n>
  15. Where <n> is an integer 1 through 5 (empty for 0).
  16. CONFIG_STATUS_LED_BIT is passed into the __led_* functions to identify which LED
  17. is being acted on. As such, the value choose must be unique with with respect to
  18. the other CONFIG_STATUS_LED_BIT's. Mapping the value to a physical LED is the
  19. reponsiblity of the __led_* function.
  20. CONFIG_STATUS_LED_STATE is the initial state of the LED. It should be set to one
  21. of these values: CONFIG_LED_STATUS_OFF or CONFIG_LED_STATUS_ON.
  22. CONFIG_STATUS_LED_FREQ determines the LED blink frequency.
  23. Values range from 2 to 10.
  24. Some other LED macros
  25. ---------------------
  26. CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting.
  27. This must be a valid LED number (0-5).
  28. CONFIG_STATUS_LED_RED is the red LED. It is used to signal errors. This must be
  29. a valid LED number (0-5). Other similar color LED's macros are
  30. CONFIG_STATUS_LED_GREEN, CONFIG_STATUS_LED_YELLOW and CONFIG_STATUS_LED_BLUE.
  31. General LED functions
  32. ---------------------
  33. The following functions should be defined:
  34. __led_init is called once to initialize the LED to CONFIG_STATUS_LED_STATE.
  35. One time start up code should be placed here.
  36. __led_set is called to change the state of the LED.
  37. __led_toggle is called to toggle the current state of the LED.
  38. Colour LED
  39. ========================================
  40. Colour LED's are at present only used by ARM.
  41. The functions names explain their purpose.
  42. coloured_LED_init
  43. red_LED_on
  44. red_LED_off
  45. green_LED_on
  46. green_LED_off
  47. yellow_LED_on
  48. yellow_LED_off
  49. blue_LED_on
  50. blue_LED_off
  51. These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
  52. these functions in the board specific source.
  53. TBD : Describe older board dependent macros similar to what is done for
  54. TBD : Describe general support via asm/status_led.h