2009-05-15 21:47:12 +00:00
|
|
|
Status LED
|
|
|
|
========================================
|
|
|
|
|
|
|
|
This README describes the status LED API.
|
|
|
|
|
|
|
|
The API is defined by the include file include/status_led.h
|
|
|
|
|
|
|
|
The first step is to define CONFIG_STATUS_LED in the board config file.
|
|
|
|
|
|
|
|
If the LED support is only for a single board, define CONFIG_BOARD_SPECIFIC_LED
|
|
|
|
in the board config file.
|
|
|
|
|
2009-07-07 20:35:02 +00:00
|
|
|
At a minimum, these macros must be defined at
|
2009-05-15 21:47:12 +00:00
|
|
|
STATUS_LED_BIT
|
|
|
|
STATUS_LED_STATE
|
|
|
|
STATUS_LED_PERIOD
|
|
|
|
|
|
|
|
If there are multiple status LED's define
|
|
|
|
STATUS_LED_BIT<n>
|
|
|
|
STATUS_LED_STATE<n>
|
|
|
|
STATUS_LED_PERIOD<n>
|
|
|
|
|
2009-07-07 20:35:02 +00:00
|
|
|
Where <n> can a integer 1 through 3.
|
2009-05-15 21:47:12 +00:00
|
|
|
|
|
|
|
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 STATUS_LED_BIT's. Mapping the value to a physical LED is the
|
|
|
|
reponsiblity of the __led_* function.
|
|
|
|
|
|
|
|
STATUS_LED_STATE is the initial state of the LED. It should be set to one of
|
|
|
|
these values: STATUS_LED_OFF or STATUS_LED_ON.
|
|
|
|
|
|
|
|
STATUS_LED_PERIOD is how long is the LED blink period. This usually set to
|
|
|
|
(CONFIG_SYS_HZ / <N>) where <N> is the frequency of the blink. Typical values
|
|
|
|
range from 2 to 10.
|
|
|
|
|
|
|
|
Some other LED macros
|
|
|
|
|
|
|
|
STATUS_LED_BOOT is the LED to light when the board is booting. This must be a
|
2009-07-07 20:35:02 +00:00
|
|
|
valid STATUS_LED_BIT value.
|
2009-05-15 21:47:12 +00:00
|
|
|
|
|
|
|
STATUS_LED_RED is the red LED. It is used signal errors. This must be a valid
|
|
|
|
STATUS_LED_BIT value. Other similar color LED's are STATUS_LED_YELLOW and
|
2009-07-07 20:35:02 +00:00
|
|
|
STATUS_LED_BLUE.
|
2009-05-15 21:47:12 +00:00
|
|
|
|
|
|
|
These board must define these functions
|
|
|
|
|
|
|
|
__led_init is called once to initialize the LED to STATUS_LED_STATE. One time
|
|
|
|
start up code should be placed here.
|
|
|
|
|
2009-07-07 20:35:02 +00:00
|
|
|
__led_set is called to change the state of the LED.
|
2009-05-15 21:47:12 +00:00
|
|
|
|
|
|
|
__led_toggle is called to toggle the current state of the LED.
|
|
|
|
|
|
|
|
Colour LED
|
|
|
|
========================================
|
|
|
|
|
2009-07-07 20:35:02 +00:00
|
|
|
Colour LED's are at present only used by ARM.
|
2009-05-15 21:47:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-04-13 03:28:04 +00:00
|
|
|
These are weakly defined in arch/arm/lib/board.c to noops. Where applicable, define
|
2009-05-15 21:47:12 +00:00
|
|
|
these functions in the board specific source.
|
|
|
|
|
|
|
|
TBD : Describe older board dependent macros similar to what is done for
|
|
|
|
CONFIG_TQM8xxL.
|
|
|
|
|
|
|
|
TBD : Describe general support via asm/status_led.h
|