summaryrefslogtreecommitdiff
path: root/ports/nrf/mpconfigport.mk
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2019-07-15 19:56:21 -0500
committerJeff Epler <jepler@gmail.com>2019-07-26 07:57:11 -0500
commita183425e001e3a7e61ae3bfa7cb5f8cee5922974 (patch)
treebc0b37bbb641feec515dd6027bf47e0f205403ae /ports/nrf/mpconfigport.mk
parent2bc704fe072f83772d0fe35803b4a462ee5a331a (diff)
ports/nrf: Implement audioio.AudioOut using PWM
This implements AudioOut, with known caveats: * pause/resume are not yet implemented (this is just a bug) * at best, the sample fidelity is 8 bits (this is a hardware limitation) Testing performed: My test system is a Particle Xenon with a PAM8302 op-amp https://www.adafruit.com/product/2130 and 8-ohm speaker. There's no analog filtering between the Xenon's PWM pin and the "A+" input of the amplifier; the "A-" pin is disconnected. It is powered from VUSB. I used pin D4, which is *NOT* listed as a low-speed-only pin, but the code does NOT switch the pin to high drive. This is related to an open issue for general inability to set drive level for pins being used by a "special function" on nrf: https://github.com/adafruit/circuitpython/issues/1270 Nothing about the code I've written should limit the usable pins. All samples I played were 16-bit, generally monophonic at 11025Hz and 22050Hz from the Debian LibreOffice package.
Diffstat (limited to 'ports/nrf/mpconfigport.mk')
-rw-r--r--ports/nrf/mpconfigport.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk
index 83166708a..57879bbaa 100644
--- a/ports/nrf/mpconfigport.mk
+++ b/ports/nrf/mpconfigport.mk
@@ -10,8 +10,10 @@ USB_SERIAL_NUMBER_LENGTH = 16
# All nRF ports have longints.
LONGINT_IMPL = MPZ
-# No DAC, so no regular audio.
+# Audio via PWM
+CIRCUITPY_AUDIOCORE = 1
CIRCUITPY_AUDIOIO = 0
+CIRCUITPY_AUDIOPWMIO = 1
# No I2S yet.
CIRCUITPY_AUDIOBUSIO = 0