Zephyr API Documentation
3.5.0
A Scalable Open Source RTOS
3.5.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
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
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
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
nrf-pinctrl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021 Nordic Semiconductor ASA
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
6
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_NRF_PINCTRL_H_
7
#define ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_NRF_PINCTRL_H_
8
9
/*
10
* The whole nRF pin configuration information is encoded in a 32-bit bitfield
11
* organized as follows:
12
*
13
* - 31..16: Pin function.
14
* - 15: Reserved.
15
* - 14: Pin inversion mode.
16
* - 13: Pin low power mode.
17
* - 12..9: Pin output drive configuration.
18
* - 8..7: Pin pull configuration.
19
* - 6..0: Pin number (combination of port and pin).
20
*/
21
28
#define NRF_FUN_POS 16U
30
#define NRF_FUN_MSK 0xFFFFU
32
#define NRF_INVERT_POS 14U
34
#define NRF_INVERT_MSK 0x1U
36
#define NRF_LP_POS 13U
38
#define NRF_LP_MSK 0x1U
40
#define NRF_DRIVE_POS 9U
42
#define NRF_DRIVE_MSK 0xFU
44
#define NRF_PULL_POS 7U
46
#define NRF_PULL_MSK 0x3U
48
#define NRF_PIN_POS 0U
50
#define NRF_PIN_MSK 0x7FU
51
60
#define NRF_FUN_UART_TX 0U
62
#define NRF_FUN_UART_RX 1U
64
#define NRF_FUN_UART_RTS 2U
66
#define NRF_FUN_UART_CTS 3U
68
#define NRF_FUN_SPIM_SCK 4U
70
#define NRF_FUN_SPIM_MOSI 5U
72
#define NRF_FUN_SPIM_MISO 6U
74
#define NRF_FUN_SPIS_SCK 7U
76
#define NRF_FUN_SPIS_MOSI 8U
78
#define NRF_FUN_SPIS_MISO 9U
80
#define NRF_FUN_SPIS_CSN 10U
82
#define NRF_FUN_TWIM_SCL 11U
84
#define NRF_FUN_TWIM_SDA 12U
86
#define NRF_FUN_I2S_SCK_M 13U
88
#define NRF_FUN_I2S_SCK_S 14U
90
#define NRF_FUN_I2S_LRCK_M 15U
92
#define NRF_FUN_I2S_LRCK_S 16U
94
#define NRF_FUN_I2S_SDIN 17U
96
#define NRF_FUN_I2S_SDOUT 18U
98
#define NRF_FUN_I2S_MCK 19U
100
#define NRF_FUN_PDM_CLK 20U
102
#define NRF_FUN_PDM_DIN 21U
104
#define NRF_FUN_PWM_OUT0 22U
106
#define NRF_FUN_PWM_OUT1 23U
108
#define NRF_FUN_PWM_OUT2 24U
110
#define NRF_FUN_PWM_OUT3 25U
112
#define NRF_FUN_QDEC_A 26U
114
#define NRF_FUN_QDEC_B 27U
116
#define NRF_FUN_QDEC_LED 28U
118
#define NRF_FUN_QSPI_SCK 29U
120
#define NRF_FUN_QSPI_CSN 30U
122
#define NRF_FUN_QSPI_IO0 31U
124
#define NRF_FUN_QSPI_IO1 32U
126
#define NRF_FUN_QSPI_IO2 33U
128
#define NRF_FUN_QSPI_IO3 34U
129
139
#define NRF_DRIVE_S0S1 0U
141
#define NRF_DRIVE_H0S1 1U
143
#define NRF_DRIVE_S0H1 2U
145
#define NRF_DRIVE_H0H1 3U
147
#define NRF_DRIVE_D0S1 4U
149
#define NRF_DRIVE_D0H1 5U
151
#define NRF_DRIVE_S0D1 6U
153
#define NRF_DRIVE_H0D1 7U
155
#define NRF_DRIVE_E0E1 11U
156
166
#define NRF_PULL_NONE 0U
168
#define NRF_PULL_DOWN 1U
170
#define NRF_PULL_UP 3U
171
180
#define NRF_LP_DISABLE 0U
182
#define NRF_LP_ENABLE 1U
183
192
#define NRF_PIN_DISCONNECTED NRF_PIN_MSK
193
203
#define NRF_PSEL(fun, port, pin) \
204
((((((port) * 32U) + (pin)) & NRF_PIN_MSK) << NRF_PIN_POS) | \
205
((NRF_FUN_ ## fun & NRF_FUN_MSK) << NRF_FUN_POS))
206
215
#define NRF_PSEL_DISCONNECTED(fun) \
216
(NRF_PIN_DISCONNECTED | \
217
((NRF_FUN_ ## fun & NRF_FUN_MSK) << NRF_FUN_POS))
218
219
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_NRF_PINCTRL_H_ */
zephyr
dt-bindings
pinctrl
nrf-pinctrl.h
Generated on Fri Oct 20 2023 10:27:12 for Zephyr API Documentation by
1.9.6