Zephyr API Documentation
4.2.0-rc3
A Scalable Open Source RTOS
4.2.0-rc3
Toggle main menu visibility
Main Page
Related Pages
Topics
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
Enumerations
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
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
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
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
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
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
Zephyr API Documentation
Introduction
Deprecated List
Topics
Data Structures
Files
File List
doc
kernel
lib
modules
subsys
zephyr
acpi
app_memory
arch
audio
bluetooth
canbus
console
crypto
data
debug
devicetree
dfu
display
drivers
dsp
dt-bindings
acpi
adc
ad4130-adc.h
ad7124-adc.h
adc.h
ads1x4s0x_adc.h
b91-adc.h
gd32f3x0.h
mcp356xr-adc.h
mcux-lpadc.h
nrf-adc.h
nrf-saadc-haltium.h
nrf-saadc-nrf54l.h
nrf-saadc-v2.h
nrf-saadc-v3.h
nrf-saadc.h
nxp,gau-adc.h
silabs-adc.h
smartbond-adc.h
stm32_adc.h
stm32f1_adc.h
stm32f4_adc.h
stm32h7_adc.h
stm32l4_adc.h
stm32u5_adc.h
battery
clock
comparator
dac
dai
display
dma
espi
ethernet
flash_controller
gnss
gpio
i2c
input
inputmux
interrupt-controller
ipc_service
led
lora
lvgl
memory-attr
memory-controller
mfd
mipi_dbi
mipi_dsi
misc
pcie
pinctrl
power
pwm
qspi
rdc
regulator
reserved-memory
reset
sensor
sent
spi
timer
usb
usb-c
video
dt-util.h
fs
input
internal
ipc
kernel
linker
llext
logging
lorawan
math
mem_mgmt
mgmt
misc
modbus
modem
multi_heap
net
platform
pm
pmci
portability
posix
psa
random
retention
rtio
sd
sensing
settings
shell
sip_svc
stats
storage
sys
task_wdt
timing
toolchain
tracing
usb
usb_c
xen
zbus
zvfs
bindesc.h
cache.h
device.h
devicetree.h
fatal.h
fatal_types.h
init.h
irq.h
irq_multilevel.h
irq_nextlevel.h
irq_offload.h
kernel.h
kernel_includes.h
kernel_structs.h
kernel_version.h
net_buf.h
service.h
shared_irq.h
smf.h
spinlock.h
sw_isr_table.h
sys_clock.h
syscall.h
toolchain.h
types.h
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
stm32_adc.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 STMicrelectronics
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_STM32_ADC_H_
7
#define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_STM32_ADC_H_
8
9
#include <
zephyr/dt-bindings/adc/adc.h
>
10
11
#define STM32_ADC_REG_MASK BIT_MASK(8)
12
#define STM32_ADC_REG_SHIFT 0U
13
#define STM32_ADC_SHIFT_MASK BIT_MASK(5)
14
#define STM32_ADC_SHIFT_SHIFT 8U
15
#define STM32_ADC_MASK_MASK BIT_MASK(3)
16
#define STM32_ADC_MASK_SHIFT 13U
17
#define STM32_ADC_REG_VAL_MASK BIT_MASK(3)
18
#define STM32_ADC_REG_VAL_SHIFT 16U
19
#define STM32_ADC_REAL_VAL_MASK BIT_MASK(13)
20
#define STM32_ADC_REAL_VAL_SHIFT 19U
21
37
#define STM32_ADC(real_val, reg_val, mask, shift, reg) \
38
((((reg) & STM32_ADC_REG_MASK) << STM32_ADC_REG_SHIFT) | \
39
(((shift) & STM32_ADC_SHIFT_MASK) << STM32_ADC_SHIFT_SHIFT) | \
40
(((mask) & STM32_ADC_MASK_MASK) << STM32_ADC_MASK_SHIFT) | \
41
(((reg_val) & STM32_ADC_REG_VAL_MASK) << STM32_ADC_REG_VAL_SHIFT) | \
42
(((real_val) & STM32_ADC_REAL_VAL_MASK) << STM32_ADC_REAL_VAL_SHIFT))
37
#define STM32_ADC(real_val, reg_val, mask, shift, reg) \
…
43
44
#define STM32_ADC_GET_REAL_VAL(val) \
45
(((val) >> STM32_ADC_REAL_VAL_SHIFT) & STM32_ADC_REAL_VAL_MASK)
44
#define STM32_ADC_GET_REAL_VAL(val) \
…
46
47
#define STM32_ADC_GET_REG_VAL(val) \
48
(((val) >> STM32_ADC_REG_VAL_SHIFT) & STM32_ADC_REG_VAL_MASK)
47
#define STM32_ADC_GET_REG_VAL(val) \
…
49
50
#define STM32_ADC_GET_MASK(val) \
51
(((val) >> STM32_ADC_MASK_SHIFT) & STM32_ADC_MASK_MASK)
50
#define STM32_ADC_GET_MASK(val) \
…
52
53
#define STM32_ADC_GET_SHIFT(val) \
54
(((val) >> STM32_ADC_SHIFT_SHIFT) & STM32_ADC_SHIFT_MASK)
53
#define STM32_ADC_GET_SHIFT(val) \
…
55
56
#define STM32_ADC_GET_REG(val) \
57
(((val) >> STM32_ADC_REG_SHIFT) & STM32_ADC_REG_MASK)
56
#define STM32_ADC_GET_REG(val) \
…
58
59
/*
60
* Macro used to store resolution info. STM32_ADC_RES_* macros are defined in
61
* respective stm32xx_adc.h files
62
*/
63
#define STM32_ADC_RES(resolution, reg_val) \
64
STM32_ADC(resolution, reg_val, STM32_ADC_RES_MASK, STM32_ADC_RES_SHIFT, \
65
STM32_ADC_RES_REG)
63
#define STM32_ADC_RES(resolution, reg_val) \
…
66
67
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_STM32_ADC_H_ */
adc.h
zephyr
dt-bindings
adc
stm32_adc.h
Generated on
for Zephyr API Documentation by
1.14.0