Buck converter (DC/DC step-down converter) peripheral driver. More...
Data Structures | |
struct | npmx_buck_t |
Data structure of the buck converter (BUCK) driver instance. More... | |
struct | npmx_buck_gpio_config_t |
Configuration structure for GPIO used as input signal for buck. More... | |
struct | npmx_buck_status_t |
Buck status structure. More... | |
Enumerations | |
enum | npmx_buck_task_t { NPMX_BUCK_TASK_ENABLE , NPMX_BUCK_TASK_DISABLE , NPMX_BUCK_TASK_ENABLE_PWM , NPMX_BUCK_TASK_DISABLE_PWM , NPMX_BUCK_TASK_COUNT } |
Buck tasks. More... | |
enum | npmx_buck_mode_t { NPMX_BUCK_MODE_AUTO = BUCK_BUCKSTATUS_BUCK1MODE_AUTOMODE , NPMX_BUCK_MODE_PFM = BUCK_BUCKSTATUS_BUCK1MODE_PFMMODE , NPMX_BUCK_MODE_PWM = BUCK_BUCKSTATUS_BUCK1MODE_PWMMODE , NPMX_BUCK_MODE_COUNT , NPMX_BUCK_MODE_INVALID = NPMX_INVALID_ENUM_VALUE } |
Possible converter modes of each buck. More... | |
enum | npmx_buck_vout_select_t { NPMX_BUCK_VOUT_SELECT_VSET_PIN = BUCK_BUCKSWCTRLSEL_BUCK1SWCTRLSEL_VSETANDSWCTRL , NPMX_BUCK_VOUT_SELECT_SOFTWARE = BUCK_BUCKSWCTRLSEL_BUCK1SWCTRLSEL_SWCTRL , NPMX_BUCK_VOUT_SELECT_COUNT , NPMX_BUCK_VOUT_SELECT_INVALID = NPMX_INVALID_ENUM_VALUE } |
The source of VOUT voltage reference. Output voltage can be controlled by external VSETx feedback pin or by software register value. More... | |
enum | npmx_buck_voltage_t { NPMX_BUCK_VOLTAGE_1V0 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_1V , NPMX_BUCK_VOLTAGE_1V1 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_1V1 , NPMX_BUCK_VOLTAGE_1V2 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_1V2 , NPMX_BUCK_VOLTAGE_1V3 = BUCK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MVOUT_3V0 , NPMX_BUCK_VOLTAGE_3V1 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_3V1 , NPMX_BUCK_VOLTAGE_3V2 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_3V2 , NPMX_BUCK_VOLTAGE_3V3 = BUCK_BUCK1NORMVOUT_BUCK1NORMVOUT_3V3 , NPMX_BUCK_VOLTAGE_COUNT , NPMX_BUCK_VOLTAGE_MAX = NPMX_BUCK_VOLTAGE_3V3 , NPMX_BUCK_VOLTAGE_INVALID = NPMX_INVALID_ENUM_VALUE } |
Possible buck output voltages to be set. More... | |
enum | npmx_buck_gpio_t { NPMX_BUCK_GPIO_NC = BUCK_BUCKENCTRL_BUCK1ENGPISEL_NOTUSED , NPMX_BUCK_GPIO_0 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_GPIO0 , NPMX_BUCK_GPIO_1 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_GPIO1 , NPMX_BUCK_GPIO_2 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_GPIO2 , NPMX_BUCK_GPIO_3 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_GPIO3 , NPMX_BUCK_GPIO_4 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_GPIO4 , NPMX_BUCK_GPIO_NC1 = BUCK_BUCKENCTRL_BUCK1ENGPISEL_NOTUSED1 , NPMX_BUCK_GPIO_COUNT , NPMX_BUCK_GPIO_INVALID = NPMX_INVALID_ENUM_VALUE } |
Possible GPIO to be selected with buck configurations. More... | |
Functions | |
npmx_buck_t * | npmx_buck_get (npmx_instance_t *p_pmic, uint8_t idx) |
Function for returning buck instance based on index. | |
npmx_buck_voltage_t | npmx_buck_voltage_convert (uint32_t millivolts) |
Function for converting millivolts to npmx_buck_voltage_t enumeration. | |
bool | npmx_buck_voltage_convert_to_mv (npmx_buck_voltage_t enum_value, uint32_t *p_val) |
Function for converting npmx_buck_voltage_t enumeration to millivolts. | |
npmx_error_t | npmx_buck_task_trigger (npmx_buck_t const *p_instance, npmx_buck_task_t task) |
Function for activating the specified buck task. | |
npmx_error_t | npmx_buck_converter_mode_set (npmx_buck_t const *p_instance, npmx_buck_mode_t mode) |
Function for setting the buck converter mode to either PWM, hysteretic (PFM) or AUTO (PWM & PFM). | |
npmx_error_t | npmx_buck_pfm_enable_get (npmx_buck_t const *p_instance, bool *p_enable) |
Function for checking whether the hysteretic (PFM) mode of the buck converter is enabled. | |
npmx_error_t | npmx_buck_normal_voltage_set (npmx_buck_t const *p_instance, npmx_buck_voltage_t voltage) |
Function for setting the normal voltage of the specified buck instance. | |
npmx_error_t | npmx_buck_normal_voltage_get (npmx_buck_t const *p_instance, npmx_buck_voltage_t *p_voltage) |
Function for reading the normal voltage of the specified buck instance. | |
npmx_error_t | npmx_buck_retention_voltage_set (npmx_buck_t const *p_instance, npmx_buck_voltage_t voltage) |
Function for setting the buck retention voltage for the specified buck instance. | |
npmx_error_t | npmx_buck_retention_voltage_get (npmx_buck_t const *p_instance, npmx_buck_voltage_t *p_voltage) |
Function for reading the buck retention voltage for the specified buck instance. | |
npmx_error_t | npmx_buck_enable_gpio_config_set (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t const *p_config) |
Function for configuring the GPIO pin which will be used for enabling and disabling the specified buck instance converter. | |
npmx_error_t | npmx_buck_enable_gpio_config_get (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t *p_config) |
Function for reading configuration of the GPIO pin used for enabling and disabling the specified buck instance converter. | |
npmx_error_t | npmx_buck_retention_gpio_config_set (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t const *p_config) |
Function for configuring the GPIO pin which will be used for controlling the specified buck's retention mode. | |
npmx_error_t | npmx_buck_retention_gpio_config_get (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t *p_config) |
Function for reading configuration of the GPIO pin used for controlling the specified buck's retention mode. | |
npmx_error_t | npmx_buck_forced_pwm_gpio_config_set (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t const *p_config) |
Function for configuring the GPIO pin to use forced PWM mode in the specified buck instance converter. | |
npmx_error_t | npmx_buck_forced_pwm_gpio_config_get (npmx_buck_t const *p_instance, npmx_buck_gpio_config_t *p_config) |
Function for reading the GPIO pin configuration used to force PWM mode. | |
npmx_error_t | npmx_buck_vout_select_set (npmx_buck_t const *p_instance, npmx_buck_vout_select_t selection) |
Function for selecting the output voltage reference of the specified buck instance converter. | |
npmx_error_t | npmx_buck_vout_select_get (npmx_buck_t const *p_instance, npmx_buck_vout_select_t *p_selection) |
Function for reading selected output voltage reference of the specified buck instance converter. | |
npmx_error_t | npmx_buck_status_voltage_get (npmx_buck_t const *p_instance, npmx_buck_voltage_t *p_voltage) |
Function for reading the voltage status register of the specified buck instance. | |
npmx_error_t | npmx_buck_active_discharge_enable_set (npmx_buck_t const *p_instance, bool enable) |
Function for setting active output capacitor discharge state of the specified buck converter. When selected, discharge is ON when converter is disabled. | |
npmx_error_t | npmx_buck_active_discharge_enable_get (npmx_buck_t const *p_instance, bool *p_enable) |
Function for reading active output capacitor discharge state of the specified buck converter. When selected, discharge is ON when converter is disabled. | |
npmx_error_t | npmx_buck_status_get (npmx_buck_t const *p_instance, npmx_buck_status_t *p_status) |
Function for getting status of the specified buck converter. | |
Buck converter (DC/DC step-down converter) peripheral driver.
enum npmx_buck_gpio_t |
Possible GPIO to be selected with buck configurations.
enum npmx_buck_mode_t |
enum npmx_buck_task_t |
enum npmx_buck_voltage_t |
Possible buck output voltages to be set.
The source of VOUT voltage reference. Output voltage can be controlled by external VSETx feedback pin or by software register value.
npmx_error_t npmx_buck_active_discharge_enable_get | ( | npmx_buck_t const * | p_instance, |
bool * | p_enable ) |
Function for reading active output capacitor discharge state of the specified buck converter. When selected, discharge is ON when converter is disabled.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_enable | Pointer to the enable active discharge variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_active_discharge_enable_set | ( | npmx_buck_t const * | p_instance, |
bool | enable ) |
Function for setting active output capacitor discharge state of the specified buck converter. When selected, discharge is ON when converter is disabled.
[in] | p_instance | Pointer to the buck instance. |
[in] | enable | True to enable active discharge, false to disable active discharge. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_converter_mode_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_mode_t | mode ) |
Function for setting the buck converter mode to either PWM, hysteretic (PFM) or AUTO (PWM & PFM).
[in] | p_instance | Pointer to the buck instance. |
[in] | mode | PWM, hysteretic (PFM) or AUTO mode. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_enable_gpio_config_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t * | p_config ) |
Function for reading configuration of the GPIO pin used for enabling and disabling the specified buck instance converter.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_config | Pointer to the configuration of GPIO. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_enable_gpio_config_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t const * | p_config ) |
Function for configuring the GPIO pin which will be used for enabling and disabling the specified buck instance converter.
[in] | p_instance | Pointer to the buck instance. |
[in] | p_config | Pointer to the configuration of GPIO to be applied. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_forced_pwm_gpio_config_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t * | p_config ) |
Function for reading the GPIO pin configuration used to force PWM mode.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_config | Pointer to the configuration structure. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_forced_pwm_gpio_config_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t const * | p_config ) |
Function for configuring the GPIO pin to use forced PWM mode in the specified buck instance converter.
[in] | p_instance | Pointer to the buck instance. |
[in] | p_config | Pointer to the configuration of GPIO to be applied. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_buck_t * npmx_buck_get | ( | npmx_instance_t * | p_pmic, |
uint8_t | idx ) |
Function for returning buck instance based on index.
[in] | p_pmic | Pointer to the PMIC instance. |
[in] | idx | Index of the buck instance. |
npmx_error_t npmx_buck_normal_voltage_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_voltage_t * | p_voltage ) |
Function for reading the normal voltage of the specified buck instance.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_voltage | Pointer to buck voltage variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_normal_voltage_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_voltage_t | voltage ) |
Function for setting the normal voltage of the specified buck instance.
[in] | p_instance | Pointer to the buck instance. |
[in] | voltage | Voltage to be set at buck's output. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_pfm_enable_get | ( | npmx_buck_t const * | p_instance, |
bool * | p_enable ) |
Function for checking whether the hysteretic (PFM) mode of the buck converter is enabled.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_enable | Pointer to variable to be filled with hysteretic (PFM) mode. True if mode is enabled, false otherwise. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_retention_gpio_config_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t * | p_config ) |
Function for reading configuration of the GPIO pin used for controlling the specified buck's retention mode.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_config | Pointer to the configuration of GPIO. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_retention_gpio_config_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_gpio_config_t const * | p_config ) |
Function for configuring the GPIO pin which will be used for controlling the specified buck's retention mode.
[in] | p_instance | Pointer to the buck instance. |
[in] | p_config | Pointer to the configuration of GPIO to be applied. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_retention_voltage_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_voltage_t * | p_voltage ) |
Function for reading the buck retention voltage for the specified buck instance.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_voltage | Pointer to buck voltage variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_retention_voltage_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_voltage_t | voltage ) |
Function for setting the buck retention voltage for the specified buck instance.
[in] | p_instance | Pointer to the buck instance. |
[in] | voltage | Voltage to be set at buck's output. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_status_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_status_t * | p_status ) |
Function for getting status of the specified buck converter.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_status | Pointer to the buck status structure. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_status_voltage_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_voltage_t * | p_voltage ) |
Function for reading the voltage status register of the specified buck instance.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_voltage | Pointer to the voltage variable of the buck. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_task_trigger | ( | npmx_buck_t const * | p_instance, |
npmx_buck_task_t | task ) |
Function for activating the specified buck task.
[in] | p_instance | Pointer to the buck instance. |
[in] | task | Task to be activated. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_buck_voltage_t npmx_buck_voltage_convert | ( | uint32_t | millivolts | ) |
Function for converting millivolts to npmx_buck_voltage_t enumeration.
[in] | millivolts | Voltage in millivolts to be converted into npmx_buck_voltage_t enumeration. |
bool npmx_buck_voltage_convert_to_mv | ( | npmx_buck_voltage_t | enum_value, |
uint32_t * | p_val ) |
Function for converting npmx_buck_voltage_t enumeration to millivolts.
[in] | enum_value | Voltage defined as npmx_buck_voltage_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. |
npmx_error_t npmx_buck_vout_select_get | ( | npmx_buck_t const * | p_instance, |
npmx_buck_vout_select_t * | p_selection ) |
Function for reading selected output voltage reference of the specified buck instance converter.
[in] | p_instance | Pointer to the buck instance. |
[out] | p_selection | Pointer to selection of the output voltage reference. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_buck_vout_select_set | ( | npmx_buck_t const * | p_instance, |
npmx_buck_vout_select_t | selection ) |
Function for selecting the output voltage reference of the specified buck instance converter.
[in] | p_instance | Pointer to the buck instance. |
[in] | selection | Selection of the output voltage reference. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |