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

Load switch (LDSW) peripheral driver. More...

Data Structures

struct  npmx_ldsw_t
 Data structure of the LDSW driver instance. More...
 
struct  npmx_ldsw_gpio_config_t
 Configuration structure for GPIO used as input signal for LDSW. More...
 
struct  npmx_ldsw_soft_start_config_t
 Configuration structure for soft start. More...
 

Enumerations

enum  npmx_ldsw_task_t {
  NPMX_LDSW_TASK_ENABLE ,
  NPMX_LDSW_TASK_DISABLE ,
  NPMX_LDSW_TASK_COUNT
}
 LDSW tasks. More...
 
enum  npmx_ldsw_gpio_t {
  NPMX_LDSW_GPIO_NC = LDSW_LDSW1GPISEL_LDSW1GPISEL_NOTUSED1 ,
  NPMX_LDSW_GPIO_0 = LDSW_LDSW1GPISEL_LDSW1GPISEL_GPIO0 ,
  NPMX_LDSW_GPIO_1 = LDSW_LDSW1GPISEL_LDSW1GPISEL_GPIO1 ,
  NPMX_LDSW_GPIO_2 = LDSW_LDSW1GPISEL_LDSW1GPISEL_GPIO2 ,
  NPMX_LDSW_GPIO_3 = LDSW_LDSW1GPISEL_LDSW1GPISEL_GPIO3 ,
  NPMX_LDSW_GPIO_4 = LDSW_LDSW1GPISEL_LDSW1GPISEL_GPIO4 ,
  NPMX_LDSW_GPIO_COUNT ,
  NPMX_LDSW_GPIO_INVALID = NPMX_INVALID_ENUM_VALUE
}
 Possible GPIO to be selected with LDSW configurations. More...
 
enum  npmx_ldsw_status_mask_t {
  NPMX_LDSW_STATUS_POWERUP_LDSW_1_MASK = LDSW_LDSWSTATUS_LDSW1PWRUPLDSW_Msk ,
  NPMX_LDSW_STATUS_POWERUP_LDO_1_MASK = LDSW_LDSWSTATUS_LDSW1PWRUPLDO_Msk ,
  NPMX_LDSW_STATUS_POWERUP_LDSW_2_MASK = LDSW_LDSWSTATUS_LDSW2PWRUPLDSW_Msk ,
  NPMX_LDSW_STATUS_POWERUP_LDO_2_MASK = LDSW_LDSWSTATUS_LDSW2PWRUPLDO_Msk ,
  NPMX_LDSW_STATUS_DEEPSLEEP_MASK = LDSW_LDSWSTATUS_LDSWENABLE_Msk
}
 LDSW status fields. More...
 
enum  npmx_ldsw_soft_start_current_t {
  NPMX_LDSW_SOFT_START_CURRENT_10_MA = LDSW_LDSWCONFIG_LDSW1SOFTSTARTSEL_10MA ,
  NPMX_LDSW_SOFT_START_CURRENT_20_MA = LDSW_LDSWCONFIG_LDSW1SOFTSTARTSEL_20MA ,
  NPMX_LDSW_SOFT_START_CURRENT_35_MA = LDSW_LDSWCONFIG_LDSW1SOFTSTARTSEL_35MA ,
  NPMX_LDSW_SOFT_START_CURRENT_50_MA = LDSW_LDSWCONFIG_LDSW1SOFTSTARTSEL_50MA ,
  NPMX_LDSW_SOFT_START_CURRENT_COUNT ,
  NPMX_LDSW_SOFT_START_CURRENT_DEFAULT = NPMX_LDSW_SOFT_START_CURRENT_10_MA ,
  NPMX_LDSW_SOFT_START_CURRENT_MAX = NPMX_LDSW_SOFT_START_CURRENT_50_MA ,
  NPMX_LDSW_SOFT_START_CURRENT_INVALID = NPMX_INVALID_ENUM_VALUE
}
 Possible LDSW soft start current levels. More...
 
