Zephyr API Documentation
3.0.0
A Scalable Open Source RTOS
3.0.0
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
regulator.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019-2020 Peter Bigot Consulting, LLC
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
11
#ifndef ZEPHYR_INCLUDE_DRIVERS_REGULATOR_H_
12
#define ZEPHYR_INCLUDE_DRIVERS_REGULATOR_H_
13
21
#include <
zephyr/types.h
>
22
#include <
drivers/gpio.h
>
23
#include <
sys/onoff.h
>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
32
__subsystem
struct
regulator_driver_api
{
33
int (*
enable
)(
const
struct
device
*dev,
struct
onoff_client
*cli);
34
int (*
disable
)(
const
struct
device
*dev);
35
};
36
58
static
inline
int
regulator_enable
(
const
struct
device
*
reg
,
59
struct
onoff_client
*cli)
60
{
61
const
struct
regulator_driver_api
*api =
62
(
const
struct
regulator_driver_api
*)
reg
->api;
63
64
return
api->
enable
(
reg
, cli);
65
}
66
88
static
inline
int
regulator_disable
(
const
struct
device
*
reg
)
89
{
90
const
struct
regulator_driver_api
*api =
91
(
const
struct
regulator_driver_api
*)
reg
->api;
92
93
return
api->
disable
(
reg
);
94
}
95
96
#ifdef __cplusplus
97
}
98
#endif
99
104
#endif
/* ZEPHYR_INCLUDE_DRIVERS_REGULATOR_H_ */
gpio.h
Public APIs for GPIO drivers.
regulator_disable
static int regulator_disable(const struct device *reg)
Disable a regulator.
Definition:
regulator.h:88
regulator_enable
static int regulator_enable(const struct device *reg, struct onoff_client *cli)
Enable a regulator.
Definition:
regulator.h:58
types.h
reg
struct shared_multi_heap_region * reg
Definition:
main.c:17
onoff.h
device
Runtime device structure (in ROM) per driver instance.
Definition:
device.h:450
onoff_client
State associated with a client of an on-off service.
Definition:
onoff.h:273
regulator_driver_api
Driver-specific API functions to support regulator control.
Definition:
regulator.h:32
regulator_driver_api::enable
int(* enable)(const struct device *dev, struct onoff_client *cli)
Definition:
regulator.h:33
regulator_driver_api::disable
int(* disable)(const struct device *dev)
Definition:
regulator.h:34
include
drivers
regulator.h
Generated on Mon Feb 21 2022 22:43:01 for Zephyr API Documentation by
1.9.2