]> git.ipfire.org Git - people/ms/u-boot.git/blame - doc/README.LED
Merge git://git.denx.de/u-boot-mmc
[people/ms/u-boot.git] / doc / README.LED
CommitLineData
65fd21c8
TR
1Status LED
2========================================
3
4This README describes the status LED API.
5
6The API is defined by the include file include/status_led.h
7
79267edd
UM
8The first step is to enable CONFIG_LED_STATUS in menuconfig:
9> Device Drivers > LED Support.
65fd21c8 10
79267edd
UM
11If the LED support is only for specific board, enable
12CONFIG_LED_STATUS_BOARD_SPECIFIC in the menuconfig.
65fd21c8 13
79267edd
UM
14Status LEDS 0 to 5 are enabled by the following configurations at menuconfig:
15CONFIG_STATUS_LED0, CONFIG_STATUS_LED1, ... CONFIG_STATUS_LED5
65fd21c8 16
79267edd
UM
17The 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).
65fd21c8 22
79267edd
UM
23CONFIG_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
65fd21c8
TR
26reponsiblity of the __led_* function.
27
79267edd
UM
28CONFIG_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.
65fd21c8 30
79267edd
UM
31CONFIG_STATUS_LED_FREQ determines the LED blink frequency.
32Values range from 2 to 10.
65fd21c8
TR
33
34Some other LED macros
79267edd 35---------------------
65fd21c8 36
79267edd
UM
37CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting.
38This must be a valid LED number (0-5).
65fd21c8 39
79267edd
UM
40CONFIG_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.
65fd21c8 43
79267edd
UM
44General LED functions
45---------------------
46The following functions should be defined:
65fd21c8 47
79267edd
UM
48__led_init is called once to initialize the LED to CONFIG_STATUS_LED_STATE.
49One time start up code should be placed here.
65fd21c8 50
8e5e9b94 51__led_set is called to change the state of the LED.
65fd21c8
TR
52
53__led_toggle is called to toggle the current state of the LED.
54
55Colour LED
56========================================
57
8e5e9b94 58Colour LED's are at present only used by ARM.
65fd21c8
TR
59
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
ea0364f1 72These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
65fd21c8
TR
73these functions in the board specific source.
74
75TBD : Describe older board dependent macros similar to what is done for
65fd21c8
TR
76
77TBD : Describe general support via asm/status_led.h