enum  npmx_ldsw_voltage_t {
  NPMX_LDSW_VOLTAGE_1V0 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V ,
  NPMX_LDSW_VOLTAGE_1V1 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V1 ,
  NPMX_LDSW_VOLTAGE_1V2 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V2 ,
  NPMX_LDSW_VOLTAGE_1V3 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V3 ,
  NPMX_LDSW_VOLTAGE_1V4 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V4 ,
  NPMX_LDSW_VOLTAGE_1V5 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V5 ,
  NPMX_LDSW_VOLTAGE_1V6 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V6 ,
  NPMX_LDSW_VOLTAGE_1V7 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V7 ,
  NPMX_LDSW_VOLTAGE_1V8 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V8 ,
  NPMX_LDSW_VOLTAGE_1V9 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_1V9 ,
  NPMX_LDSW_VOLTAGE_2V0 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V ,
  NPMX_LDSW_VOLTAGE_2V1 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V1 ,
  NPMX_LDSW_VOLTAGE_2V2 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V2 ,
  NPMX_LDSW_VOLTAGE_2V3 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V3 ,
  NPMX_LDSW_VOLTAGE_2V4 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V4 ,
  NPMX_LDSW_VOLTAGE_2V5 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V5 ,
  NPMX_LDSW_VOLTAGE_2V6 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V6 ,
  NPMX_LDSW_VOLTAGE_2V7 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V7 ,
  NPMX_LDSW_VOLTAGE_2V8 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V8 ,
  NPMX_LDSW_VOLTAGE_2V9 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_2V9 ,
  NPMX_LDSW_VOLTAGE_3V0 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_3V ,
  NPMX_LDSW_VOLTAGE_3V1 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_3V1 ,
  NPMX_LDSW_VOLTAGE_3V2 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_3V2 ,
  NPMX_LDSW_VOLTAGE_3V3 = LDSW_LDSW1VOUTSEL_LDSW1VOUTSEL_3V3 ,
  NPMX_LDSW_VOLTAGE_COUNT ,
  NPMX_LDSW_VOLTAGE_DEFAULT = NPMX_LDSW_VOLTAGE_1V0 ,
  NPMX_LDSW_VOLTAGE_MAX = NPMX_LDSW_VOLTAGE_3V3 ,
  NPMX_LDSW_VOLTAGE_INVALID = NPMX_INVALID_ENUM_VALUE
}
 Possible LDO output voltages to be set. More...
 
enum  npmx_ldsw_mode_t {
  NPMX_LDSW_MODE_LOAD_SWITCH = LDSW_LDSW1LDOSEL_LDSW1LDOSEL_LDSW ,
  NPMX_LDSW_MODE_LDO = LDSW_LDSW1LDOSEL_LDSW1LDOSEL_LDO ,
  NPMX_LDSW_MODE_COUNT ,
  NPMX_LDSW_MODE_INVALID = NPMX_INVALID_ENUM_VALUE
}
 Possible LDSW modes. More...
 

Functions

npmx_ldsw_tnpmx_ldsw_get (npmx_instance_t *p_pmic, uint8_t idx)
 Function for returning LDSW instance based on index.
 
npmx_ldsw_voltage_t npmx_ldsw_voltage_convert (uint32_t millivolts)
 Function for converting millivolts to npmx_ldsw_voltage_t enumeration.
 
bool npmx_ldsw_voltage_convert_to_mv (npmx_ldsw_voltage_t enum_value, uint32_t *p_val)
 Function for converting npmx_ldsw_voltage_t enumeration to millivolts.
 
npmx_ldsw_soft_start_current_t npmx_ldsw_soft_start_current_convert (uint32_t milliamperes)
 Function for converting milliamperes to npmx_ldsw_soft_start_current_t enumeration.
 
bool npmx_ldsw_soft_start_current_convert_to_ma (npmx_ldsw_soft_start_current_t enum_value, uint32_t *p_val)
 Function for converting npmx_ldsw_soft_start_current_t enumeration to milliamperes.
 
npmx_error_t npmx_ldsw_task_trigger (npmx_ldsw_t const *p_instance, npmx_ldsw_task_t task)
 Function for activating the specified LDSW task.
 
npmx_error_t npmx_ldsw_enable_gpio_set (npmx_ldsw_t const *p_instance, npmx_ldsw_gpio_config_t const *p_config)
 Function for setting the GPIO pin which will be used for enabling and disabling the specified LDSW instance.
 
npmx_error_t npmx_ldsw_enable_gpio_get (npmx_ldsw_t const *p_instance, npmx_ldsw_gpio_config_t *p_config)
 Function for reading which GPIO pin will be used for enabling and disabling the specified LDSW instance.
 
npmx_error_t npmx_ldsw_status_get (npmx_ldsw_t const *p_instance, uint8_t *p_status_mask)
 Function for getting status for specified LDSW instance.
 
