-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
variants: Add rpi_pico #115
Merged
+205
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/adc/adc.h> | ||
|
||
/ { | ||
zephyr,user { | ||
digital-pin-gpios = <&pico_header 0 0>, | ||
<&pico_header 1 0>, | ||
<&pico_header 2 0>, | ||
<&pico_header 3 0>, | ||
<&pico_header 4 0>, | ||
<&pico_header 5 0>, | ||
<&pico_header 6 0>, | ||
<&pico_header 7 0>, | ||
<&pico_header 8 0>, | ||
<&pico_header 9 0>, | ||
<&pico_header 10 0>, | ||
<&pico_header 11 0>, | ||
<&pico_header 12 0>, | ||
<&pico_header 13 0>, | ||
<&pico_header 14 0>, | ||
<&pico_header 15 0>, | ||
<&pico_header 16 0>, | ||
<&pico_header 17 0>, | ||
<&pico_header 18 0>, | ||
<&pico_header 19 0>, | ||
<&pico_header 20 0>, | ||
<&pico_header 21 0>, | ||
<&pico_header 22 0>, | ||
<&gpio0 23 0>, | ||
<&gpio0 24 0>, | ||
<&gpio0 25 0>, | ||
<&pico_header 26 0>, | ||
<&pico_header 27 0>, | ||
<&pico_header 28 0>; | ||
|
||
builtin-led-gpios = <&gpio0 25 0>; | ||
|
||
pwm-pin-gpios = <&pico_header 2 0>, | ||
<&pico_header 3 0>, | ||
<&pico_header 7 0>, | ||
<&pico_header 8 0>, | ||
<&pico_header 10 0>, | ||
<&pico_header 11 0>, | ||
<&pico_header 12 0>, | ||
<&pico_header 13 0>, | ||
<&pico_header 14 0>, | ||
<&pico_header 15 0>, | ||
<&pico_header 20 0>, | ||
<&pico_header 21 0>, | ||
<&pico_header 22 0>, | ||
<&gpio0 25 0>; | ||
|
||
adc-pin-gpios = <&pico_header 26 0>, | ||
<&pico_header 27 0>, | ||
<&pico_header 28 0>; | ||
|
||
pwms = <&pwm 2 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 3 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 7 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 8 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 10 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 11 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 12 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 13 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 14 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 15 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 4 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 5 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 6 255 PWM_POLARITY_NORMAL>, | ||
<&pwm 9 255 PWM_POLARITY_NORMAL>; | ||
|
||
io-channels = <&adc 0>, | ||
<&adc 1>, | ||
<&adc 2>; | ||
|
||
serials = <&pico_serial>; | ||
i2cs = <&pico_i2c0>; | ||
spis = <&pico_spi>; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
pwm_ch1a_default: pwm_ch1a_default { | ||
group1 { | ||
pinmux = <PWM_1A_P2>; | ||
}; | ||
}; | ||
|
||
pwm_ch1b_default: pwm_ch1b_default { | ||
group1 { | ||
pinmux = <PWM_1B_P3>; | ||
}; | ||
}; | ||
|
||
pwm_ch2a_default: pwm_ch2a_default { | ||
group1 { | ||
pinmux = <PWM_2A_P20>; | ||
}; | ||
}; | ||
|
||
pwm_ch2b_default: pwm_ch2b_default { | ||
group1 { | ||
pinmux = <PWM_2B_P21>; | ||
}; | ||
}; | ||
|
||
pwm_ch3a_default: pwm_ch3a_default { | ||
group1 { | ||
pinmux = <PWM_3A_P22>; | ||
}; | ||
}; | ||
|
||
pwm_ch3b_default: pwm_ch3b_default { | ||
group1 { | ||
pinmux = <PWM_3B_P7>; | ||
}; | ||
}; | ||
|
||
pwm_ch4a_default: pwm_ch4a_default { | ||
group1 { | ||
pinmux = <PWM_4A_P8>; | ||
}; | ||
}; | ||
|
||
pwm_ch5a_default: pwm_ch5a_default { | ||
group1 { | ||
pinmux = <PWM_5A_P10>; | ||
}; | ||
}; | ||
|
||
pwm_ch5b_default: pwm_ch5b_default { | ||
group1 { | ||
pinmux = <PWM_5B_P11>; | ||
}; | ||
}; | ||
|
||
pwm_ch6a_default: pwm_ch6a_default { | ||
group1 { | ||
pinmux = <PWM_6A_P12>; | ||
}; | ||
}; | ||
|
||
pwm_ch6b_default: pwm_ch6b_default { | ||
group1 { | ||
pinmux = <PWM_6B_P13>; | ||
}; | ||
}; | ||
|
||
pwm_ch7a_default: pwm_ch7a_default { | ||
group1 { | ||
pinmux = <PWM_7A_P14>; | ||
}; | ||
}; | ||
|
||
pwm_ch7b_default: pwm_ch7b_default { | ||
group1 { | ||
pinmux = <PWM_7B_P15>; | ||
}; | ||
}; | ||
}; | ||
|
||
&pwm { | ||
status = "okay"; | ||
divider-frac-4 = <15>; | ||
divider-int-4 = <255>; | ||
}; | ||
|
||
&adc { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
|
||
channel@0 { | ||
reg = <0>; | ||
zephyr,gain = "ADC_GAIN_1"; | ||
zephyr,reference = "ADC_REF_INTERNAL"; | ||
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; | ||
zephyr,resolution = <12>; | ||
}; | ||
|
||
channel@1 { | ||
reg = <1>; | ||
zephyr,gain = "ADC_GAIN_1"; | ||
zephyr,reference = "ADC_REF_INTERNAL"; | ||
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; | ||
zephyr,resolution = <12>; | ||
}; | ||
|
||
channel@2 { | ||
reg = <2>; | ||
zephyr,gain = "ADC_GAIN_1"; | ||
zephyr,reference = "ADC_REF_INTERNAL"; | ||
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; | ||
zephyr,resolution = <12>; | ||
}; | ||
}; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* | ||
* Copyright (c) 2024 TOKITA Hiroshi | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, do you want to have anything in CI for checking if this platform builds fine for atleast 1 sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If yes, please feel free to submit it with this PR itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with github actions, but you might be able to combine a sample and a board in this way.
https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#about-matrix-strategies