npmx  1.0.0
 
Loading...
Searching...
No Matches

LED peripheral driver. More...

Data Structures

struct  npmx_led_t
 Data structure of the LED driver instance. More...
 

Enumerations

enum  npmx_led_mode_t {
  NPMX_LED_MODE_ERROR = LEDDRV_LEDDRV1MODESEL_LEDDRV1MODESEL_ERROR ,
  NPMX_LED_MODE_CHARGING = LEDDRV_LEDDRV1MODESEL_LEDDRV1MODESEL_CHARGING ,
  NPMX_LED_MODE_HOST = LEDDRV_LEDDRV1MODESEL_LEDDRV1MODESEL_HOST ,
  NPMX_LED_MODE_NOTUSED = LEDDRV_LEDDRV1MODESEL_LEDDRV1MODESEL_NOTUSED ,
  NPMX_LED_MODE_COUNT ,
  NPMX_LED_MODE_INVALID = NPMX_INVALID_ENUM_VALUE
}
 Possible LED working modes. More...
 

Functions

npmx_led_tnpmx_led_get (npmx_instance_t *p_pmic, uint8_t idx)
 Function for returning LED instance based on index.
 
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.
 
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.
 
npmx_error_t npmx_led_state_set (npmx_led_t const *p_instance, bool state)
 Function for setting the state of specified LED instance.
 

Detailed Description

LED peripheral driver.

Enumeration Type Documentation

◆ npmx_led_mode_t

Possible LED working modes.

Enumerator
NPMX_LED_MODE_ERROR 

Charging error indicator.

NPMX_LED_MODE_CHARGING 

Charging indicator (ON during charging).

NPMX_LED_MODE_HOST 

Driven from register LEDDRV_x_SET/CLR.

NPMX_LED_MODE_NOTUSED 

Not used.

NPMX_LED_MODE_COUNT 

LED working modes count.

NPMX_LED_MODE_INVALID 

Invalid LED working mode.

Function Documentation

◆ npmx_led_get()

npmx_led_t * npmx_led_get ( npmx_instance_t * p_pmic,
uint8_t idx )

Function for returning LED instance based on index.

Parameters
[in]p_pmicPointer to the PMIC instance.
[in]idxIndex of the LED instance.
Returns
Pointer to the LED instance.

◆ npmx_led_mode_get()

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
[in]p_instancePointer to the LED instance.
[in]p_modePointer to the mode of the LED.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_led_mode_set()

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
[in]p_instancePointer to the LED instance.
[in]modeMode of the LED to be set.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_led_state_set()

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
[in]p_instancePointer to the LED instance.
[in]stateTrue to enable LED current source, false to disable.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.