npmx_error_t npmx_ldsw_soft_start_config_set (npmx_ldsw_t const *p_instance, npmx_ldsw_soft_start_config_t const *p_config)
 Function for configuring soft start for given instance of LDSW.
 
npmx_error_t npmx_ldsw_soft_start_config_get (npmx_ldsw_t const *p_instance, npmx_ldsw_soft_start_config_t *p_config)
 Function for reading configuration of soft start for given instance of LDSW.
 
npmx_error_t npmx_ldsw_active_discharge_enable_set (npmx_ldsw_t const *p_instance, bool enable)
 Function for enabling and disabling active discharge for given instance of LDSW.
 
npmx_error_t npmx_ldsw_active_discharge_enable_get (npmx_ldsw_t const *p_instance, bool *p_enable)
 Function for reading if active discharge is enabled for given instance of LDSW.
 
npmx_error_t npmx_ldsw_mode_set (npmx_ldsw_t const *p_instance, npmx_ldsw_mode_t mode)
 Function for configuring given instance of LDSW to work as LDO or load switch.
 
npmx_error_t npmx_ldsw_mode_get (npmx_ldsw_t const *p_instance, npmx_ldsw_mode_t *p_mode)
 Function for reading if a given instance of LDSW works as LDO or load switch.
 
npmx_error_t npmx_ldsw_ldo_voltage_set (npmx_ldsw_t const *p_instance, npmx_ldsw_voltage_t voltage)
 Function for setting the output voltage of LDO for given instance of LDSW.
 
npmx_error_t npmx_ldsw_ldo_voltage_get (npmx_ldsw_t const *p_instance, npmx_ldsw_voltage_t *p_voltage)
 Function for getting the output voltage of LDO for given instance of LDSW.
 

Detailed Description

Load switch (LDSW) peripheral driver.

Enumeration Type Documentation

◆ npmx_ldsw_gpio_t

Possible GPIO to be selected with LDSW configurations.

Enumerator
NPMX_LDSW_GPIO_NC 

No GPIO selected.

NPMX_LDSW_GPIO_0 

GPIO_0 selected.

NPMX_LDSW_GPIO_1 

GPIO_1 selected.

NPMX_LDSW_GPIO_2 

GPIO_2 selected.

NPMX_LDSW_GPIO_3 

GPIO_3 selected.

NPMX_LDSW_GPIO_4 

GPIO_4 selected.

NPMX_LDSW_GPIO_COUNT 

GPIOs count.

NPMX_LDSW_GPIO_INVALID 

Invalid GPIO.

◆ npmx_ldsw_mode_t

Possible LDSW modes.

Enumerator
NPMX_LDSW_MODE_LOAD_SWITCH 

LDSW configured as load switch.

NPMX_LDSW_MODE_LDO 

LDSW configured as LDO.

NPMX_LDSW_MODE_COUNT 

LDSW modes count.

NPMX_LDSW_MODE_INVALID 

Invalid LDSW mode.

◆ npmx_ldsw_soft_start_current_t

Possible LDSW soft start current levels.

Enumerator
NPMX_LDSW_SOFT_START_CURRENT_10_MA 

LDSW soft start level 10 mA.

NPMX_LDSW_SOFT_START_CURRENT_20_MA 

LDSW soft start level 20 mA.

NPMX_LDSW_SOFT_START_CURRENT_35_MA 

LDSW soft start level 35 mA.

NPMX_LDSW_SOFT_START_CURRENT_50_MA 

LDSW soft start level 50 mA.

NPMX_LDSW_SOFT_START_CURRENT_COUNT 

Current levels count.

NPMX_LDSW_SOFT_START_CURRENT_DEFAULT 

Default LDSW soft start level.

NPMX_LDSW_SOFT_START_CURRENT_MAX 

Maximum LDSW soft start level.

NPMX_LDSW_SOFT_START_CURRENT_INVALID 

Invalid LDSW soft start level.

◆ npmx_ldsw_status_mask_t

LDSW status fields.

Enumerator
NPMX_LDSW_STATUS_POWERUP_LDSW_1_MASK 

LDSW 1 Power Up signal.

NPMX_LDSW_STATUS_POWERUP_LDO_1_MASK 

LDO 1 Power Up signal.

NPMX_LDSW_STATUS_POWERUP_LDSW_2_MASK 

LDSW 1 Power Up signal.

NPMX_LDSW_STATUS_POWERUP_LDO_2_MASK 

LDO 1 Power Up signal.

