Zephyr API Documentation
4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pinctrl_nxp_port_common.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022, 2024 NXP
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
/*
8
* @file
9
* NXP PORT SOC specific helpers for pinctrl driver
10
*/
11
12
13
#ifndef ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_NXP_PORT_COMMON_H_
14
#define ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_NXP_PORT_COMMON_H_
15
18
#include <
zephyr/devicetree.h
>
19
#include <
zephyr/types.h
>
20
21
/* Include SOC headers, so we get definitions for PCR bitmasks */
22
#include <soc.h>
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
/*
29
* Some PORT IP instantiations lack certain features, include input buffers,
30
* open drain, and slew rate. If masks aren't defined for these bitfields,
31
* define them to have no effect
32
*/
33
#ifndef PORT_PCR_IBE_MASK
/* Input buffer enable */
34
#define PORT_PCR_IBE_MASK 0x0
35
#define PORT_PCR_IBE(x) 0x0
36
#endif
37
38
#ifndef PORT_PCR_SRE_MASK
/* Slew rate */
39
#define PORT_PCR_SRE_MASK 0x0
40
#define PORT_PCR_SRE(x) 0x0
41
#endif
42
43
#ifndef PORT_PCR_ODE_MASK
/* Open drain */
44
#define PORT_PCR_ODE_MASK 0x0
45
#define PORT_PCR_ODE(x) 0x0
46
#endif
47
48
49
typedef
uint32_t
pinctrl_soc_pin_t
;
50
51
#define Z_PINCTRL_NXP_PORT_PINCFG(node_id) \
52
(PORT_PCR_DSE(DT_ENUM_IDX(node_id, drive_strength)) | \
53
PORT_PCR_PS(DT_PROP(node_id, bias_pull_up)) | \
54
PORT_PCR_PE(DT_PROP(node_id, bias_pull_up)) | \
55
PORT_PCR_PE(DT_PROP(node_id, bias_pull_down)) | \
56
PORT_PCR_ODE(DT_PROP(node_id, drive_open_drain)) | \
57
PORT_PCR_SRE(DT_ENUM_IDX(node_id, slew_rate)) | \
58
PORT_PCR_IBE(DT_PROP(node_id, input_enable)) | \
59
PORT_PCR_PFE(DT_PROP(node_id, nxp_passive_filter)))
60
61
#define Z_PINCTRL_NXP_PORT_PCR_MASK \
62
(PORT_PCR_MUX_MASK | PORT_PCR_DSE_MASK | PORT_PCR_ODE_MASK | PORT_PCR_PFE_MASK | \
63
PORT_PCR_IBE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK)
64
65
#define Z_PINCTRL_STATE_PIN_INIT(group, pin_prop, idx) \
66
DT_PROP_BY_IDX(group, pin_prop, idx) | Z_PINCTRL_NXP_PORT_PINCFG(group),
67
68
#define Z_PINCTRL_STATE_PINS_INIT(node_id, prop) \
69
{DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), DT_FOREACH_PROP_ELEM, pinmux, \
70
Z_PINCTRL_STATE_PIN_INIT)};
71
72
#ifdef __cplusplus
73
}
74
#endif
75
78
#endif
/* ZEPHYR_INCLUDE_DRIVERS_PINCTRL_PINCTRL_NXP_PORT_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_nxp_port_common.h
Generated on Sat Nov 23 2024 00:03:25 for Zephyr API Documentation by
1.12.0