circuitpython/ports/nrf/common-hal
Jeff Epler a183425e00 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.
2019-07-26 07:57:11 -05:00
..
analogio Update copyrights; get ready for Central 2019-06-19 10:42:36 -04:00
audiopwmio ports/nrf: Implement audioio.AudioOut using PWM 2019-07-26 07:57:11 -05:00
bleio Address review comments. 2019-07-16 19:53:36 -04:00
board Remove nRF52832 support 2018-12-30 22:49:20 -05:00
busio Add support for grayscale displays that are < 8 bit depth. 2019-07-19 16:06:11 -07:00
digitalio Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
displayio Improvements thanks to danh's review 2019-01-18 16:37:06 -08:00
microcontroller Add feature conditionals and clean up 2019-07-22 12:58:28 -04:00
neopixel_write nrf: fix neopixel_write pwm buf size calc 2019-06-20 18:02:14 -04:00
nvm Fix up single-byte access to nvm.ByteArray 2019-04-16 14:53:44 +10:00
os nrf: Rewrite the os common-hal using nrfx 2018-06-27 21:01:07 +02:00
pulseio ports/nrf: factor out routines for allocating, freeing pwm channels 2019-07-26 07:52:37 -05:00
rotaryio Change pin mode to pullup for adafruit/circuitpython#1045 2019-02-07 09:47:56 +11:00
rtc Remove unnecessary MP_WEAK declarations 2019-04-02 13:33:22 +11:00
supervisor replacing change to input() with separate method to check for USB Serial input 2018-10-09 18:37:52 -04:00
time nrf: Remove the old time hal and replace with nRFx 2018-07-10 14:59:10 +02:00
touchio Automatically set a default threshold for touchio.TouchIn channels 2019-01-28 18:22:57 +11:00