NPMX_LDSW_STATUS_DEEPSLEEP_MASK 

LDSW/LDO Enable Deep Sleep signal.

◆ npmx_ldsw_task_t

LDSW tasks.

Enumerator
NPMX_LDSW_TASK_ENABLE 

Enable LDSW.

NPMX_LDSW_TASK_DISABLE 

Disable LDSW.

NPMX_LDSW_TASK_COUNT 

LDSW tasks count.

◆ npmx_ldsw_voltage_t

Possible LDO output voltages to be set.

Enumerator
NPMX_LDSW_VOLTAGE_1V0 

1.0 V

NPMX_LDSW_VOLTAGE_1V1 

1.1 V

NPMX_LDSW_VOLTAGE_1V2 

1.2 V

NPMX_LDSW_VOLTAGE_1V3 

1.3 V

NPMX_LDSW_VOLTAGE_1V4 

1.4 V

NPMX_LDSW_VOLTAGE_1V5 

1.5 V

NPMX_LDSW_VOLTAGE_1V6 

1.6 V

NPMX_LDSW_VOLTAGE_1V7 

1.7 V

NPMX_LDSW_VOLTAGE_1V8 

1.8 V

NPMX_LDSW_VOLTAGE_1V9 

1.9 V

NPMX_LDSW_VOLTAGE_2V0 

2.0 V

NPMX_LDSW_VOLTAGE_2V1 

2.1 V

NPMX_LDSW_VOLTAGE_2V2 

2.2 V

NPMX_LDSW_VOLTAGE_2V3 

2.3 V

NPMX_LDSW_VOLTAGE_2V4 

2.4 V

NPMX_LDSW_VOLTAGE_2V5 

2.5 V

NPMX_LDSW_VOLTAGE_2V6 

2.6 V

NPMX_LDSW_VOLTAGE_2V7 

2.7 V

NPMX_LDSW_VOLTAGE_2V8 

2.8 V

NPMX_LDSW_VOLTAGE_2V9 

2.9 V

NPMX_LDSW_VOLTAGE_3V0 

3.0 V

NPMX_LDSW_VOLTAGE_3V1 

3.1 V

NPMX_LDSW_VOLTAGE_3V2 

3.2 V

NPMX_LDSW_VOLTAGE_3V3 

3.3 V

NPMX_LDSW_VOLTAGE_COUNT 

LDO voltages count.

NPMX_LDSW_VOLTAGE_DEFAULT 

Default LDO voltage.

NPMX_LDSW_VOLTAGE_MAX 

Maximum LDO voltage.

NPMX_LDSW_VOLTAGE_INVALID 

Invalid LDO voltage.

Function Documentation

◆ npmx_ldsw_active_discharge_enable_get()

npmx_error_t npmx_ldsw_active_discharge_enable_get ( npmx_ldsw_t const * p_instance,
bool * p_enable )

Function for reading if active discharge is enabled for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_enablePointer to active discharge enable variable.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_active_discharge_enable_set()

npmx_error_t npmx_ldsw_active_discharge_enable_set ( npmx_ldsw_t const * p_instance,
bool enable )

Function for enabling and disabling active discharge for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[in]enableTrue to enable active discharge, false to disable active discharge.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_enable_gpio_get()

npmx_error_t npmx_ldsw_enable_gpio_get ( npmx_ldsw_t const * p_instance,
npmx_ldsw_gpio_config_t * p_config )

Function for reading which GPIO pin will be used for enabling and disabling the specified LDSW instance.

Note
Selected GPIO should be configured as input using GPIO driver.
Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_configPointer to the configuration of GPIO used as the enable signal.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_enable_gpio_set()

npmx_error_t npmx_ldsw_enable_gpio_set ( npmx_ldsw_t const * p_instance,
npmx_ldsw_gpio_config_t const * p_config )

Function for setting the GPIO pin which will be used for enabling and disabling the specified LDSW instance.

Note
Selected GPIO should be configured as input using GPIO driver.
Parameters
[in]p_instancePointer to the LDSW instance.
[in]p_configPointer to the configuration of specified GPIO to be used as the enable signal.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_get()

npmx_ldsw_t * npmx_ldsw_get ( npmx_instance_t * p_pmic,
uint8_t idx )

Function for returning LDSW instance based on index.

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

◆ npmx_ldsw_ldo_voltage_get()

npmx_error_t npmx_ldsw_ldo_voltage_get ( npmx_ldsw_t const * p_instance,
npmx_ldsw_voltage_t * p_voltage )

