LED

group npmx_led

LED peripheral driver.

Enums

enum npmx_led_mode_t

Possible LED working modes.

Values:

enumerator NPMX_LED_MODE_ERROR

Charging error indicator.

enumerator NPMX_LED_MODE_CHARGING

Charging indicator (ON during charging).

enumerator NPMX_LED_MODE_HOST

Driven from register LEDDRV_x_SET/CLR.

enumerator NPMX_LED_MODE_NOTUSED

Not used.

enumerator NPMX_LED_MODE_COUNT

LED working modes count.

enumerator NPMX_LED_MODE_INVALID

Invalid LED working mode.

Functions

npmx_led_t *npmx_led_get(npmx_instance_t *p_pmic, uint8_t idx)

Function for returning LED instance based on index.

Parameters:
  • p_pmic[in] Pointer to the PMIC instance.

  • idx[in] Index of the LED instance.

Returns:

Pointer to the LED instance.

npmx_error_t npmx_led_mode_set(npmx_led_t const *p_instance, npmx_led_mode_t mode)

Function for setting the mode of specified LED instance.

Parameters:
  • p_instance[in] Pointer to the LED instance.

  • mode[in] Mode of the LED to be set.

Return values:
  • NPMX_SUCCESS – Operation performed successfully.

  • NPMX_ERROR_IO – Error using IO bus line.

npmx_error_t npmx_led_mode_get(npmx_led_t const *p_instance, npmx_led_mode_t *p_mode)

Function for reading the mode of specified LED instance.

Parameters:
  • p_instance[in] Pointer to the LED instance.

  • p_mode[in] Pointer to the mode of the LED.

Return values:
  • NPMX_SUCCESS – Operation performed successfully.

  • NPMX_ERROR_IO – Error using IO bus line.

npmx_error_t npmx_led_state_set(npmx_led_t const *p_instance, bool state)

Function for setting the state of specified LED instance.

Note

This function can be called only after calling npmx_led_mode_set() with NPMX_LED_MODE_HOST.

Parameters:
  • p_instance[in] Pointer to the LED instance.

  • state[in] True to enable LED current source, false to disable.

Return values:
  • NPMX_SUCCESS – Operation performed successfully.

  • NPMX_ERROR_IO – Error using IO bus line.

struct npmx_led_t
#include <npmx_led.h>

Data structure of the LED driver instance.

Public Members

npmx_backend_t *p_backend

Pointer to backend instance.

uint8_t hw_index

Hardware index of LED instance.