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
►
subsys
▼
zephyr
►
acpi
►
app_memory
►
arch
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
▼
drivers
►
adc
►
bluetooth
►
can
►
clock_control
►
comparator
►
console
►
dac
►
dma
►
eeprom
►
ethernet
►
firmware
►
flash
►
gnss
►
gpio
►
haptics
►
i2c
►
i3c
►
ieee802154
►
interrupt_controller
►
led
►
led_strip
►
mfd
►
mic_privacy
►
mipi_dsi
►
misc
►
mm
►
modem
►
mspi
►
pcie
▼
pinctrl
►
pinctrl_esp32_common.h
pinctrl_nxp_port_common.h
►
pinctrl_rcar_common.h
pinctrl_soc_bflb_common.h
►
pinctrl_soc_sam_common.h
►
pm_cpu_ops
►
power
►
pwm
►
regulator
►
retained_mem
►
rtc
►
sensor
►
serial
►
sip_svc
►
spi
►
stepper
►
timer
►
uart
►
usb
►
usb_c
►
virtualization
►
adc.h
►
auxdisplay.h
►
bbram.h
►
bluetooth.h
cache.h
►
can.h
►
cellular.h
►
charger.h
►
clock_control.h
►
comparator.h
►
coredump.h
►
counter.h
►
dac.h
►
dai.h
►
disk.h
►
display.h
►
dma.h
►
edac.h
►
eeprom.h
►
emul.h
►
emul_bbram.h
►
emul_fuel_gauge.h
►
emul_sensor.h
►
emul_stub_device.h
►
entropy.h
►
espi.h
►
espi_emul.h
►
espi_saf.h
►
flash.h
►
fpga.h
►
fuel_gauge.h
►
gnss.h
►
gpio.h
►
haptics.h
►
hwinfo.h
►
hwspinlock.h
►
i2c.h
►
i2c_emul.h
►
i2s.h
►
i3c.h
►
ipm.h
►
led.h
►
led_strip.h
►
loopback_disk.h
►
lora.h
►
mbox.h
►
mdio.h
►
mipi_dbi.h
►
mipi_dsi.h
►
mspi.h
►
mspi_emul.h
►
peci.h
►
pinctrl.h
►
pm_cpu_ops.h
►
ps2.h
►
ptp_clock.h
►
pwm.h
►
regulator.h
►
reset.h
►
retained_mem.h
►
rtc.h
►
sdhc.h
►
sensor.h
►
sensor_attribute_types.h
►
sensor_clock.h
►
sensor_data_types.h
►
smbus.h
►
spi.h
►
spi_emul.h
►
stepper.h
►
swdp.h
►
syscon.h
►
tee.h
►
uart.h
►
uart_emul.h
►
uart_pipe.h
►
video-controls.h
►
video.h
►
w1.h
►
watchdog.h
►
dsp
►
dt-bindings
►
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
►
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
pinctrl_soc_sam_common.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022, Gerson Fernando Budke <nandojve@gmail.com>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
12
#ifndef ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_SOC_SAM_COMMON_H_
13
#define ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_SOC_SAM_COMMON_H_
14
15
#include <
zephyr/devicetree.h
>
16
#include <
zephyr/types.h
>
17
#include <dt-bindings/pinctrl/atmel_sam_pinctrl.h>
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
32
typedef
uint32_t
pinctrl_soc_pin_t
;
33
41
#if defined(CONFIG_SOC_FAMILY_ATMEL_SAM)
42
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
43
((DT_PROP_BY_IDX(node_id, prop, idx) << SAM_PINCTRL_PINMUX_POS) \
44
| (DT_PROP(node_id, bias_pull_up) << SAM_PINCTRL_PULLUP_POS) \
45
| (DT_PROP(node_id, bias_pull_down) << SAM_PINCTRL_PULLDOWN_POS) \
46
| (DT_PROP(node_id, drive_open_drain) << SAM_PINCTRL_OPENDRAIN_POS) \
47
),
48
#else
/* CONFIG_SOC_FAMILY_ATMEL_SAM0 */
49
#define Z_PINCTRL_STATE_PIN_INIT(node_id, prop, idx) \
50
((DT_PROP_BY_IDX(node_id, prop, idx) << SAM_PINCTRL_PINMUX_POS) \
51
| (DT_PROP(node_id, bias_pull_up) << SAM_PINCTRL_PULLUP_POS) \
52
| (DT_PROP(node_id, bias_pull_down) << SAM_PINCTRL_PULLDOWN_POS) \
53
| (DT_PROP(node_id, input_enable) << SAM_PINCTRL_INPUTENABLE_POS) \
54
| (DT_PROP(node_id, output_enable) << SAM_PINCTRL_OUTPUTENABLE_POS) \
55
| (DT_ENUM_IDX(node_id, drive_strength) << SAM_PINCTRL_DRIVESTRENGTH_POS)\
56
),
57
#endif
58
65
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
66
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \
67
DT_FOREACH_PROP_ELEM, pinmux, \
68
Z_PINCTRL_STATE_PIN_INIT)}
69
80
#define SAM_PINCTRL_FLAGS_DEFAULT (0U)
81
#define SAM_PINCTRL_FLAGS_POS (0U)
82
#define SAM_PINCTRL_FLAGS_MASK (0x3F << SAM_PINCTRL_FLAGS_POS)
83
#define SAM_PINCTRL_FLAG_MASK (1U)
84
#define SAM_PINCTRL_PULLUP_POS (SAM_PINCTRL_FLAGS_POS)
85
#define SAM_PINCTRL_PULLUP (1U << SAM_PINCTRL_PULLUP_POS)
86
#define SAM_PINCTRL_PULLDOWN_POS (SAM_PINCTRL_PULLUP_POS + 1U)
87
#define SAM_PINCTRL_PULLDOWN (1U << SAM_PINCTRL_PULLDOWN_POS)
88
#define SAM_PINCTRL_OPENDRAIN_POS (SAM_PINCTRL_PULLDOWN_POS + 1U)
89
#define SAM_PINCTRL_OPENDRAIN (1U << SAM_PINCTRL_OPENDRAIN_POS)
90
#define SAM_PINCTRL_INPUTENABLE_POS (SAM_PINCTRL_OPENDRAIN_POS + 1U)
91
#define SAM_PINCTRL_INPUTENABLE (1U << SAM_PINCTRL_INPUTENABLE_POS)
92
#define SAM_PINCTRL_OUTPUTENABLE_POS (SAM_PINCTRL_INPUTENABLE_POS + 1U)
93
#define SAM_PINCTRL_OUTPUTENABLE (1U << SAM_PINCTRL_OUTPUTENABLE_POS)
94
#define SAM_PINCTRL_DRIVESTRENGTH_POS (SAM_PINCTRL_OUTPUTENABLE_POS + 1U)
95
#define SAM_PINCTRL_DRIVESTRENGTH (1U << SAM_PINCTRL_DRIVESTRENGTH_POS)
96
105
#define SAM_PINCTRL_FLAG_GET(pincfg, pos) \
106
(((pincfg) >> pos) & SAM_PINCTRL_FLAG_MASK)
105
#define SAM_PINCTRL_FLAG_GET(pincfg, pos) \
…
107
108
#define SAM_PINCTRL_FLAGS_GET(pincfg) \
109
(((pincfg) >> SAM_PINCTRL_FLAGS_POS) & SAM_PINCTRL_FLAGS_MASK)
108
#define SAM_PINCTRL_FLAGS_GET(pincfg) \
…
110
111
#ifdef __cplusplus
112
}
113
#endif
114
115
#endif
/* ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_SOC_SAM_COMMON_H_ */
devicetree.h
Devicetree main header.
types.h
pinctrl_soc_pin_t
struct pinctrl_soc_pin pinctrl_soc_pin_t
Type for R-Car pin.
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
zephyr
drivers
pinctrl
pinctrl_soc_sam_common.h
Generated on Sun May 18 2025 09:05:33 for Zephyr API Documentation by
1.12.0