Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
4.1.99
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
►
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
►
renesas
►
silabs
►
ambiq-apollo3-pinctrl.h
►
ambiq-apollo4-pinctrl.h
►
ambiq-apollo5-pinctrl.h
►
arm-mps2-pinctrl.h
►
arm-mps3-pinctrl.h
►
arm-v2m_beetle-pinctrl.h
►
b91-pinctrl.h
►
cc13xx_cc26xx-pinctrl.h
►
cc23x0-pinctrl.h
►
ch32v003-pinctrl.h
►
ch32v00x-pinctrl.h
►
ch32v20x_30x-pinctrl.h
►
emsdp-pinctrl.h
►
ene-kb1200-pinctrl.h
►
esp-pinctrl-common.h
►
esp32-gpio-sigmap.h
►
esp32-pinctrl.h
►
esp32c2-gpio-sigmap.h
►
esp32c2-pinctrl.h
►
esp32c3-gpio-sigmap.h
►
esp32c3-pinctrl.h
►
esp32c6-gpio-sigmap.h
►
esp32c6-pinctrl.h
►
esp32s2-gpio-sigmap.h
►
esp32s2-pinctrl.h
►
esp32s3-gpio-sigmap.h
►
esp32s3-pinctrl.h
►
gecko-pinctrl-s1.h
►
gecko-pinctrl.h
►
ifx_cat1-pinctrl.h
►
imx8qm-pinctrl.h
►
imx8qxp-pinctrl.h
►
it8xxx2-pinctrl.h
►
lpc11u6x-pinctrl.h
►
max32-pinctrl.h
►
mchp-xec-pinctrl.h
►
mspm0-pinctrl.h
npcx-pinctrl.h
►
nrf-pinctrl.h
►
numaker-m46x-pinctrl.h
►
numicro-pinctrl.h
►
nxp-s32-pinctrl.h
►
pinctrl-zynq.h
►
pinctrl-zynqmp.h
►
quicklogic-eos-s3-pinctrl.h
►
realtek-rts5912-pinctrl.h
►
renesas-rzt2m-pinctrl.h
►
rpi-pico-pinctrl-common.h
►
rpi-pico-rp2040-pinctrl.h
►
rpi-pico-rp2350-pinctrl-common.h
►
rpi-pico-rp2350a-pinctrl.h
►
rpi-pico-rp2350b-pinctrl.h
►
rv32m1-pinctrl.h
►
si32-pinctrl.h
►
sifive-pinctrl.h
►
silabs-pinctrl-dbus.h
►
silabs-pinctrl-siwx91x.h
►
smartbond-pinctrl.h
►
stm32-pinctrl-common.h
►
stm32-pinctrl.h
►
stm32f1-afio.h
►
stm32f1-pinctrl.h
►
sy1xx-pinctrl.h
►
ti-cc32xx-pinctrl.h
►
ti-k3-pinctrl.h
►
xmc4xxx-pinctrl.h
►
power
►
pwm
►
qspi
►
rdc
►
regulator
►
reserved-memory
►
reset
►
sensor
►
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
►
virtio
►
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
►
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
stm32f1-pinctrl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Linaro Limited
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_STM32F1_PINCTRL_H_
8
#define ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_STM32F1_PINCTRL_H_
9
10
#include <
zephyr/dt-bindings/pinctrl/stm32-pinctrl-common.h
>
11
#include <
zephyr/dt-bindings/pinctrl/stm32f1-afio.h
>
12
13
/* Adapted from Linux: include/dt-bindings/pinctrl/stm32-pinfunc.h */
14
20
#define STM32_MODE_SHIFT 0U
21
#define STM32_MODE_MASK 0x3U
22
#define STM32_LINE_SHIFT 2U
23
#define STM32_LINE_MASK 0xFU
24
#define STM32_PORT_SHIFT 6U
25
#define STM32_PORT_MASK 0xFU
26
#define STM32_REMAP_SHIFT 10U
27
#define STM32_REMAP_MASK 0x3FFU
28
44
#define STM32F1_PINMUX(port, line, mode, remap) \
45
(((((port) - 'A') & STM32_PORT_MASK) << STM32_PORT_SHIFT) | \
46
(((line) & STM32_LINE_MASK) << STM32_LINE_SHIFT) | \
47
(((mode) & STM32_MODE_MASK) << STM32_MODE_SHIFT) | \
48
(((remap) & STM32_REMAP_MASK) << STM32_REMAP_SHIFT))
44
#define STM32F1_PINMUX(port, line, mode, remap) \
…
49
54
#define ALTERNATE 0x0
/* Alternate function output */
55
#define GPIO_IN 0x1
/* Input */
56
#define ANALOG 0x2
/* Analog */
57
#define GPIO_OUT 0x3
/* Output */
58
75
/* Port Mode */
76
#define STM32_MODE_INPUT (0x0 << STM32_MODE_INOUT_SHIFT)
77
#define STM32_MODE_OUTPUT (0x1 << STM32_MODE_INOUT_SHIFT)
78
#define STM32_MODE_INOUT_MASK 0x1
79
#define STM32_MODE_INOUT_SHIFT 0
80
81
/* Input Port configuration */
82
#define STM32_CNF_IN_ANALOG (0x0 << STM32_CNF_IN_SHIFT)
83
#define STM32_CNF_IN_FLOAT (0x1 << STM32_CNF_IN_SHIFT)
84
#define STM32_CNF_IN_PUPD (0x2 << STM32_CNF_IN_SHIFT)
85
#define STM32_CNF_IN_MASK 0x3
86
#define STM32_CNF_IN_SHIFT 1
87
88
/* Output Port configuration */
89
#define STM32_MODE_OUTPUT_MAX_10 (0x0 << STM32_MODE_OSPEED_SHIFT)
90
#define STM32_MODE_OUTPUT_MAX_2 (0x1 << STM32_MODE_OSPEED_SHIFT)
91
#define STM32_MODE_OUTPUT_MAX_50 (0x2 << STM32_MODE_OSPEED_SHIFT)
92
#define STM32_MODE_OSPEED_MASK 0x3
93
#define STM32_MODE_OSPEED_SHIFT 3
94
95
#define STM32_CNF_PUSH_PULL (0x0 << STM32_CNF_OUT_0_SHIFT)
96
#define STM32_CNF_OPEN_DRAIN (0x1 << STM32_CNF_OUT_0_SHIFT)
97
#define STM32_CNF_OUT_0_MASK 0x1
98
#define STM32_CNF_OUT_0_SHIFT 5
99
100
#define STM32_CNF_GP_OUTPUT (0x0 << STM32_CNF_OUT_1_SHIFT)
101
#define STM32_CNF_ALT_FUNC (0x1 << STM32_CNF_OUT_1_SHIFT)
102
#define STM32_CNF_OUT_1_MASK 0x1
103
#define STM32_CNF_OUT_1_SHIFT 6
104
105
/* GPIO High impedance/Pull-up/Pull-down */
106
#define STM32_PUPD_NO_PULL (0x0 << STM32_PUPD_SHIFT)
107
#define STM32_PUPD_PULL_UP (0x1 << STM32_PUPD_SHIFT)
108
#define STM32_PUPD_PULL_DOWN (0x2 << STM32_PUPD_SHIFT)
109
#define STM32_PUPD_MASK 0x3
110
#define STM32_PUPD_SHIFT 7
111
112
/* GPIO plain output value */
113
#define STM32_ODR_0 (0x0 << STM32_ODR_SHIFT)
114
#define STM32_ODR_1 (0x1 << STM32_ODR_SHIFT)
115
#define STM32_ODR_MASK 0x1
116
#define STM32_ODR_SHIFT 9
117
118
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_STM32F1_PINCTRL_H_ */
stm32-pinctrl-common.h
stm32f1-afio.h
zephyr
dt-bindings
pinctrl
stm32f1-pinctrl.h
Generated on Fri Jun 6 2025 03:28:57 for Zephyr API Documentation by
1.12.0