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

Power fail (POF) comparator peripheral driver. More...

Data Structures

struct  npmx_pof_t
 Data structure of the POF driver instance. More...
 
struct  npmx_pof_config_t
 Configuration structure for POF comparator. More...
 

Enumerations

enum  npmx_pof_status_t {
  NPMX_POF_STATUS_DISABLE = POF_POFCONFIG_POFENA_OFF ,
  NPMX_POF_STATUS_ENABLE = POF_POFCONFIG_POFENA_ENABLED ,
  NPMX_POF_STATUS_COUNT ,
  NPMX_POF_STATUS_INVALID = NPMX_INVALID_ENUM_VALUE
}
 POF warning status. More...
 
enum  npmx_pof_polarity_t {
  NPMX_POF_POLARITY_LOW = POF_POFCONFIG_POFWARNPOLARITY_LOACTIVE ,
  NPMX_POF_POLARITY_HIGH = POF_POFCONFIG_POFWARNPOLARITY_HIACTIVE ,
  NPMX_POF_POLARITY_COUNT ,
  NPMX_POF_POLARITY_INVALID = NPMX_INVALID_ENUM_VALUE
}
 POF warning polarity. More...
 
enum  npmx_pof_threshold_t {
  NPMX_POF_THRESHOLD_2V6 = POF_POFCONFIG_POFVSYSTHRESHSEL_2V6 ,
  NPMX_POF_THRESHOLD_2V7 = POF_POFCONFIG_POFVSYSTHRESHSEL_2V7 ,
  NPMX_POF_THRESHOLD_2V8 = POF_POFCONFIG_POFVSYSTHRESHSEL_2V8 ,
  NPMX_POF_THRESHOLD_2V9 = POF_POFCONFIG_POFVSYSTHRESHSEL_2V9 ,
  NPMX_POF_THRESHOLD_3V0 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V0 ,
  NPMX_POF_THRESHOLD_3V1 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V1 ,
  NPMX_POF_THRESHOLD_3V2 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V2 ,
  NPMX_POF_THRESHOLD_3V3 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V3 ,
  NPMX_POF_THRESHOLD_3V4 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V4 ,
  NPMX_POF_THRESHOLD_3V5 = POF_POFCONFIG_POFVSYSTHRESHSEL_3V5 ,
  NPMX_POF_THRESHOLD_COUNT ,
  NPMX_POF_THRESHOLD_DEFAULT = NPMX_POF_THRESHOLD_2V8 ,
  NPMX_POF_THRESHOLD_MAX = NPMX_POF_THRESHOLD_3V5 ,
  NPMX_POF_THRESHOLD_INVALID = NPMX_INVALID_ENUM_VALUE
}
 POF warning voltage threshold values. More...
 

Functions

npmx_pof_tnpmx_pof_get (npmx_instance_t *p_pmic, uint8_t idx)
 Function for returning POF instance based on index.
 
npmx_pof_threshold_t npmx_pof_threshold_convert (uint32_t millivolts)
 Function for converting millivolts to npmx_pof_threshold_t enumeration.
 
bool npmx_pof_threshold_convert_to_mv (npmx_pof_threshold_t enum_value, uint32_t *p_val)
 Function for converting npmx_pof_threshold_t enumeration to millivolts.
 
npmx_error_t npmx_pof_config_set (npmx_pof_t const *p_instance, npmx_pof_config_t const *p_config)
 Function for setting configuration and enabling POF comparator.
 
npmx_error_t npmx_pof_config_get (npmx_pof_t const *p_instance, npmx_pof_config_t *p_config)
 Function for reading the POF configuration.
 
npmx_error_t npmx_pof_disable_set (npmx_pof_t const *p_instance)
 Function for disabling POF comparator.
 

Detailed Description

Power fail (POF) comparator peripheral driver.

Enumeration Type Documentation

◆ npmx_pof_polarity_t

POF warning polarity.

Enumerator
NPMX_POF_POLARITY_LOW 

Active in low state.

NPMX_POF_POLARITY_HIGH 

Active in high state.

NPMX_POF_POLARITY_COUNT 

POF polarity count.

NPMX_POF_POLARITY_INVALID 

Invalid POF polarity.

◆ npmx_pof_status_t

POF warning status.

Enumerator
NPMX_POF_STATUS_DISABLE 

Disable POF warning.

NPMX_POF_STATUS_ENABLE 

Enable POF warning.

NPMX_POF_STATUS_COUNT 

POF warnings count.

NPMX_POF_STATUS_INVALID 

Invalid POF warning.

◆ npmx_pof_threshold_t

POF warning voltage threshold values.

Enumerator
NPMX_POF_THRESHOLD_2V6 

2.6 V.

NPMX_POF_THRESHOLD_2V7 

2.7 V.

NPMX_POF_THRESHOLD_2V8 

2.8 V.

NPMX_POF_THRESHOLD_2V9 

2.9 V.

NPMX_POF_THRESHOLD_3V0 

3.0 V.

NPMX_POF_THRESHOLD_3V1 

3.1 V.

NPMX_POF_THRESHOLD_3V2 

3.2 V.

NPMX_POF_THRESHOLD_3V3 

3.3 V.

NPMX_POF_THRESHOLD_3V4 

3.4 V.

NPMX_POF_THRESHOLD_3V5 

3.5 V.

NPMX_POF_THRESHOLD_COUNT 

Threshold values count.

NPMX_POF_THRESHOLD_DEFAULT 

Default voltage.

NPMX_POF_THRESHOLD_MAX 

Maximum voltage.

NPMX_POF_THRESHOLD_INVALID 

Invalid voltage.

Function Documentation

◆ npmx_pof_config_get()

npmx_error_t npmx_pof_config_get ( npmx_pof_t const * p_instance,
npmx_pof_config_t * p_config )

Function for reading the POF configuration.

Parameters
[in]p_instancePointer to the POF instance.
[out]p_configPointer to the POF configuration structure.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_pof_config_set()

npmx_error_t npmx_pof_config_set ( npmx_pof_t const * p_instance,
npmx_pof_config_t const * p_config )

Function for setting configuration and enabling POF comparator.

Note
Before using this function, configure one GPIO as a power loss warning output (NPMX_GPIO_MODE_OUTPUT_PLW).
Parameters
[in]p_instancePointer to the POF instance.
[in]p_configPointer to the configuration of the POF to apply.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_pof_disable_set()

npmx_error_t npmx_pof_disable_set ( npmx_pof_t const * p_instance)

Function for disabling POF comparator.

Parameters
[in]p_instancePointer to the POF instance.
Return values
NPMX_SUCCESSOperation performed successfully.
NPMX_ERROR_IOError using IO bus line.

◆ npmx_pof_get()

npmx_pof_t * npmx_pof_get ( npmx_instance_t * p_pmic,
uint8_t idx )

Function for returning POF instance based on index.

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

◆ npmx_pof_threshold_convert()

npmx_pof_threshold_t npmx_pof_threshold_convert ( uint32_t millivolts)

Function for converting millivolts to npmx_pof_threshold_t enumeration.

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

◆ npmx_pof_threshold_convert_to_mv()

bool npmx_pof_threshold_convert_to_mv ( npmx_pof_threshold_t enum_value,
uint32_t * p_val )

Function for converting npmx_pof_threshold_t enumeration to millivolts.

Parameters
[in]enum_valueVoltage defined as npmx_pof_threshold_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.