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
►
devicetree.h
►
pcie
►
pinctrl
►
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
devicetree.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024, Ambiq Micro Inc. <www.ambiq.com>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_DRIVERS_MSPI_DEVICETREE_H_
8
#define ZEPHYR_INCLUDE_DRIVERS_MSPI_DEVICETREE_H_
9
17
#include <
zephyr/drivers/gpio.h
>
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
32
#define MSPI_DEVICE_CONFIG_DT(mspi_dev) \
33
{ \
34
.ce_num = DT_PROP_OR(mspi_dev, mspi_hardware_ce_num, 0), \
35
.freq = DT_PROP(mspi_dev, mspi_max_frequency), \
36
.io_mode = DT_ENUM_IDX_OR(mspi_dev, mspi_io_mode, \
37
MSPI_IO_MODE_SINGLE), \
38
.data_rate = DT_ENUM_IDX_OR(mspi_dev, mspi_data_rate, \
39
MSPI_DATA_RATE_SINGLE), \
40
.cpp = DT_ENUM_IDX_OR(mspi_dev, mspi_cpp_mode, MSPI_CPP_MODE_0), \
41
.endian = DT_ENUM_IDX_OR(mspi_dev, mspi_endian, \
42
MSPI_XFER_LITTLE_ENDIAN), \
43
.ce_polarity = DT_ENUM_IDX_OR(mspi_dev, mspi_ce_polarity, \
44
MSPI_CE_ACTIVE_LOW), \
45
.dqs_enable = DT_PROP(mspi_dev, mspi_dqs_enable), \
46
.rx_dummy = DT_PROP_OR(mspi_dev, rx_dummy, 0), \
47
.tx_dummy = DT_PROP_OR(mspi_dev, tx_dummy, 0), \
48
.read_cmd = DT_PROP_OR(mspi_dev, read_command, 0), \
49
.write_cmd = DT_PROP_OR(mspi_dev, write_command, 0), \
50
.cmd_length = DT_ENUM_IDX_OR(mspi_dev, command_length, 0), \
51
.addr_length = DT_ENUM_IDX_OR(mspi_dev, address_length, 0), \
52
.mem_boundary = COND_CODE_1(DT_NODE_HAS_PROP(mspi_dev, ce_break_config), \
53
(DT_PROP_BY_IDX(mspi_dev, ce_break_config, 0)), \
54
(0)), \
55
.time_to_break = COND_CODE_1(DT_NODE_HAS_PROP(mspi_dev, ce_break_config), \
56
(DT_PROP_BY_IDX(mspi_dev, ce_break_config, 1)), \
57
(0)), \
58
}
32
#define MSPI_DEVICE_CONFIG_DT(mspi_dev) \
…
59
68
#define MSPI_DEVICE_CONFIG_DT_INST(inst) MSPI_DEVICE_CONFIG_DT(DT_DRV_INST(inst))
69
79
#define MSPI_XIP_CONFIG_DT_NO_CHECK(mspi_dev) \
80
{ \
81
.enable = DT_PROP_BY_IDX(mspi_dev, xip_config, 0), \
82
.address_offset = DT_PROP_BY_IDX(mspi_dev, xip_config, 1), \
83
.size = DT_PROP_BY_IDX(mspi_dev, xip_config, 2), \
84
.permission = DT_PROP_BY_IDX(mspi_dev, xip_config, 3), \
85
}
79
#define MSPI_XIP_CONFIG_DT_NO_CHECK(mspi_dev) \
…
86
96
#define MSPI_XIP_CONFIG_DT(mspi_dev) \
97
COND_CODE_1(DT_NODE_HAS_PROP(mspi_dev, xip_config), \
98
(MSPI_XIP_CONFIG_DT_NO_CHECK(mspi_dev)), \
99
({}))
96
#define MSPI_XIP_CONFIG_DT(mspi_dev) \
…
100
109
#define MSPI_XIP_CONFIG_DT_INST(inst) MSPI_XIP_CONFIG_DT(DT_DRV_INST(inst))
110
120
#define MSPI_SCRAMBLE_CONFIG_DT_NO_CHECK(mspi_dev) \
121
{ \
122
.enable = DT_PROP_BY_IDX(mspi_dev, scramble_config, 0), \
123
.address_offset = DT_PROP_BY_IDX(mspi_dev, scramble_config, 1), \
124
.size = DT_PROP_BY_IDX(mspi_dev, scramble_config, 2), \
125
}
120
#define MSPI_SCRAMBLE_CONFIG_DT_NO_CHECK(mspi_dev) \
…
126
136
#define MSPI_SCRAMBLE_CONFIG_DT(mspi_dev) \
137
COND_CODE_1(DT_NODE_HAS_PROP(mspi_dev, scramble_config), \
138
(MSPI_SCRAMBLE_CONFIG_DT_NO_CHECK(mspi_dev)), \
139
({}))
136
#define MSPI_SCRAMBLE_CONFIG_DT(mspi_dev) \
…
140
149
#define MSPI_SCRAMBLE_CONFIG_DT_INST(inst) MSPI_SCRAMBLE_CONFIG_DT(DT_DRV_INST(inst))
150
160
#define MSPI_DEVICE_ID_DT(mspi_dev) \
161
{ \
162
.ce = MSPI_DEV_CE_GPIOS_DT_SPEC_GET(mspi_dev), \
163
.dev_idx = DT_REG_ADDR(mspi_dev), \
164
}
160
#define MSPI_DEVICE_ID_DT(mspi_dev) \
…
165
174
#define MSPI_DEVICE_ID_DT_INST(inst) MSPI_DEVICE_ID_DT(DT_DRV_INST(inst))
175
176
214
#define MSPI_DEV_CE_GPIOS_DT_SPEC_GET(mspi_dev) \
215
GPIO_DT_SPEC_GET_BY_IDX_OR(DT_BUS(mspi_dev), ce_gpios, \
216
DT_REG_ADDR_RAW(mspi_dev), {})
214
#define MSPI_DEV_CE_GPIOS_DT_SPEC_GET(mspi_dev) \
…
217
227
#define MSPI_DEV_CE_GPIOS_DT_SPEC_INST_GET(inst) \
228
MSPI_DEV_CE_GPIOS_DT_SPEC_GET(DT_DRV_INST(inst))
227
#define MSPI_DEV_CE_GPIOS_DT_SPEC_INST_GET(inst) \
…
229
230
241
#define MSPI_CE_GPIOS_DT_SPEC_GET(node_id) \
242
{ \
243
COND_CODE_1(DT_NODE_HAS_PROP(node_id, ce_gpios), \
244
(DT_FOREACH_PROP_ELEM_SEP(node_id, ce_gpios, GPIO_DT_SPEC_GET_BY_IDX, (,))), \
245
()) \
246
}
241
#define MSPI_CE_GPIOS_DT_SPEC_GET(node_id) \
…
247
257
#define MSPI_CE_GPIOS_DT_SPEC_INST_GET(inst) \
258
MSPI_CE_GPIOS_DT_SPEC_GET(DT_DRV_INST(inst))
257
#define MSPI_CE_GPIOS_DT_SPEC_INST_GET(inst) \
…
259
298
#define MSPI_CE_CONTROL_INIT(node_id, delay_) \
299
{ \
300
.gpio = MSPI_DEV_CE_GPIOS_DT_SPEC_GET(node_id), .delay = (delay_), \
301
}
298
#define MSPI_CE_CONTROL_INIT(node_id, delay_) \
…
302
316
#define MSPI_CE_CONTROL_INIT_INST(inst, delay_) MSPI_CE_CONTROL_INIT(DT_DRV_INST(inst), delay_)
317
318
#ifdef __cplusplus
319
}
320
#endif
321
326
#endif
/* ZEPHYR_INCLUDE_DRIVERS_MSPI_DEVICETREE_H_ */
gpio.h
Public APIs for GPIO drivers.
zephyr
drivers
mspi
devicetree.h
Generated on Sun May 18 2025 21:05:52 for Zephyr API Documentation by
1.12.0