c6bc9c48c9
tested on metro m7 (green prototype version) with max98357a i2s amplifier and the following test code: ```py import board import time import digitalio from audiobusio import I2SOut from audiocore import RawSample from microcontroller import pin from ulab import numpy as np n = np.array(np.sin(np.linspace(0, np.pi*2, 218, endpoint=False)) * 200, dtype=np.int16) print(n) r = RawSample(n, sample_rate=8000, channel_count=2) def main(): with digitalio.DigitalInOut(board.LED) as l: l.switch_to_output(True) value = False while True: with I2SOut(pin.GPIO_06, pin.GPIO_07, pin.GPIO_04) as i: time.sleep(.01) l.value = value = not value i.play(r, loop=True) print(i.playing) time.sleep(.5) i.stop() print("STOPPED") print(i.playing) time.sleep(.5) i.play(r, loop=True) print(i.playing) print("PLAY AGAIN") time.sleep(.5) time.sleep(1) ``` Only stereo, 16-bit, raw samples were tested; the sample rate is actually fixed at 48kHz in the core right now. There is more to do, but the basics work. # Conflicts: # ports/mimxrt10xx/Makefile # ports/mimxrt10xx/mpconfigport.mk
30 lines
666 B
Makefile
30 lines
666 B
Makefile
LD_FILE = $(FLASH).ld $(CHIP_FAMILY).ld imxrt10xx.ld
|
|
|
|
INTERNAL_LIBM = 1
|
|
|
|
USB_HIGHSPEED = 1
|
|
|
|
# Number of USB endpoint pairs.
|
|
USB_NUM_ENDPOINT_PAIRS = 8
|
|
# Align buffers on the cache boundary so we don't inadvertently load them early.
|
|
CIRCUITPY_TUSB_MEM_ALIGN = 32
|
|
|
|
INTERNAL_FLASH_FILESYSTEM = 1
|
|
|
|
CIRCUITPY_AUDIOBUSIO = 1
|
|
CIRCUITPY_AUDIOBUSIO_PDMIN = 0
|
|
CIRCUITPY_AUDIOCORE = 1
|
|
CIRCUITPY_AUDIOIO = 0
|
|
CIRCUITPY_BUSDEVICE = 1
|
|
CIRCUITPY_COUNTIO = 0
|
|
CIRCUITPY_FREQUENCYIO = 0
|
|
CIRCUITPY_I2CTARGET = 0
|
|
CIRCUITPY_NVM = 0
|
|
CIRCUITPY_PARALLELDISPLAY = 0
|
|
CIRCUITPY_PULSEIO = 0
|
|
CIRCUITPY_ROTARYIO = 0
|
|
CIRCUITPY_USB_MIDI = 1
|
|
LONGINT_IMPL = MPZ
|
|
|
|
CIRCUITPY_BUILD_EXTENSIONS ?= hex,uf2
|