Blame view

doc/README.LED 2.38 KB
65fd21c80   Tom Rix   LED Add documenta...
1
2
3
4
5
6
  Status LED
  ========================================
  
  This README describes the status LED API.
  
  The API is defined by the include file include/status_led.h
79267edd1   Uri Mashiach   status_led: Kconf...
7
8
  The first step is to enable CONFIG_LED_STATUS in menuconfig:
  > Device Drivers > LED Support.
65fd21c80   Tom Rix   LED Add documenta...
9

79267edd1   Uri Mashiach   status_led: Kconf...
10
11
  If the LED support is only for specific board, enable
  CONFIG_LED_STATUS_BOARD_SPECIFIC in the menuconfig.
65fd21c80   Tom Rix   LED Add documenta...
12

79267edd1   Uri Mashiach   status_led: Kconf...
13
14
  Status LEDS 0 to 5 are enabled by the following configurations at menuconfig:
  CONFIG_STATUS_LED0, CONFIG_STATUS_LED1, ... CONFIG_STATUS_LED5
65fd21c80   Tom Rix   LED Add documenta...
15

79267edd1   Uri Mashiach   status_led: Kconf...
16
17
18
19
20
  The following should be configured for each of the enabled LEDs:
  CONFIG_STATUS_LED_BIT<n>
  CONFIG_STATUS_LED_STATE<n>
  CONFIG_STATUS_LED_FREQ<n>
  Where <n> is an integer 1 through 5 (empty for 0).
65fd21c80   Tom Rix   LED Add documenta...
21

79267edd1   Uri Mashiach   status_led: Kconf...
22
23
24
  CONFIG_STATUS_LED_BIT is passed into the __led_* functions to identify which LED
  is being acted on. As such, the value choose must be unique with with respect to
  the other CONFIG_STATUS_LED_BIT's. Mapping the value to a physical LED is the
65fd21c80   Tom Rix   LED Add documenta...
25
  reponsiblity of the __led_* function.
79267edd1   Uri Mashiach   status_led: Kconf...
26
27
  CONFIG_STATUS_LED_STATE is the initial state of the LED. It should be set to one
  of these values: CONFIG_LED_STATUS_OFF or CONFIG_LED_STATUS_ON.
65fd21c80   Tom Rix   LED Add documenta...
28

79267edd1   Uri Mashiach   status_led: Kconf...
29
30
  CONFIG_STATUS_LED_FREQ determines the LED blink frequency.
  Values range from 2 to 10.
65fd21c80   Tom Rix   LED Add documenta...
31
32
  
  Some other LED macros
79267edd1   Uri Mashiach   status_led: Kconf...
33
  ---------------------
65fd21c80   Tom Rix   LED Add documenta...
34

79267edd1   Uri Mashiach   status_led: Kconf...
35
36
  CONFIG_STATUS_LED_BOOT is the LED to light when the board is booting.
  This must be a valid LED number (0-5).
65fd21c80   Tom Rix   LED Add documenta...
37

79267edd1   Uri Mashiach   status_led: Kconf...
38
39
40
  CONFIG_STATUS_LED_RED is the red LED. It is used to signal errors. This must be
  a valid LED number (0-5). Other similar color LED's macros are
  CONFIG_STATUS_LED_GREEN, CONFIG_STATUS_LED_YELLOW and CONFIG_STATUS_LED_BLUE.
65fd21c80   Tom Rix   LED Add documenta...
41

79267edd1   Uri Mashiach   status_led: Kconf...
42
43
44
  General LED functions
  ---------------------
  The following functions should be defined:
65fd21c80   Tom Rix   LED Add documenta...
45

79267edd1   Uri Mashiach   status_led: Kconf...
46
47
  __led_init is called once to initialize the LED to CONFIG_STATUS_LED_STATE.
  One time start up code should be placed here.
65fd21c80   Tom Rix   LED Add documenta...
48

8e5e9b940   Wolfgang Denk   Coding style clea...
49
  __led_set is called to change the state of the LED.
65fd21c80   Tom Rix   LED Add documenta...
50
51
52
53
54
  
  __led_toggle is called to toggle the current state of the LED.
  
  Colour LED
  ========================================
8e5e9b940   Wolfgang Denk   Coding style clea...
55
  Colour LED's are at present only used by ARM.
65fd21c80   Tom Rix   LED Add documenta...
56
57
58
59
60
61
62
63
64
65
66
67
  
  The functions names explain their purpose.
  
  coloured_LED_init
  red_LED_on
  red_LED_off
  green_LED_on
  green_LED_off
  yellow_LED_on
  yellow_LED_off
  blue_LED_on
  blue_LED_off
ea0364f1b   Peter Tyser   Move lib_$ARCH di...
68
  These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
65fd21c80   Tom Rix   LED Add documenta...
69
70
71
  these functions in the board specific source.
  
  TBD : Describe older board dependent macros similar to what is done for
65fd21c80   Tom Rix   LED Add documenta...
72
73
  
  TBD : Describe general support via asm/status_led.h