AM62Ax MCU+ SDK  10.01.00
LED

The LED driver provides API to control I2C/GPIO based LED present in the board. The driver supports multiple LED control for the LEDs connected to the same I2C controller using a single API which can be used to set LED ON/OFF for multiple LED at the same time.

Features Supported

  • API to turn ON/OFF LED
  • Set LED mask using single API to set the LED state of multiple LEDs connected to same controller at one go

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • Option to select LED type based on board
  • Supported LED
    • GPIO
    • TPIC2810 (I2C based)
    • IO Expander: TCA6424 (I2C based)
  • Based on the type of LED controller selected, the GPIO or I2C driver can be configured
  • In case of IO Expander based LED control, provides option to select the pin to which the LED is connected
  • In case of I2C based LED controller, ability to provide the I2C slave address of the controller

Features NOT Supported

  • Set mask API is not supported for GPIO based LED as typically only one LED is connected to a single instance of GPIO pin

Important Usage Guidelines

None

Example Usage

Include the below file to access the APIs

#include <board/led.h>

LED ON API

LED OFF API

API

APIs for I2C/GPIO based LED driver

status
uint32_t status
Definition: tisci_lpm.h:1
LED_on
int32_t LED_on(LED_Handle handle, uint32_t index)
API to power on the LED.
LED_off
int32_t LED_off(LED_Handle handle, uint32_t index)
API to power off the LED.
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
led.h
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:175