# Application Board LEDs
[Libraries]

The Application Board LED subsystem controls the 4 LEDs on the Application Board, for status and program feedback. More...

## Functions
int | AppLed_SetActive (int index, int state)
| Enable an LED in the AppLed subsystem.
int | AppLed_GetActive (int index)
| Read whether an AppLed is enabled.
int | AppLed_SetState (int index, int state)
| Turn an LED on or off.
int | AppLed_GetState (int index)
| Read whether an LED is on or off.

## Detailed Description

The Application Board LED subsystem controls the 4 LEDs on the Application Board, for status and program feedback.

## Function Documentation

int AppLed_GetActive | ( | int | index | ) |

Read whether an AppLed is enabled.

Parameters:

  | index | An integer specifying which LED (0-3).

Returns:
  Zero if available, otherwise non-zero.

Example

      if(AppLed_GetActive(1))
      {
        // LED 1 is enabled
      }
      else
      {
        // LED 1 is not enabled
      }

Definition at line 104 of file appled.c.

int AppLed_GetState | ( | int | index | ) |

Read whether an LED is on or off.

Parameters:

  | index | An integer specifying which LED (0-3).

Returns:
  the LED state, or zero on error.

Example

      if(AppLed_GetState(2))
      {
        // LED 2 is currently on
      }
      else
      {
        // LED 2 is currently off
      }

Definition at line 164 of file appled.c.

int AppLed_SetActive | ( | int | index,
|  | int | state |
| ) |  |  |

Enable an LED in the AppLed subsystem.

Parameters:

  | index | An integer specifying which LED (0-3).
  | state | An integer specifying locked/active (1) or unlocked/inactive (0).

Returns:
  Zero on success.

Example

      // enable LED 0
      AppLed_SetActive(0, 1);

Definition at line 76 of file appled.c.

int AppLed_SetState | ( | int | index,
|  | int | state |
| ) |  |  |

Turn an LED on or off.

Sets whether the specified LED on the Application Board is on or off.

Parameters:

  | index | an integer specifying which LED (0-3).
  | state | an integer specifying on (1) or off (0).

Returns:
  Zero on success, otherwise error code.

Example

      // turn on LED 2
      AppLed_SetState( 2, 1 );

Definition at line 124 of file appled.c.