blob: c21c9d53ec35b14a3fdc24709c0a8bcb39ab4f55 [file] [log] [blame]
Tom Rixc36db312009-05-15 23:47:12 +02001Status LED
2========================================
3
4This README describes the status LED API.
5
6The API is defined by the include file include/status_led.h
7
Uri Mashiach3dc6f652017-01-19 10:51:05 +02008The first step is to enable CONFIG_LED_STATUS in menuconfig:
9> Device Drivers > LED Support.
Tom Rixc36db312009-05-15 23:47:12 +020010
Uri Mashiach3dc6f652017-01-19 10:51:05 +020011If the LED support is only for specific board, enable
12CONFIG_LED_STATUS_BOARD_SPECIFIC in the menuconfig.
Tom Rixc36db312009-05-15 23:47:12 +020013
Uri Mashiach3dc6f652017-01-19 10:51:05 +020014Status LEDS 0 to 5 are enabled by the following configurations at menuconfig:
15CONFIG_STATUS_LED0, CONFIG_STATUS_LED1, ... CONFIG_STATUS_LED5
Tom Rixc36db312009-05-15 23:47:12 +020016
Uri Mashiach3dc6f652017-01-19 10:51:05 +020017The following should be configured for each of the enabled LEDs:
18CONFIG_STATUS_LED_BIT<n>
19CONFIG_STATUS_LED_STATE<n>
20CONFIG_STATUS_LED_FREQ<n>
21Where <n> is an integer 1 through 5 (empty for 0).
Tom Rixc36db312009-05-15 23:47:12 +020022
Uri Mashiach3dc6f652017-01-19 10:51:05 +020023CONFIG_STATUS_LED_BIT is passed into the __led_* functions to identify which LED
24is being acted on. As such, the value choose must be unique with with respect to
25the other CONFIG_STATUS_LED_BIT's. Mapping the value to a physical LED is the
Tom Rixc36db312009-05-15 23:47:12 +020026reponsiblity of the __led_* function.
27
Uri Mashiach3dc6f652017-01-19 10:51:05 +020028CONFIG_STATUS_LED_STATE is the initial state of the LED. It should be set to one
29of these values: CONFIG_LED_STATUS_OFF or CONFIG_LED_STATUS_ON.
Tom Rixc36db312009-05-15 23:47:12 +020030
Uri Mashiach3dc6f652017-01-19 10:51:05 +020031CONFIG_STATUS_LED_FREQ determines the LED blink frequency.
32Values range from 2 to 10.
Tom Rixc36db312009-05-15 23:47:12 +020033
34Some other LED macros
Uri Mashiach3dc6f652017-01-19 10:51:05 +020035---------------------
Tom Rixc36db312009-05-15 23:47:12 +020036
Uri Mashiach3dc6f652017-01-19 10:51:05 +020037CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting.
38This must be a valid LED number (0-5).
Tom Rixc36db312009-05-15 23:47:12 +020039
Uri Mashiach3dc6f652017-01-19 10:51:05 +020040CONFIG_STATUS_LED_RED is the red LED. It is used to signal errors. This must be
41a valid LED number (0-5). Other similar color LED's macros are
42CONFIG_STATUS_LED_GREEN, CONFIG_STATUS_LED_YELLOW and CONFIG_STATUS_LED_BLUE.
Tom Rixc36db312009-05-15 23:47:12 +020043
Uri Mashiach3dc6f652017-01-19 10:51:05 +020044General LED functions
45---------------------
46The following functions should be defined:
Tom Rixc36db312009-05-15 23:47:12 +020047
Uri Mashiach3dc6f652017-01-19 10:51:05 +020048__led_init is called once to initialize the LED to CONFIG_STATUS_LED_STATE.
49One time start up code should be placed here.
Tom Rixc36db312009-05-15 23:47:12 +020050
Wolfgang Denk1d695be2009-07-07 22:35:02 +020051__led_set is called to change the state of the LED.
Tom Rixc36db312009-05-15 23:47:12 +020052
53__led_toggle is called to toggle the current state of the LED.
54
55Colour LED
56========================================
57
Wolfgang Denk1d695be2009-07-07 22:35:02 +020058Colour LED's are at present only used by ARM.
Tom Rixc36db312009-05-15 23:47:12 +020059
60The functions names explain their purpose.
61
62coloured_LED_init
63red_LED_on
64red_LED_off
65green_LED_on
66green_LED_off
67yellow_LED_on
68yellow_LED_off
69blue_LED_on
70blue_LED_off
71
Peter Tysercede5d82010-04-12 22:28:04 -050072These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
Tom Rixc36db312009-05-15 23:47:12 +020073these functions in the board specific source.
74
75TBD : Describe older board dependent macros similar to what is done for
Tom Rixc36db312009-05-15 23:47:12 +020076
77TBD : Describe general support via asm/status_led.h