Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0af5724

Browse files
committed
variants: Add rpi_pico
Add support for RaspberryPi Pico Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1 parent d190e21 commit 0af5724

File tree

2 files changed

+205
-0
lines changed

2 files changed

+205
-0
lines changed

‎variants/rpi_pico/rpi_pico.overlay‎

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/adc/adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
digital-pin-gpios = <&pico_header 0 0>,
12+
<&pico_header 1 0>,
13+
<&pico_header 2 0>,
14+
<&pico_header 3 0>,
15+
<&pico_header 4 0>,
16+
<&pico_header 5 0>,
17+
<&pico_header 6 0>,
18+
<&pico_header 7 0>,
19+
<&pico_header 8 0>,
20+
<&pico_header 9 0>,
21+
<&pico_header 10 0>,
22+
<&pico_header 11 0>,
23+
<&pico_header 12 0>,
24+
<&pico_header 13 0>,
25+
<&pico_header 14 0>,
26+
<&pico_header 15 0>,
27+
<&pico_header 16 0>,
28+
<&pico_header 17 0>,
29+
<&pico_header 18 0>,
30+
<&pico_header 19 0>,
31+
<&pico_header 20 0>,
32+
<&pico_header 21 0>,
33+
<&pico_header 22 0>,
34+
<&gpio0 23 0>,
35+
<&gpio0 24 0>,
36+
<&gpio0 25 0>,
37+
<&pico_header 26 0>,
38+
<&pico_header 27 0>,
39+
<&pico_header 28 0>;
40+
41+
builtin-led-gpios = <&gpio0 25 0>;
42+
43+
pwm-pin-gpios = <&pico_header 2 0>,
44+
<&pico_header 3 0>,
45+
<&pico_header 7 0>,
46+
<&pico_header 8 0>,
47+
<&pico_header 10 0>,
48+
<&pico_header 11 0>,
49+
<&pico_header 12 0>,
50+
<&pico_header 13 0>,
51+
<&pico_header 14 0>,
52+
<&pico_header 15 0>,
53+
<&pico_header 20 0>,
54+
<&pico_header 21 0>,
55+
<&pico_header 22 0>,
56+
<&gpio0 25 0>;
57+
58+
adc-pin-gpios = <&pico_header 26 0>,
59+
<&pico_header 27 0>,
60+
<&pico_header 28 0>;
61+
62+
pwms = <&pwm 2 255 PWM_POLARITY_NORMAL>,
63+
<&pwm 3 255 PWM_POLARITY_NORMAL>,
64+
<&pwm 7 255 PWM_POLARITY_NORMAL>,
65+
<&pwm 8 255 PWM_POLARITY_NORMAL>,
66+
<&pwm 10 255 PWM_POLARITY_NORMAL>,
67+
<&pwm 11 255 PWM_POLARITY_NORMAL>,
68+
<&pwm 12 255 PWM_POLARITY_NORMAL>,
69+
<&pwm 13 255 PWM_POLARITY_NORMAL>,
70+
<&pwm 14 255 PWM_POLARITY_NORMAL>,
71+
<&pwm 15 255 PWM_POLARITY_NORMAL>,
72+
<&pwm 4 255 PWM_POLARITY_NORMAL>,
73+
<&pwm 5 255 PWM_POLARITY_NORMAL>,
74+
<&pwm 6 255 PWM_POLARITY_NORMAL>,
75+
<&pwm 9 255 PWM_POLARITY_NORMAL>;
76+
77+
io-channels = <&adc 0>,
78+
<&adc 1>,
79+
<&adc 2>;
80+
81+
serials = <&pico_serial>;
82+
i2cs = <&pico_i2c0>;
83+
spis = <&pico_spi>;
84+
};
85+
};
86+
87+
&pinctrl {
88+
pwm_ch1a_default: pwm_ch1a_default {
89+
group1 {
90+
pinmux = <PWM_1A_P2>;
91+
};
92+
};
93+
94+
pwm_ch1b_default: pwm_ch1b_default {
95+
group1 {
96+
pinmux = <PWM_1B_P3>;
97+
};
98+
};
99+
100+
pwm_ch2a_default: pwm_ch2a_default {
101+
group1 {
102+
pinmux = <PWM_2A_P20>;
103+
};
104+
};
105+
106+
pwm_ch2b_default: pwm_ch2b_default {
107+
group1 {
108+
pinmux = <PWM_2B_P21>;
109+
};
110+
};
111+
112+
pwm_ch3a_default: pwm_ch3a_default {
113+
group1 {
114+
pinmux = <PWM_3A_P22>;
115+
};
116+
};
117+
118+
pwm_ch3b_default: pwm_ch3b_default {
119+
group1 {
120+
pinmux = <PWM_3B_P7>;
121+
};
122+
};
123+
124+
pwm_ch4a_default: pwm_ch4a_default {
125+
group1 {
126+
pinmux = <PWM_4A_P8>;
127+
};
128+
};
129+
130+
pwm_ch5a_default: pwm_ch5a_default {
131+
group1 {
132+
pinmux = <PWM_5A_P10>;
133+
};
134+
};
135+
136+
pwm_ch5b_default: pwm_ch5b_default {
137+
group1 {
138+
pinmux = <PWM_5B_P11>;
139+
};
140+
};
141+
142+
pwm_ch6a_default: pwm_ch6a_default {
143+
group1 {
144+
pinmux = <PWM_6A_P12>;
145+
};
146+
};
147+
148+
pwm_ch6b_default: pwm_ch6b_default {
149+
group1 {
150+
pinmux = <PWM_6B_P13>;
151+
};
152+
};
153+
154+
pwm_ch7a_default: pwm_ch7a_default {
155+
group1 {
156+
pinmux = <PWM_7A_P14>;
157+
};
158+
};
159+
160+
pwm_ch7b_default: pwm_ch7b_default {
161+
group1 {
162+
pinmux = <PWM_7B_P15>;
163+
};
164+
};
165+
};
166+
167+
&pwm {
168+
status = "okay";
169+
divider-frac-4 = <15>;
170+
divider-int-4 = <255>;
171+
};
172+
173+
&adc {
174+
#address-cells = <1>;
175+
#size-cells = <0>;
176+
177+
channel@0 {
178+
reg = <0>;
179+
zephyr,gain = "ADC_GAIN_1";
180+
zephyr,reference = "ADC_REF_INTERNAL";
181+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
182+
zephyr,resolution = <12>;
183+
};
184+
185+
channel@1 {
186+
reg = <1>;
187+
zephyr,gain = "ADC_GAIN_1";
188+
zephyr,reference = "ADC_REF_INTERNAL";
189+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
190+
zephyr,resolution = <12>;
191+
};
192+
193+
channel@2 {
194+
reg = <2>;
195+
zephyr,gain = "ADC_GAIN_1";
196+
zephyr,reference = "ADC_REF_INTERNAL";
197+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
198+
zephyr,resolution = <12>;
199+
};
200+
};

‎variants/rpi_pico/variant.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Copyright (c) 2024 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /