V0.3.0 - Major Redesign: Header Only Implementation #72
pschatzmann
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary of Changes:
v0.3.071 commits | 118 source files changed (+20,401 / -15,018 lines, excluding generated docs)
1. Header-Only Library Conversion
The entire library has been converted from a compiled library (
.c/.cppsource files) to a header-only C++ library. All codec implementations that were previously in.c/.cppfiles undersrc/Driver/have been rewritten as inline C++ classes in.hfiles undersrc/Codecs/.Deleted (36 files): All
.c/.cppsource files undersrc/Driver/—ac101.c,es8388.c,wm8960.cpp,wm8994.c, etc., plus platform.cppfiles (API_I2C_Arduino.cpp,API_I2C_EspressifIDF.cpp,API_SPI_Arduino.cpp,LoggerSTD.cpp, etc.).CMakeLists.txt now declares the library as
INTERFACE(noSRC_DIRS/add_librarywith sources), and the ESP-IDF component registration only setsINCLUDE_DIRS.2. Zephyr RTOS Support
The core addition of this branch — full Zephyr RTOS platform support alongside Arduino and ESP-IDF:
GpioPinis nowgpio_dt_specon Zephyr (device-tree based) vsint16_ton Arduino/IDF. New files:src/Platforms/GPIO_Zephyr.h,src/Platforms/GPIO_Arduino.h,src/Platforms/GPIO_EspressifIDF.h. The dispatchersrc/Platforms/GPIO.hselects the right implementation via#ifdef.src/Platforms/API_I2C.hnow contains inline implementations for all three platforms (Arduino, ESP-IDF, Zephyr) in a single header, replacing the separate.cppfiles. Same pattern for SPI.src/DriverDeviceInfoZephyr.hprovides a Zephyr-specificDriverDeviceInfoZephyrclass using Zephyr'sdevice*handles instead of integer pin numbers.src/AudioBoards/AudioKitEs8388v1.h) now has#if defined(IS_ZEPHYR)/#elseblocks to support device-tree-based pin configuration.__zephyr__compile definition and linkszephyr_interfacewhenZEPHYR_PLATFORMis set.src/Platforms/API_Delay.h—delay()renamed todelayMs()for cross-platform compatibility.3. Major Renames and Restructuring
src/Driver.hsrc/AudioDriver.hsrc/DriverConstants.hsrc/Codecs/CodecConstants.hsrc/DriverPins.hsrc/DriverDeviceInfo.hsrc/Platforms/IDriverPins.hsrc/Platforms/IDriverDeviceInfo.hDriverPinsclassDriverDeviceInfoclassPinsI2S,PinsSPI,PinsI2CInfoI2S,InfoSPI,InfoI2C(with backward aliases)PinsFunctionInfoGPIOsrc/Driver/*(codec dir)src/Codecs/*(uppercase filenames)Board definitions moved from inline in
AudioBoard.hto individual files undersrc/AudioBoards/, with an aggregatorsrc/AudioBoards/AudioBoards.h. Boards are only auto-included on non-Zephyr platforms.4. New Codec Drivers (14 added)
These codecs are new (not present on
mainin any form):src/Codecs/aw88298/AW88298.hsrc/Codecs/cs42l51/CS42L51.hsrc/Codecs/da7212/DA7212.hsrc/Codecs/max98091/MAX98091.hsrc/Codecs/pcm1681/PCM1681.hsrc/Codecs/sf32lb/SF32LB.hsrc/Codecs/sgtl5000/SGTL5000.hsrc/Codecs/tas2563/TAS2563.hsrc/Codecs/tas6422dac/TAS6422DAC.hsrc/Codecs/tlv320aic3110/TLV320AIC3110.hsrc/Codecs/tlv320dac310x/TLV320DAC310x.hsrc/Codecs/wm8731/WM8731.hsrc/Codecs/wm8904/WM8904.hsrc/Codecs/wm8962/WM8962.h5. Converted Codecs (C/C++ → Header-Only C++)
All existing codecs were rewritten from C (with separate
.c/.hpairs andtypedefstructs) to idiomatic C++ header-only classes. Codec file names are now UpperCase (e.g.,es8388.c→ES8388.h). ThePCBCUPID_prefix was removed from NAU8325.6. Platform Abstraction Cleanup
DriverCommon.h: Now contains all platform detection, type aliases (GpioPin,ADCPin,i2c_bus_handle_t), enum definitions (converted fromtypedef enumtoenum/enum class), and Zephyr-specific includes. Platform constants (HIGH,LOW,INPUT,OUTPUT) are defined for non-Arduino builds.IS_GPIO(pin),GPIO_TO_INT(pin),GPIO_UNDEFINEDare now platform-aware macros.etc.h: Deleted (was a grab-bag of platform compat definitions now inDriverCommon.h).7. Build & Config
0.2.1→0.3.0audio_driver→arduino-audio-driverAUDIO_DRIVER_USE_NEW_API: New define insrc/ConfigAudioDriver.hmarking the new class names are in use.8. Board Definitions
Board definitions are now modular per-file under
src/AudioBoards/with dual-path pin setup (IS_ZEPHYRfor device-tree specs, else integer pins). New board files:Lyrat42.h,Lyrat43.h,LyratMini.h(with ADC key support),M5stackAtomEchoS3R.h. TheESP32S3AISmartSpeaker.handSTM32F411Disco.hwere moved into this directory.This discussion was created from the release V0.3.0 - Major Redesign: Header Only Implementation.
All reactions