Commit Graph
11 Commits
Author SHA1 Message Date
Earle F. Philhower, III be0ee8283f Free BCK and WS pins for general use with NoDAC (#251)
The BCK and WS pins aren't needed or used when using the I2SNoDAC
option.  Restore their settings to whatever they were before, leaving
them untouched.  Apps may configure the additional pins either before or
after the I2SNoDac is created.
2020-04-14 11:49:12 -07:00
Earle F. Philhower, III 0987b12e58 Fix 8->16 bit output conversion overflow error
The I2S outputs were converting samples in the buffer passed in
from u8->s16 on every call.  When the I2S was full, however, the
sample would not get pushed and the output function would be
called at a later time with the same buffer...which was already
at 16 bits.  It'd be converted again and turned into a high
frequency noise on the output.

Now only modify a copy of the input sample in I2S and I2SNoDAC.
Fixes the conversion problem competely.

Fixes #2
2018-05-23 22:40:29 -07:00
Earle F. Philhower, III 54498a21a0 Fix overflow for 256x oversampling
Fixes #55
2018-02-08 17:39:51 -08:00
Earle F. Philhower, III b9f13a3161 Enable onboard DAC output 2018-01-25 20:52:58 -08:00
Earle F. Philhower, III 96fc37dce5 Refactor I2S to be cleaner, more extensible
With the multiple I2S modes on the ESP32, it makes sense to use a
cleaner class hierarchy for the I2S tools.  Make I2SNoDAC into a
subclass of I2S (renamed from I2SDAC) and remove about 80% of the
code which was identical exept for the per-sample bitstream synthesis.
2018-01-25 19:15:02 -08:00
Earle F. Philhower, III 7a7f8bf449 Use a single hardcoded I2S config, tested working
Tested working i2s config for both I2S and I2SNoDac, only have the
one copy for later refactor into optional configuration.
2018-01-24 13:44:43 -08:00
Earle F. Philhower, III 5986831bd6 Fix I2S helpers to send/nonblock properly
The original I2S setup had the wrong # of bits being sent to the DAC
as well as wrong timeouts specified on the write_sample wrappers.
Fix those, allowing things like WebRadio.ino to work.
2018-01-19 10:01:43 -08:00
tueddy 03aa2467f0 Porting for ESP-32 (#33)
* support ESP-32
* make compile with ESP-32/arduino platform
* fixed: use libmad on ESP8266 as original
2018-01-18 08:55:03 -08:00
Earle F. Philhower, III 14010d340e Add SetGain to I2S outputs to scale output volume
A new SetGain(float 0.0 ... 4.0) method can scale the output volume of
an I2S DAC or SW DAC by scaling the samples. Proper clipping is performed.
Adds a 16x16 multiply and a couple shifts/branches to every sample output.
2017-11-17 08:48:19 -08:00
Earle F. Philhower, III 0a453a077a Warning and static removal
Clean up compiler warnings and make static variables in class functions
into class variables where they belong.
2017-08-15 20:58:16 -07:00
Earle F. Philhower, III 2cf8fcef2a Bring in files from original projects
The library was originally part of several separate projects.  Make the
needed structure and bring those files in, including some READMEs.
2017-08-12 09:01:42 -07:00