libDaisy
Official hardware abstraction library for Daisy boards.
forElectro-Smith Daisy Seed,Electro-Smith Daisy Pod,Electro-Smith Daisy Field,Electro-Smith Daisy Patch,Electro-Smith Daisy Petal·by@daisyaudio
Unclaimed. Is this yours? Sign in with GitHub as @daisyaudio to claim it.
No release files yet. Build from source.
MIT· daisyaudio/libDaisy·www.daisy.audio·downloads come from the creator’s GitHub releases
v9.0.0v9.0.0 - Daisy Seed3, DevKits, and MoreLatest0 files
v9.0.0
Features
- MIDI: Add ability to handle
SystemRealTimemessages from a synchronous callback (#643) - QSPI: Added 64kB block erase functionality (#694)
- Logger: Added UART as a logger destination. (#700)
- SAI: Added handling of configurations with no master (e.g. synchronous with another daisy) (#705)
- TCA9534: Added I2C GPIO expander driver (
src/dev/tca9534.h) with shared-bus and owned-bus init, plusTCA9534_GPIOexample. (#706) - SAI: Added support for 192kHz (usable with Seed3) (#710)
- Seed3: DaisySeed class will now detect Seed3 (#710)
- SPI: Added configuration to SPI for SPI6 pins/clock tree. (#709)
- Seed3 DevKits: Added new board support classes and accompanying examples for the three new DevKits (Desktop, Eurorack, and Pedal) (#717)
Bug Fixes
- MIDI: Fixed bug with System Realtime messages corrupting running status (#693)
- WavWriter: Fixed bug with final flush of data not being saved correctly and improved testing (#969)
- PatchSM: DAC Buffer state has been updated to allow full HW output range (#630)
- USB Device: Fixed incorrect macro name in USBD preventing user-defined string descriptors (#702)
- ADC: Fixed scaling issue with ADCs introduced in HAL upgrade (#695)
Misc
- Added several new examples including UART MIDI, WAV Writing, QSPI, and more (#697, #704)
- Updated I2C Pin mappings to support additional I2C4 pins (#701)
New Contributors
- @sauloverissimo made their first contribution in https://github.com/daisyaudio/libDaisy/pull/693
- @HeckHeckHeckHeck made their first contribution in https://github.com/daisyaudio/libDaisy/pull/643
- @chattob made their first contribution in https://github.com/daisyaudio/libDaisy/pull/696
- @kidproquo made their first contribution in https://github.com/daisyaudio/libDaisy/pull/694
- @IC-Alchemy made their first contribution in https://github.com/daisyaudio/libDaisy/pull/630
- @fmulassano made their first contribution in https://github.com/daisyaudio/libDaisy/pull/706
Full Changelog: https://github.com/daisyaudio/libDaisy/compare/v8.1.0...v9.0.0
- MIDI: Add ability to handle
v8.1.0v8.1.0 - WAV Files, Sensors, and Bugfixes0 files
Features
- Audio Files: Reworked WavPlayer, added helpful utilies for working with WAV files (WavParser, FileTable), and added examples for demonstrating their usage.
- SDMMC: HAL_SD_ErrorCallback is now being handled to help with error handling
- note: this may cause things that would previously stall indefinitely to now cause an error. Often, the error will occur in
f_sync()orf_close()since that is where the disk i/o tends to occur. The SDMMC_HelloWorld example has been updated to better handle these errors.
- note: this may cause things that would previously stall indefinitely to now cause an error. Often, the error will occur in
- MPR121: Added demonstration program using MPR121 to examples.
Bug Fixes
- SDMMC: fix an issue where status flags were optimized out, resulting in very long while loops
- CMake: The platform definition for the new FileReader in CMake is now properly set up for use in targets outside of libDaisy.
- ICM20948: Fixed an incorrect number of arguments on call to
ReadExternalRegister. - MPR121: Fixed i2c i/o issues that led to problems reading correct data from the sensor.
- version: The version.h hasn't been updated since v4.0.0 -- it has now been updated to the current version.
Bootloader
- Update to v6.4. This version resolves issues related to i/o timeouts that could occur after programming devices hundreds/thousands of times with larger binary files.
Contribution Summary
- Improved WavPlayer and Extra Utilities by @stephenhensley in https://github.com/electro-smith/libDaisy/pull/677
- Add missing volatile to status flags to prevent "infinite" loop after optimization by @TheSlowGrowth in https://github.com/electro-smith/libDaisy/pull/678
- Fix CMake compile definition leakage by @Alloyed in https://github.com/electro-smith/libDaisy/pull/687
- Fix ICM20948 ReadExternalRegister argument count by @Brokezawa in https://github.com/electro-smith/libDaisy/pull/686
- Add HAL_SD_ErrorCallback to handle DMA errors gracefully by @CyberDuck79 in https://github.com/electro-smith/libDaisy/pull/685
- Use I2CHandle::ReadDataAtAddress for reading registers in mpr121.h by @kaathewise in https://github.com/electro-smith/libDaisy/pull/688
- Added example program for the MPR121 capacitive touch sensor. by @stephenhensley in https://github.com/electro-smith/libDaisy/pull/689
- Example - Improved result handling in SDMMC_HelloWorld by @stephenhensley in https://github.com/electro-smith/libDaisy/pull/690
- Bootloader v6.4 - Improved I/O handling to avoid timeouts by @stephenhensley in https://github.com/electro-smith/libDaisy/pull/691
New Contributors
- @Brokezawa made their first contribution in https://github.com/electro-smith/libDaisy/pull/686
- @CyberDuck79 made their first contribution in https://github.com/electro-smith/libDaisy/pull/685
- @kaathewise made their first contribution in https://github.com/electro-smith/libDaisy/pull/688
v8.0.0v8.0.0 - Hardware PWM, QSPI Stability, CMake, and More0 files
v8.0.0
Features
- SSD1307 Driver
- Drivers for SSD1327 and the SSD1351
- DMA support for the SPI OLED Transport Drivers
- Configurable timing delay to the CD4021 shift register driver
- Hardware PWM
Bug Fixes
- QSPI: Fix for a known instability issue. Resolves intermittent bootup issue where QSPI could set itself to write-protected mode.
- USB Host: Added USBH MIDI source file to CMakeLists for CMake builds
- I2C: Fixed issue with I2C4 not working
- I2C: minor breaking change: Fixed inconsistency of address-shifting of
ReadDataAtAddressandWriteDataAtAddressto match the other methods. - MIDI: Fixed an unrecoverable crash with UART transport if the input shorted to GND for a full UART frame.
- System: Fixed inaccurate clock division factor for
DelayMsandGetMsto be correct. - WavWriter: Fixed bug where the last samples of the recording were not being flushed to the output file.
Other
- The GPIO/Pin migration has been completed within the library, and the
dsy_gpioanddsy_gpio_pinstructs are deprecated. - Minor improvements to
daisy::Colortype - Added explicit setters/getters to
daisy::AnalogControlfor the scale/offset values - Added status check methods for USB Host
- Improvements to CMake builds
- README updated with links to
daisy.audiosite. - Improved documentation, and cleaned up WM8731 driver
- Added Hardware PWM example
- Added WavWriter example
Bootloader
- The included bootloader binaries have been updated to v6.3 - This version integrates the above QSPI changes, and improves the boot-jump sequence for apps running directly from QSPI memory.
Migration
I2C Address Shifting
There was an inconsistency between the generic
ReadandWritemethods that automatically left-shifted the device address by one bit, and theReadDataAtAddressandWriteDataAtAddressfunctions that required the user to manually shift the address by one.The internal devices that were affected by this change have been updated internally so this change will have minimal breaking effects. Those devices are:
- PCM3060
- MCP23x17
To migrate existing code for external device drivers any manual left-shifting of the device address for the
ReadDataAtAddressorWriteDataAtAddressfunctions must be removed.GPIO and Pin
Any remaining instances of
dsy_gpioordsy_gpio_pinshould be converted to the newerGPIOandPinstructs. The constant pin references forDaisySeedandDaisyPatchSMhave both been updated to the newPinstruct.Objects within libDaisy no longer accept the old types, and will need to be updated in application code.
Here are some examples of how to migrate from the old types to the new types.
////////////////////////////////////////// // Initialization: ////////////////////////////////////////// // Old: dsy_gpio_pin pa1 = {DSY_GPIOA, 1}; dsy_gpio gpio1; gpio1.mode = DSY_GPIO_OUTPUT_PP; gpio1.pull = DSY_GPIO_NOPULL; gpio1.pin = pa1; dsy_gpio_init(&gpio1); // New: Pin pa1 = Pin(PORTA, 1); GPIO gpio1; gpio1.Init(pa1, GPIO::Mode::OUTPUT, GPIO::Pull::NOPULL); ////////////////////////////////////////// // Read ////////////////////////////////////////// // Old: uint8_t state = dsy_gpio_read(&gpio1); // New: bool state = gpio1.Read(); ////////////////////////////////////////// // Write ////////////////////////////////////////// // Old: dsy_gpio_write(&gpio1, 1); // HIGH dsy_gpio_write(&gpio1, 0); // LOW // New: gpio1.Write(true); // HIGH gpio1.Write(false); // LOW ////////////////////////////////////////// // Toggle ////////////////////////////////////////// // Old: dsy_gpio_toggle(&gpio1); // New: gpio1.Toggle();New Contributors
- @a7v7 made their first contribution in https://github.com/electro-smith/libDaisy/pull/625
- @asavartsov made their first contribution in https://github.com/electro-smith/libDaisy/pull/627
- @takumi-ogata made their first contribution in https://github.com/electro-smith/libDaisy/pull/661
- @cvpines made their first contribution in https://github.com/electro-smith/libDaisy/pull/667
- @grawlinson made their first contribution in https://github.com/electro-smith/libDaisy/pull/659
- @Alloyed made their first contribution in https://github.com/electro-smith/libDaisy/pull/655
- @jacobvosmaer made their first contribution in https://github.com/electro-smith/libDaisy/pull/623
v7.1.00 files
v7.1.0
Features
- Support for MIDI via USB Host has been added. (PR #611)
- Four new OLED fonts were added: 4x6, 4x8, 5x8, and 6x7. (PR #619)
Bugfixes
- Fixed issue with posting test results for contributor PRs form forks (PR #617)
v7.0.10 files
v7.0.1
Features
- Change
AudioHandle::Configto an aggregate type, allows for aggregate init. Doesn't break existing code. (#613) - Add SerialRead example, shows how to read via Serial over USB (#609)
- Add SH1106 OLED driver (#590)
Bugfixes
- Fix float range for
Random::GetFloat()(#604) - Move SAI initialized check so it isn't a no-op (#589)
- Change
v7.0.00 files
v7.0.0
Features
- Update internal CMSIS and HAL. (#582) (Fixes #538, #578)
- Adds new HAL module support via
src/sys/stm32h7xx_hal_conf.h- Digital Temperature Sensor
- Filter Math Accelerator (FMAC)
- Octo-SPI Controller (OSPI)
- Digital Filter for Delta-Sigma Modulation
- CORDIC co-processor block
- Moves relevant HAL, CMSIS, Middleware code to submodules:
Bugfixes
- Very minor bugfix in CpuLoadMeter_gtest.cpp so that a number would no longer overflow when bitshifting left
Migrating
- Updating an existing libDaisy install via
git pullwill require you to rungit restore . --recurse-submodulesbefore it will compile.- Note, this will also undo any local changes you may have to the library. Make sure to stash those!
- If you clone a fresh copy of libDaisy with
git clone https://www.github.com/electro-smith/libDaisy --recurse-submodules, this will not be necessary - Breaking changes:
GPIO::Mode::OUTPUT_ODrenamed toGPIO::Mode::OPEN_DRAINdue to a name conflict collision- Compiled code size has increased by up to 7%
v6.0.00 files
v6.0.0
Features
- bootloader: Add local BootloaderBlink example for testing the bootloader and its various configs (#599)
- bootloader: Add four bin variants: internal / external DFU, and 10ms / 2000ms timeouts (#599)
- core: Add USE_DAISYSP_LGPL flag to core/Makefile for DaisySP_LGPL support. (#601)
- bootloader: added
System::BootloaderMode::DAISY,System::BootloaderMode::DAISY_SKIP_TIMEOUT, andSystem::BootloaderMode::DAISY_INFINITE_TIMEOUToptions toSystem::ResetToBootloadermethod for better firmware updating flexibility. (#599)
Bug fixes
- Fix link to electro-smith website in README (#605)
- bootloader: pins
D0,D29andD30are no longer stuck when using the Daisy bootloader (#599) - Color: Fixed bug with init not setting the green value correctly (#596)
Bootloader
- This version of libDaisy and greater will be compatible with any version of the Daisy bootloader, meaning you won't have to update the bootloader on your product if you want the latest changes to libDaisy.
- However, for newer versions of the bootloader, you must use a compatible version of libDaisy.
- Daisy bootloader v6.0 and up will only be compatible with libDaisy v5.3 and up.
v5.4.0v5.4.0 - MIDI, Seed 2 DFM, and more 0 files
v5.4.0
Features
- adc: added ConversionSpeed configuration to the AdcChannelConfig (#579)
- board: Updated Daisy board definitions to use new Pin system (#581)
- board: added official support for new Daisy Seed2 DFM hardware (built in compatibility with DaisySeed class).
- device: added driver for SK9822 (#574)
- examples: added a number of minimal examples for the Seed/Seed2DFM
- gatein: added new Init function that is compatible with newer C++
Pintype.
Bug Fixes
- patchsm: Corrected gate out pin assignment confusion added by (#417) as noted by apbianco and tele_player
- midi: improvements to UART transport stability, and fixes to parser (#566, #564, #583)
- qspi: fixed memory cache invalidation for Persistent Storage (#572)
- spi: fixed issue with unpredictable pin states at end of transmission (#553, #559)
Other
- build: removed redundant compile-time def from CMake build (#565)
- docs: use explicit grouping; omit comments from output (#563)
- docs: fix typo in GPIO guide (#567)
v5.3.0v5.3.0 - software SPI for OLED, and minor bug fixes0 files
v5.3.0
Features
- driver: Software SPI transport
SSD130x4WireSoftSpiTransportadded for the OLED Display driver. (#551)
Bug Fixes
- driver: Fixed a compiler error in
Max11300Driver::WriteAnalogPinVolts() - driver: Fixed error reading multiple registers at once from the MPC23x17 GPIO expanders (#550)
- seed: Fixed out of range pin definitions for extra GPIO on the Daisy Seed2 DFM (#544)
- patchsm: Fixed issue where updating the audio callback params didn't update control samplerate (#543)
- driver: Software SPI transport
v5.2.0v5.2.0 - Legio, UART/MIDI Bugfix, and sensors galore0 files
Features
- board: added board support for Noise Engineering legio platform
- audio: added
output_compensationvalue to config struct to allow for post-scaling of uneven audio passthru levels. - util: added a multiply operator to the Color class for scaling a color by a single factor.
- device: Added ICM20948 sensor device driver
- device: Added DPS310 device driver
- device: Added MPR121 device driver
- device: Added APDS9960 device driver
- device: Added TLV493D device driver.
- device: Added neotrellis driver
- device: Added neopixel driver
Bug fixes
- uart: fixed bug with fifo-dma-receive mode that would result in erratic reads over time. Fixes issues with UART (TRS/DIN) MIDI parsing
v5.1.0v5.1.0 - Callbacks and Bug Fixes0 files
v5.1.0
Features
- tim:
TimerHandlenow has callbacks each time the Period has elapsed. These can be enabled withTimerHandle::Config::enable_irqat Init time. - bootloader: Working with the bootloader has been simplified. See the new guide for updates on usage
- usb:
USBHostclass has added support for user callbacks on device connection, disconnection, and when the MSC class becomes active. - uart: Adds DMA RX and TX modes, similar to how they work on the I2C and SPI.
- uart: Update function names to be more in line with the new DMA / Blocking scheme.
- The old methods are wrappers for the new ones to preserve backwards compatibility, but will be removed in a future version.
- Affected functions:
PollReceive,PollTx,StartRx,RxActive,FlushRx,PopRx,Readable
Bug Fixes
- util: PersistentStorage class had a bug where calling the
RestoreDefaultsfunction would cause a crash - usb: LL HAL files for USB were updated to prevent timing issues when running with optimization
- spi: Add IRQ handlers for SPI2-5. These should work with DMA now.
- midi: bugs related to running status bytes for note off, and single data-byte messages have been resolved
Other
- build: core/Makefile has had the
-fnorttiflag added to match libDaisy's Makefile - bootloader: local version of daisy bootloader has been updated to improve stability
- spi: Added examples for blocking TX and DMA TX, added a writeup explaining how to use the SPI on the Daisy
- uart: Adds examples for common modes of communication, both DMA, blocking, FIFO, and mixed.
- tim:
v5.0.00 files
v5.0.0
Breaking Changes
- driver: MAX11300 driver interface changed considerably
- spi: Order of arguments of the
SpiHandleDMA functions changed - dma:
SpiHandlepreviously usedDMA1_Stream7, now usesDMA2_Stream2andDMA2_Stream3
Features
- spi:
SpiHandlenow has callbacks before and after a DMA transaction starts (can be used for software driven chip select) - spi:
SpiHandlenow supports simultaneous transmit and receive with DMA usingSpiHandle::DmaTransmitAndReceive() - spi: added
MultiSlaveSpiHandlethat allows to connect to multiple SPI slave devices on a shared bus - driver: MAX11300 now supports multiple chips on a shared bus
- driver: MAX11300 now uses DMA to handle updates without blocking
- driver: MAX11300 now updates the chips continuously until manually stopped
- driver: MAX11300 can now call a user-provided callback after an update is complete
- debugging: added additional debugging aids to the HardFault handler
- gatein: added invert init parameter for reading from different input circuits from the GateIn class.
- ui: added
OnUserInteractionvirtual function to UI framework to allow for tracking user activity
Bug Fixes
- logger: Added 10ms delay at the end of
StartLogfunction. Without this, messages immediatly following theStartLogfunction were getting missed whenwait_for_pcis set totrue. - testing: debugging configuration now uses
lldbdebugging extension to support unit test debugging on macOS with Apple Silicon - driver: oled_ssd130x.h - Add the SpiHandle:Config struct to SSD130x4WireTransport:Config to allow full access to the SPI peripheral configuration.
- hid: fixed issue in
AnalogControlwhere computed coeff could be out of range with certain block sizes - driver: added missing alternate function pin mappings for SPI2, and UART for pins available on the patch_sm hardware
- usb: fixed issue with MIDI output from USB
- driver: fixed off-by-one error in qspi erase function.
Other
- driver: improved debouncing for
Switch, andEncoderclasses (limiting debouncing to 1kHz max frequency internally).
Migrating
SPI
// Old SpiHandle::Result DmaTransmit(uint8_t* buff, size_t size, SpiHandle::CallbackFunctionPtr callback, void* callback_context); // New SpiHandle::Result DmaTransmit(uint8_t* buff, size_t size, SpiHandle::StartCallbackFunctionPtr start_callback, SpiHandle::EndCallbackFunctionPtr end_callback, void* callback_context); // Same for DmaReceive and DmaTransmitAndReceiveMAX11300
// Old: MAX11300 takes no template arguments MAX11300 max11300driver; // New: MAX11300 takes number of chips as template argument constexpr size_t num_devices = 4; MAX11300<num_devices> max11300driver; // Old: constructor only takes a config struct max11300driver.Init(config); // New: constructor takes a DMA buffer situated in non-cached and DMA-accessible memory MAX11300Types::DmaBuffer DMA_BUFFER_MEM_SECTION max11300DmaBuffer; max11300driver.Init(config, &max11300DmaBuffer); // Old: most types are inside the MAX11300 classname scope daisy::MAX11300::PIN_0 daisy::MAX11300::AdcVoltageRange // New: types are in a separate namespace to keep them independent from the "num_devices" template argument daisy::MAX11300Types::PIN_0 daisy::MAX11300Types::AdcVoltageRange // Old: only a single chip was handled by the driver max11300driver.ConfigurePinAsAnalogRead(daisy::MAX11300::PIN_0, daisy::MAX11300::AdcVoltageRange::NEGATIVE_5_TO_5); max11300driver.ConfigurePinAsAnalogWrite(daisy::MAX11300::PIN_1, daisy::MAX11300::DacVoltageRange::NEGATIVE_5_TO_5); // New: each function now takes an additional argument, the index of the chip max11300driver.ConfigurePinAsAnalogRead(0, daisy::MAX11300Types::PIN_0, daisy::MAX11300Types::AdcVoltageRange::NEGATIVE_5_TO_5); max11300driver.ConfigurePinAsAnalogWrite(1, daisy::MAX11300Types::PIN_1, daisy::MAX11300Types::DacVoltageRange::NEGATIVE_5_TO_5); // Old: Update() synchronously updates the chip and blocks until the update is complete max11300driver.Update(); // blocks // New: - Start() works asynchronously in the background using DMA // - Start() will retrigger updates itself automatically, until stopped by calling Stop() // - A callback can be called after each update cycle that was completed successfully void MyUpdateCompleteCallback(void* context) { // The context is the pointer you passed when calling `.Update()` // This callback comes from an interrupt, keep is fast. } max11300driver.Start( &MyUpdateCompleteCallback, // or nullptr if you don't need a callback. default: nullptr &someThingThatYouWantToGetPassedToYourCallback // callback context, or nullptr if not needed ); // you don't have to specify the arguments, then the defaults will be used max11300driver.Start(); // you can stop the auto update after you started it max11300driver.Stop();v4.0.0v4.0.0 - Minor Fixes and MCP23x17 driver0 files
Breaking Changes
- driver: added support for the 0 .. 2.5V ADC range to MAX11300 getter functions
const, splitting theenum VoltageRangeinto two enums for the ADC and DAC configurations.
Features
- driver: added support for the MCP23x17 I/O Expander with I2C transport implementation
Bug Fixes
- usb: fixed bug where using FatFS and a USB Device class simultaneously would result in a linker error.
- Shared IRQHandlers for the USB HS peripheral have been moved to sys/system.cpp
- driver: made MAX11300 getter functions
const - cmake: changed optimization to
-O0for Debug builds
Other
Migrating
MAX11300
// Old: Same enum used for DAC and ADC configurations max11300driver.ConfigurePinAsAnalogRead(daisy::MAX11300::PIN_0, daisy::MAX11300::VoltageRange::NEGATIVE_5_TO_5); max11300driver.ConfigurePinAsAnalogWrite(daisy::MAX11300::PIN_1, daisy::MAX11300::VoltageRange::NEGATIVE_5_TO_5); // New: Different enum used for DAC and ADC configurations max11300driver.ConfigurePinAsAnalogRead(daisy::MAX11300::PIN_0, daisy::MAX11300::AdcVoltageRange::NEGATIVE_5_TO_5); max11300driver.ConfigurePinAsAnalogWrite(daisy::MAX11300::PIN_1, daisy::MAX11300::DacVoltageRange::NEGATIVE_5_TO_5);- driver: added support for the 0 .. 2.5V ADC range to MAX11300 getter functions
v3.0.0v3.0.0 - USB Features and API updates0 files
v3.0.0
Breaking Changes
- fatfs: the
dsy_fatfs_init()function has been replaced with theFatFSInterfaceclass that allows for multi-volume filesystem use with SDMMC and/or USB drives.- The previous global variables
SDPath,SDFatFS,SDFile, andretSDhave been removed as they could not be used effectively with the addition of multi-volume support. - The path, and FATFS objects can be acquired from the new
FatFSIntefaceobjects, and anyFILobject(s) can be placed in AXI SRAM (or any other memory with USB).
- The previous global variables
- namespace: new namespace "seed" was added for new pinout Daisy Seed pinout mappings.
- This isn't a breaking change on it's own, but when
using namespace seed;a variable cannot be named,seedelse it will throw ambiguity errors.
- This isn't a breaking change on it's own, but when
Features
- bootloader: the bootloader can now be flashed directly from libDaisy using
make program-boot- apps can be built by overwriting
LDSCRIPTwith one of the new (_sram.lds, or _qspi.lds) linker scripts, and adding-DBOOT_APPto theC_DEFSwithin the user makefile. - once the bootloader is on the device, apps compiled with the above changes can be flashed to the bootloader using
make program-app - this process is subject to change, and will be improved and documented in the coming weeks.
- apps can be built by overwriting
- driver: added support for the MAX11300 ADC/DAC/GPI/GPO device
- usb_midi: added
MidiUsbTransportclass for easy usb midi functionality viaMidiUsbHandler - ui: addition of
CanvasDescriptor::screenSaverTimeoutsetting turns off display after as many milliseconds. Useful for preventing screen burn-in on sensitive displays like OLEDs. - usb_host: basic support for Mass Storage USB host class has been added.
- fatfs: interface has been reworked, and now supports mounting SDMMC, and/or USB drives. Multi-volume usage with simultaneous use of both is supported.
- core: added new C++
Pintype that is constexpr friendly, and backwards compatible with existing C-styledsy_gpio_pintype.- the old,
dsy_gpio_pinand it's accompanying functions should no longer be used, and will be removed in a later version of the library.
- the old,
- gpio: added new C++ API for access to GPIO
- the old,
dsy_gpioand it's accompanying functions should no longer be used, and will be removed in a later version of the library.
- the old,
- seed: new pinout consts have been added using the new type. This is to simplify addressing pins on Daisy Seed, and the names are shared with the Arduino Integration.
- These constants live in the
daisy::seednamespace. - Digital pins D0-D30 have been added, these return the equivalent pin as
DaisySeed::GetPin(int pinno) - Analog pins A0-A11 map to the ADC accessible pins labeled as "ADCn" in the pinout diagram.
- The
Axanalog pin constants can be used when using digital functions, and vice-versa.
- These constants live in the
Bug fixes
- patch_sm: corrected the order of the gate out pins
- sai: fixed occasional output audio channel swap (#268)
- sd_diskio: removed extraneous strobing of unrelated GPIO pin
- patch: fixed seed1.1 compatibility to properly initialize the primary codec due to special 4-channel audio
Other
- switch: Use
System::GetNow()rather than the update rate to calculateTimeHeldMs().- This has also been applied to the
Encoderclass (since it usesSwitchinternally).
- This has also been applied to the
- usb host: ST Middleware for USB Host support has been added to the Middlewares folder
- fatfs: changed default
FS_LOCKto 0, allowing for more simultaneously open FIL objects. - seed: the contents of
DaisySeed::Configure()have been moved into theDaisySeed::Init()function, leaving it empty. This function can now be omitted.- the function was left in place to preserve backwards compatibility, and will be removed in a future version.
Migrating
- switch/encoder: Backwards compatability for Initializing switches/encoders will be maintained until the next breaking change, at which point the
update_rateargument will be removed fromSwitch::Init, andEncoder::Init. - fatfs: If file locking was being used,
FS_LOCKwill have to be changed back to a non-zero, positive value.
FatFS
Existing code using SDMMC for FatFS only requires a small change to replace the previous
dsy_fatfs_init()function:FatFSInterface fsi; int main(void) { // Daisy, SDMMC, etc. initialization unchanged // before: dsy_fatfs_init(); . . . // now: fsi.Init(FatFSInterface::Config::MEDIA_SD); // and instead of the global FATFS object you can now: FATFS& fs = fsi.GetSDFileSystem(); // and instead of the global SDPath object you can now: const char* rootpath = fsi.GetSDPath(); // and then file system works as usual now f_mount(&fs, rootpath, 1); . . . }GPIO
The new
GPIOclass, andPintype have been added to replace the previous C versions.The C versions will remain in place for some time to support backwards compatibility, and give people time to migrate.
To make this easier, the new
Pintype can be automatically converted to the old,dsy_gpio_pinto use with classes that have not been updated yet (like Switch, Encoder, etc.)Here's an example comparing the new and old versions of dealing with GPIO (only one of the many initialization methods is shown here):
////////////////////////////////////////// // Initialization: ////////////////////////////////////////// // Old: dsy_gpio_pin pa1 = {DSY_GPIOA, 1}; dsy_gpio gpio1; gpio1.mode = DSY_GPIO_OUTPUT_PP; gpio1.pull = DSY_GPIO_NOPULL; gpio1.pin = pa1; dsy_gpio_init(&gpio1); // New: Pin pa1 = Pin(PORTA, 1); GPIO gpio1; gpio1.Init(pa1, GPIO::Mode::OUTPUT, GPIO::Pull::NOPULL); ////////////////////////////////////////// // Read ////////////////////////////////////////// // Old: uint8_t state = dsy_gpio_read(&gpio1); // New: bool state = gpio1.Read(); ////////////////////////////////////////// // Write ////////////////////////////////////////// // Old: dsy_gpio_write(&gpio1, 1); // HIGH dsy_gpio_write(&gpio1, 0); // LOW // New: gpio1.Write(true); // HIGH gpio1.Write(false); // LOW ////////////////////////////////////////// // Toggle ////////////////////////////////////////// // Old: dsy_gpio_toggle(&gpio1); // New: gpio1.Toggle();- fatfs: the
v2.0.1v2.0.1 - minor bug fixes0 files
v2.0.1
Breaking Changes
Features
Bug fixes
- qspi: fixed bug with GetData() that wouldn't return correct data when passed actual address instead of normalized offset (i.e. >= 0x90000000)
- sdram: fixed occasional hard fault caused by
RPDelay, which is now set to 16 (same as in v1.0.0 and earlier)
v2.0.00 files
Breaking Changes
- qspi: updated from C to C++, and fixed up the API to be cleaner, and simpler to use
- sdram: updated from C to C++
- Create SdramHandle class. Gets rid of configurable pin and hardcodes it instead.
Features
- adc: added initialization mappings for pins ADC1_INP12 (PC2) and ADC1_INP13 (PC3) (Not accessible on Daisy Seed)
- board: added support files for upcoming Daisy Patch SM hardware
- rng: added new Random module that provides access to the hardware True Random Number Generator
- spi: added DMA Transactions (same type of queue system as I2C) to the SPI Handle class.
- util: added new PersistentStorage class for storing/recalling data between power cycles
- util: added new VoctCalibration helper class for calibrating ADC inputs
- seed: added support for Daisy Seed 1.1 (aka Daisy Seed rev5) hardware. Pin-compatible, with same form factor. WM8731 Codec instead of AK4556.
- bootloader: added
program-appmake target to upload code to the daisy bootloader
Bug fixes
- adc: fixed bug with ADC where designs with more than 8 channels AND a mux would halt the ADC.
- sdram: changed SdramTiming.RPDelay to 1 to avoid underflow bug.
Other
- util: added deinits and memory-aware inits for bootloader compatibility
Migrating
QSPI
DaisySeed hw; // ... // Old hw.qspi_handle.mode = DSY_QSPI_MODE_INDIRECT_POLLING; dsy_qspi_init(&hw.qspi_handle); dsy_qspi_erase(address, address + sector_size); dsy_qspi_write(address, size, (uint8_t*)&some_data); // New -- qspi mode is automatically handled hw.qspi.Erase(address, address + sector_size); hw.qspi.Write(address, size, (uint8_t*)&some_data);Sdram
This is only applicable if you had a seed-level board that needed to initialize external SDRAM.
//Init //Old: dsy_gpio_pin *pin_group; dsy_sdram_handle sdram_handle; sdram_handle.state = DSY_SDRAM_STATE_ENABLE; pin_group = sdram_handle.pin_config; pin_group[DSY_SDRAM_PIN_SDNWE] = dsy_pin(DSY_GPIOH, 5); dsy_sdram_init(&sdram_handle); //New: SdramHandle sdram; sdram.Init();v1.0.0v1.0.0 - Improvements to String, FIFO, MIDI, and build tools0 files
v1.0.0
Breaking Changes
- move MidiEvent and related data to
daisynamespace.
Features
- string: allow more integer types in
FixedCapStr::AppendInt() - fifo/stack: Add new methods for searching elements
- fifo/stack: Reduce binary size
- RgbLed: Added individual setters for each color
Bug fixes
- midi: SysEx messages that overflow stop reading data until rx sysexstop. Previously overflowed sysex would cause junk messages.
- midi: NoteOns of velocity 0 cause NoteOffs.
- usb-serial: fix RX callback function being overwritten
Other
- test: add unit testing for midi parser.
- tests: add tests for
FIFO - docs: Update TODO comment in
uart.hto reflect most recent uart update. - ci: add filters to the workflows
- ci: add workflow that builds libDaisy with CMake
- build: small fixes in CMakeLists.txt
- build: report detailed memory usage when linking
Migrating
With
using namespace daisy(as typical in example programs) no changes necessary. Otherwise:// Old MidiEvent event; // New daisy::MidiEvent event;- move MidiEvent and related data to
v0.1.0Initial Release0 files
First tagged release of libDaisy
