Zephyr API Documentation  3.7.0-rc3
A Scalable Open Source RTOS
No Matches
regulator.h File Reference
#include <errno.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/sys/util_macro.h>

Go to the source code of this file.


Regulator error flags.

 Voltage is too high.
 Current is too high.
 Temperature is too high.


typedef uint8_t regulator_dvs_state_t
 Opaque type to store regulator DVS states.
typedef uint8_t regulator_mode_t
 Opaque type to store regulator modes.
typedef uint8_t regulator_error_flags_t
 Opaque bit map for regulator error flags (see REGULATOR_ERRORS)


static int regulator_parent_dvs_state_set (const struct device *dev, regulator_dvs_state_t state)
 Set a DVS state.
static int regulator_parent_ship_mode (const struct device *dev)
 Enter ship mode.
int regulator_enable (const struct device *dev)
 Enable a regulator.
bool regulator_is_enabled (const struct device *dev)
 Check if a regulator is enabled.
int regulator_disable (const struct device *dev)
 Disable a regulator.
static unsigned int regulator_count_voltages (const struct device *dev)
 Obtain the number of supported voltage levels.
static int regulator_list_voltage (const struct device *dev, unsigned int idx, int32_t *volt_uv)
 Obtain the value of a voltage given an index.
bool regulator_is_supported_voltage (const struct device *dev, int32_t min_uv, int32_t max_uv)
 Check if a voltage within a window is supported.
int regulator_set_voltage (const struct device *dev, int32_t min_uv, int32_t max_uv)
 Set the output voltage.
static int regulator_get_voltage (const struct device *dev, int32_t *volt_uv)
 Obtain output voltage.
static unsigned int regulator_count_current_limits (const struct device *dev)
 Obtain the number of supported current limit levels.
static int regulator_list_current_limit (const struct device *dev, unsigned int idx, int32_t *current_ua)
 Obtain the value of a current limit given an index.
int regulator_set_current_limit (const struct device *dev, int32_t min_ua, int32_t max_ua)
 Set output current limit.
static int regulator_get_current_limit (const struct device *dev, int32_t *curr_ua)
 Get output current limit.
int regulator_set_mode (const struct device *dev, regulator_mode_t mode)
 Set mode.
static int regulator_get_mode (const struct device *dev, regulator_mode_t *mode)
 Get mode.
static int regulator_set_active_discharge (const struct device *dev, bool active_discharge)
 Set active discharge setting.
static int regulator_get_active_discharge (const struct device *dev, bool *active_discharge)
 Get active discharge setting.
static int regulator_get_error_flags (const struct device *dev, regulator_error_flags_t *flags)
 Get active error flags.