|
Zephyr Project API
3.2.0
A Scalable Open Source RTOS
|
Regulator consumer API based on linux regulator API. More...
Go to the source code of this file.
Functions | |
| int | regulator_count_voltages (const struct device *dev) |
| Return the number of supported voltage levels Returns the number of selectors, or negative errno. Selectors are numbered starting at zero, and typically correspond to bitfields in hardware registers. More... | |
| int | regulator_list_voltages (const struct device *dev, unsigned int selector) |
| Return supported voltage Returns a voltage that can be passed to regulator_set_voltage(), zero if the selector code can't be used, or a negative errno. More... | |
| int | regulator_is_supported_voltage (const struct device *dev, int min_uV, int max_uV) |
| Check if a voltage range can be supported. More... | |
| int | regulator_set_voltage (const struct device *dev, int min_uV, int max_uV) |
| Set regulator output voltage. Sets a regulator to the closest supported output voltage. More... | |
| int | regulator_get_voltage (const struct device *dev) |
| Get regulator output voltage. Returns the current regulator voltage in microvolts. More... | |
| int | regulator_set_current_limit (const struct device *dev, int min_uA, int max_uA) |
| Set regulator output current limit Sets current sink to desired output current. More... | |
| int | regulator_get_current_limit (const struct device *dev) |
| Get regulator output current. Note the current limit must have been set for this call to succeed. More... | |
Regulator consumer API based on linux regulator API.
Copyright (c) 2021 NXP
SPDX-License-Identifier: Apache-2.0
This API extends the Zephyr regulator API by implementing voltage and current level control for supported regulators. Currently, the only supported device is the NXP PCA9420 PMIC.
| int regulator_count_voltages | ( | const struct device * | dev | ) |
Return the number of supported voltage levels Returns the number of selectors, or negative errno. Selectors are numbered starting at zero, and typically correspond to bitfields in hardware registers.
| dev | Regulator device to count voltage levels for. |
| int regulator_get_current_limit | ( | const struct device * | dev | ) |
Get regulator output current. Note the current limit must have been set for this call to succeed.
| dev | Regulator to query |
| int regulator_get_voltage | ( | const struct device * | dev | ) |
Get regulator output voltage. Returns the current regulator voltage in microvolts.
| dev | Regulator to query |
| int regulator_is_supported_voltage | ( | const struct device * | dev, |
| int | min_uV, | ||
| int | max_uV | ||
| ) |
Check if a voltage range can be supported.
| dev | Regulator to check range against. |
| min_uV | Minimum voltage in microvolts |
| max_uV | maximum voltage in microvolts |
Return supported voltage Returns a voltage that can be passed to regulator_set_voltage(), zero if the selector code can't be used, or a negative errno.
| dev | Regulator device to get voltage for. |
| selector | voltage selector code. |
| int regulator_set_current_limit | ( | const struct device * | dev, |
| int | min_uA, | ||
| int | max_uA | ||
| ) |
Set regulator output current limit Sets current sink to desired output current.
| dev | Regulator to set output current level |
| min_uA | minimum microamps |
| max_uA | maximum microamps |
| int regulator_set_voltage | ( | const struct device * | dev, |
| int | min_uV, | ||
| int | max_uV | ||
| ) |
Set regulator output voltage. Sets a regulator to the closest supported output voltage.
| dev | Regulator to set voltage |
| min_uV | Minimum acceptable voltage in microvolts |
| max_uV | Maximum acceptable voltage in microvolts |