Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Regulator Interface

Regulator Interface. More...

Data Structures

struct  regulator_driver_api
 Driver-specific API functions to support regulator control. More...
 

Functions

static int regulator_enable (const struct device *reg, struct onoff_client *cli)
 Enable a regulator. More...
 
static int regulator_disable (const struct device *reg)
 Disable a regulator. More...
 

Detailed Description

Regulator Interface.

Function Documentation

◆ regulator_disable()

static int regulator_disable ( const struct device reg)
inlinestatic

#include <include/drivers/regulator.h>

Disable a regulator.

Release a regulator after a previous regulator_enable() completed successfully.

If the release removes the last dependency on the regulator it will begin a transition to its "off" state. There is currently no mechanism to notify when the regulator has completely turned off.

This must be invoked at most once for each successful regulator_enable().

Note
This function is isr-ok.
Parameters
rega regulator device
Returns
non-negative on successful completion of the release request. Negative values indicate failures from onoff_release() or individual regulator drivers.

◆ regulator_enable()

static int regulator_enable ( const struct device reg,
struct onoff_client cli 
)
inlinestatic

#include <include/drivers/regulator.h>

Enable a regulator.

Reference-counted request that a regulator be turned on. This is an asynchronous operation; if successfully initiated the result will be communicated through the cli parameter.

A regulator is considered "on" when it has reached a stable/usable state.

Note
This function is isr-ok and pre-kernel-ok.
Parameters
rega regulator device
cliused to notify the caller when the attempt to turn on the regulator has completed.
Returns
non-negative on successful initiation of the request. Negative values indicate failures from onoff_request() or individual regulator drivers.