Board Support  Version 1.0
Functions available when using the Board Software Components
 All Data Structures Functions Variables Groups Pages

LED Interface: control up to 32 status LEDs. More...

Functions

int32_t LED_Initialize (void)
 Initialize I/O interface for LEDs. More...
 
int32_t LED_Uninitialize (void)
 De-initialize I/O interface for LEDs. More...
 
int32_t LED_On (uint32_t num)
 Turn on a single LED indicated by num. More...
 
int32_t LED_Off (uint32_t num)
 Turn off a single LED indicated by num. More...
 
int32_t LED_SetOut (uint32_t val)
 Control all LEDs with the bit vector val. More...
 
uint32_t LED_GetCount (void)
 Get number of available LEDs on evaluation hardware. More...
 

Description

LED Interface: control up to 32 status LEDs.

LED driver functions can be used to control the LEDs on an evaluation board. Up to 32 status LEDs that are typically connect to I/O pins of the microcontroller. The first LED has the index number 0.

Function Documentation

int32_t LED_GetCount ( void  )

Get number of available LEDs on evaluation hardware.

Returns
Number of available LEDs

The function returns the number of available LEDs on the board.

int32_t LED_Initialize ( void  )

Initialize I/O interface for LEDs.

Returns
  • 0: function succeeded
  • -1: function failed

The function initializes the I/O pins required for addressing the LEDs. The function returns an integer value of 0 on success, and -1 on error.

int32_t LED_Off ( uint32_t  num)

Turn off a single LED indicated by num.

Parameters
[in]numLED number
Returns
  • 0: function succeeded
  • -1: function failed

Switch off the LED with the number num. This parameter is an integer ranging from [0..(LED_GetCount - 1)]. The function returns an integer value of 0 on success, and -1 on error.

int32_t LED_On ( uint32_t  num)

Turn on a single LED indicated by num.

Parameters
[in]numLED number
Returns
  • 0: function succeeded
  • -1: function failed

Switch on the LED with the number num. The value range of the parameter num is [0..(LED_GetCount - 1)]. The function returns an integer value of 0 on success, and -1 on error.

int32_t LED_SetOut ( uint32_t  val)

Control all LEDs with the bit vector val.

Parameters
[in]valeach bit represents the status of one LED.
Returns
  • 0: function succeeded
  • -1: function failed

Set outputs of all LEDs simultaneously. The parameter val encodes the bit value for each LED to turn it on or off. Bit 0 refers to the first LED of the evaluation board. The function returns an integer value of 0 on success, and -1 on error.

int32_t LED_Uninitialize ( void  )

De-initialize I/O interface for LEDs.

Returns
  • 0: function succeeded
  • -1: function failed

The function de-initializes the I/O pins used for addressing the LEDs. The function returns an integer value of 0 on success, and -1 on error.