-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
raspberrypi: support PIO on high pins #9901
base: main
Are you sure you want to change the base?
Conversation
ping @ladyada |
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 believe you! but maybe @dhalbert can do a more 👁️ review
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.
Thank you for doing all this work! The macros to manipulate bitmasks are a nice addition. At first I thought they were pre-existing, but I saw that you added them.
- I merged the Pico-PIO-USB update. Could you update to the merge commit? Thanks.
- I tested I2SOut on Feather RP2040. I happened to have a test program that played a tone. No sound comes out with this build. Feather RP2040 PropMaker would also be an easy test board.
test program: this was adapted from a test program someone else had supplied for testing something else entirely
import array
import audiocore
import audiobusio
import board
import math
import time
# I2S audio out
audio = audiobusio.I2SOut(board.D9, board.D10, board.D11)
# Generate one period of sine wave.
length = 8000 // 440
sine_wave = array.array("H", [0] * length)
for i in range(length):
val = int(math.sin(math.pi * 2 * i / length) * (2 ** 15 - 1) + 2 ** 15)
sine_wave[i] = val
sine_wave = audiocore.RawSample(sine_wave, sample_rate=8000)
while True:
audio.play(sine_wave, loop=True)
time.sleep(2)
audio.stop()
Testing performed: on a Metro RP2350 prototype, used
neopixel_write
on pin A0 (GPIO41) & scoped it.Also, the built in neopixel still works.
Note that this does not enable USB Host on the 4-pin header, see sekigon-gonnoc/Pico-PIO-USB#133This also fixes USB Host, though it depends on an additional pull request: adafruit/Pico-PIO-USB#1 (us) or sekigon-gonnoc/Pico-PIO-USB#157 (upstream)
Closes: #9897