Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 1 | Status LED |
| 2 | ======================================== |
| 3 | |
| 4 | This README describes the status LED API. |
| 5 | |
| 6 | The API is defined by the include file include/status_led.h |
| 7 | |
| 8 | The first step is to define CONFIG_STATUS_LED in the board config file. |
| 9 | |
| 10 | If the LED support is only for a single board, define CONFIG_BOARD_SPECIFIC_LED |
| 11 | in the board config file. |
| 12 | |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 13 | At a minimum, these macros must be defined at |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 14 | STATUS_LED_BIT |
| 15 | STATUS_LED_STATE |
| 16 | STATUS_LED_PERIOD |
| 17 | |
| 18 | If there are multiple status LED's define |
| 19 | STATUS_LED_BIT<n> |
| 20 | STATUS_LED_STATE<n> |
| 21 | STATUS_LED_PERIOD<n> |
| 22 | |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 23 | Where <n> can a integer 1 through 3. |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 24 | |
| 25 | STATUS_LED_BIT is passed into the __led_* functions to identify which LED is |
| 26 | being acted on. As such, the value choose must be unique with with respect to |
| 27 | the other STATUS_LED_BIT's. Mapping the value to a physical LED is the |
| 28 | reponsiblity of the __led_* function. |
| 29 | |
| 30 | STATUS_LED_STATE is the initial state of the LED. It should be set to one of |
| 31 | these values: STATUS_LED_OFF or STATUS_LED_ON. |
| 32 | |
| 33 | STATUS_LED_PERIOD is how long is the LED blink period. This usually set to |
| 34 | (CONFIG_SYS_HZ / <N>) where <N> is the frequency of the blink. Typical values |
| 35 | range from 2 to 10. |
| 36 | |
| 37 | Some other LED macros |
| 38 | |
| 39 | STATUS_LED_BOOT is the LED to light when the board is booting. This must be a |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 40 | valid STATUS_LED_BIT value. |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 41 | |
| 42 | STATUS_LED_RED is the red LED. It is used signal errors. This must be a valid |
| 43 | STATUS_LED_BIT value. Other similar color LED's are STATUS_LED_YELLOW and |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 44 | STATUS_LED_BLUE. |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 45 | |
| 46 | These board must define these functions |
| 47 | |
| 48 | __led_init is called once to initialize the LED to STATUS_LED_STATE. One time |
| 49 | start up code should be placed here. |
| 50 | |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 51 | __led_set is called to change the state of the LED. |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 52 | |
| 53 | __led_toggle is called to toggle the current state of the LED. |
| 54 | |
| 55 | Colour LED |
| 56 | ======================================== |
| 57 | |
Wolfgang Denk | 1d695be | 2009-07-07 22:35:02 +0200 | [diff] [blame] | 58 | Colour LED's are at present only used by ARM. |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 59 | |
| 60 | The functions names explain their purpose. |
| 61 | |
| 62 | coloured_LED_init |
| 63 | red_LED_on |
| 64 | red_LED_off |
| 65 | green_LED_on |
| 66 | green_LED_off |
| 67 | yellow_LED_on |
| 68 | yellow_LED_off |
| 69 | blue_LED_on |
| 70 | blue_LED_off |
| 71 | |
Peter Tyser | cede5d8 | 2010-04-12 22:28:04 -0500 | [diff] [blame] | 72 | These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define |
Tom Rix | c36db31 | 2009-05-15 23:47:12 +0200 | [diff] [blame] | 73 | these functions in the board specific source. |
| 74 | |
| 75 | TBD : Describe older board dependent macros similar to what is done for |
| 76 | CONFIG_TQM8xxL. |
| 77 | |
| 78 | TBD : Describe general support via asm/status_led.h |