1/*
2 * Copyright (c) 2023 Marcin Niestroj
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#include <zephyr/dt-bindings/gpio/gpio.h>
7#include <zephyr/dt-bindings/gpio/st-morpho-header.h>
8
9/ {
10	st_morpho_header: st-morpho-header {
11		compatible = "st-morpho-header";
12		#gpio-cells = <2>;
13		gpio-map-mask = <ST_MORPHO_PIN_MASK 0x0>;
14		gpio-map-pass-thru = <0x0 GPIO_DT_FLAGS_MASK>;
15		gpio-map = <ST_MORPHO_L_7 0 &gpioh 3 0>,
16			   <ST_MORPHO_L_13 0 &gpioa 13 0>, /* shared with SWD connected to STLINK */
17			   <ST_MORPHO_L_15 0 &gpioa 14 0>, /* shared with SWD connected to STLINK */
18			   <ST_MORPHO_L_17 0 &gpioa 15 0>,
19			   <ST_MORPHO_L_23 0 &gpioc 13 0>,
20			   <ST_MORPHO_L_25 0 &gpioc 14 0>,
21			   <ST_MORPHO_L_27 0 &gpioc 15 0>,
22			   <ST_MORPHO_L_28 0 &gpiob 1 0>,
23			   <ST_MORPHO_L_30 0 &gpiob 2 0>,
24			   <ST_MORPHO_L_32 0 &gpioa 10 0>,
25			   <ST_MORPHO_L_34 0 &gpiob 4 0>,
26			   <ST_MORPHO_L_36 0 &gpiob 14 0>,
27			   <ST_MORPHO_L_38 0 &gpiob 13 0>,
28
29			   <ST_MORPHO_R_1 0 &gpioa 0 0>,
30			   <ST_MORPHO_R_2 0 &gpioc 4 0>,
31			   <ST_MORPHO_R_3 0 &gpioa 12 0>,
32			   <ST_MORPHO_R_4 0 &gpioc 5 0>,
33			   <ST_MORPHO_R_5 0 &gpioa 11 0>,
34			   <ST_MORPHO_R_11 0 &gpioa 5 0>,
35			   <ST_MORPHO_R_12 0 &gpioc 6 0>,
36			   <ST_MORPHO_R_13 0 &gpioa 6 0>,
37			   <ST_MORPHO_R_14 0 &gpioc 0 0>,
38			   <ST_MORPHO_R_15 0 &gpioa 7 0>,
39			   <ST_MORPHO_R_16 0 &gpioa 8 0>,
40			   <ST_MORPHO_R_17 0 &gpioa 4 0>,
41			   <ST_MORPHO_R_19 0 &gpioa 9 0>,
42			   <ST_MORPHO_R_21 0 &gpioc 2 0>,
43			   <ST_MORPHO_R_22 0 &gpiob 0 0>,
44			   <ST_MORPHO_R_23 0 &gpioc 1 0>,
45			   <ST_MORPHO_R_25 0 &gpiob 10 0>,
46			   <ST_MORPHO_R_26 0 &gpiob 9 0>,
47			   <ST_MORPHO_R_27 0 &gpiob 8 0>,
48			   <ST_MORPHO_R_28 0 &gpiob 15 0>,
49			   <ST_MORPHO_R_29 0 &gpiob 5 0>,
50			   <ST_MORPHO_R_30 0 &gpiob 11 0>,
51			   <ST_MORPHO_R_31 0 &gpiob 3 0>,
52			   <ST_MORPHO_R_33 0 &gpiob 12 0>,
53			   <ST_MORPHO_R_35 0 &gpiob 6 0>, /* SB7=ON, SB2=OFF, SB6=OFF */
54			   <ST_MORPHO_R_36 0 &gpioa 1 0>,
55			   <ST_MORPHO_R_37 0 &gpiob 7 0>, /* SB9=ON, SB4=OFF, SB10=OFF */
56			   <ST_MORPHO_R_38 0 &gpioc 3 0>;
57	};
58};
59