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_t * | npmx_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. | |
Power fail (POF) comparator peripheral driver.
enum npmx_pof_polarity_t |
enum npmx_pof_status_t |
enum npmx_pof_threshold_t |
POF warning voltage threshold values.
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.
[in] | p_instance | Pointer to the POF instance. |
[out] | p_config | Pointer to the POF configuration structure. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
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.
[in] | p_instance | Pointer to the POF instance. |
[in] | p_config | Pointer to the configuration of the POF to apply. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_pof_disable_set | ( | npmx_pof_t const * | p_instance | ) |
Function for disabling POF comparator.
[in] | p_instance | Pointer to the POF instance. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_pof_t * npmx_pof_get | ( | npmx_instance_t * | p_pmic, |
uint8_t | idx ) |
Function for returning POF instance based on index.
[in] | p_pmic | Pointer to the PMIC instance. |
[in] | idx | Index of the POF instance. |
npmx_pof_threshold_t npmx_pof_threshold_convert | ( | uint32_t | millivolts | ) |
Function for converting millivolts to npmx_pof_threshold_t enumeration.
[in] | millivolts | Voltage in millivolts to be converted into 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.
[in] | enum_value | Voltage defined as npmx_pof_threshold_t enumeration to be converted into millivolts. |
[out] | p_val | Pointer to the variable that stores the conversion result. |
true | Conversion is valid. |
false | Conversion is invalid - an invalid argument was passed to the function. |