Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jepler
Copy link
Member

@jepler jepler commented Dec 20, 2024

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#133

This 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

@jepler jepler requested a review from dhalbert December 20, 2024 16:09
@jepler
Copy link
Member Author

jepler commented Dec 20, 2024

ping @ladyada

ladyada
ladyada previously approved these changes Dec 20, 2024
Copy link
Member

@ladyada ladyada left a 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

Copy link
Collaborator

@dhalbert dhalbert left a 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.

  1. I merged the Pico-PIO-USB update. Could you update to the merge commit? Thanks.
  2. 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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support PIO pins >31
3 participants