Function for getting the output voltage of LDO for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_voltagePointer to buck voltage variable.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_ldo_voltage_set()

npmx_error_t npmx_ldsw_ldo_voltage_set ( npmx_ldsw_t const * p_instance,
npmx_ldsw_voltage_t voltage )

Function for setting the output voltage of LDO for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[in]voltageVoltage to set the LDO to.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_mode_get()

npmx_error_t npmx_ldsw_mode_get ( npmx_ldsw_t const * p_instance,
npmx_ldsw_mode_t * p_mode )

Function for reading if a given instance of LDSW works as LDO or load switch.

Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_modePointer to the LDSW mode variable.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_mode_set()

npmx_error_t npmx_ldsw_mode_set ( npmx_ldsw_t const * p_instance,
npmx_ldsw_mode_t mode )

Function for configuring given instance of LDSW to work as LDO or load switch.

Parameters
[in]p_instancePointer to the LDSW instance.
[in]modeLDSW mode to be set.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_soft_start_config_get()

npmx_error_t npmx_ldsw_soft_start_config_get ( npmx_ldsw_t const * p_instance,
npmx_ldsw_soft_start_config_t * p_config )

Function for reading configuration of soft start for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_configPointer to the configuration of soft start.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_soft_start_config_set()

npmx_error_t npmx_ldsw_soft_start_config_set ( npmx_ldsw_t const * p_instance,
npmx_ldsw_soft_start_config_t const * p_config )

Function for configuring soft start for given instance of LDSW.

Parameters
[in]p_instancePointer to the LDSW instance.
[in]p_configPointer to the configuration of soft start to apply.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_soft_start_current_convert()

npmx_ldsw_soft_start_current_t npmx_ldsw_soft_start_current_convert ( uint32_t milliamperes)

Function for converting milliamperes to npmx_ldsw_soft_start_current_t enumeration.

Parameters
[in]milliamperesCurrent in milliamperes to be converted into npmx_ldsw_soft_start_current_t enumeration.
Returns
Result of conversion. NPMX_LDSW_SOFT_START_CURRENT_INVALID if given current is not represented in enumeration.

◆ npmx_ldsw_soft_start_current_convert_to_ma()

bool npmx_ldsw_soft_start_current_convert_to_ma ( npmx_ldsw_soft_start_current_t enum_value,
uint32_t * p_val )

Function for converting npmx_ldsw_soft_start_current_t enumeration to milliamperes.

Parameters
[in]enum_valueCurrent defined as npmx_ldsw_soft_start_current_t enumeration to be converted into milliamperes.
[out]p_valPointer to the variable that stores the conversion result.
Return values
trueConversion is valid.
falseConversion is invalid - an invalid argument was passed to the function.

◆ npmx_ldsw_status_get()

npmx_error_t npmx_ldsw_status_get ( npmx_ldsw_t const * p_instance,
uint8_t * p_status_mask )

Function for getting status for specified LDSW instance.

Parameters
[in]p_instancePointer to the LDSW instance.
[out]p_status_maskPointer to the LDSW status mask composed of values from npmx_ldsw_status_mask_t.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_task_trigger()

npmx_error_t npmx_ldsw_task_trigger ( npmx_ldsw_t const * p_instance,
npmx_ldsw_task_t task )

Function for activating the specified LDSW task.

Parameters
[in]p_instancePointer to the LDSW instance.
[in]taskTask to be activated.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_ldsw_voltage_convert()

npmx_ldsw_voltage_t npmx_ldsw_voltage_convert ( uint32_t millivolts)

Function for converting millivolts to npmx_ldsw_voltage_t enumeration.

Parameters
[in]millivoltsVoltage in millivolts to be converted into npmx_ldsw_voltage_t enumeration.
Returns
Result of conversion. NPMX_LDSW_VOLTAGE_INVALID if given voltage is not represented in enumeration.

◆ npmx_ldsw_voltage_convert_to_mv()

bool npmx_ldsw_voltage_convert_to_mv ( npmx_ldsw_voltage_t enum_value,
uint32_t * p_val )

Function for converting npmx_ldsw_voltage_t enumeration to millivolts.

Parameters
[in]enum_valueVoltage defined as npmx_ldsw_voltage_t enumeration to be converted into millivolts.
[out]p_valPointer to the variable that stores the conversion result.
Return values
trueConversion is valid.
falseConversion is invalid - an invalid argument was passed to the function.