ESP32 Hardware SPI Improvements - Options for using both SPI peripherals, and DMA (#441)

* Fix header file comment

* Add TwoWireHspiImpl and Example

* Add start of TwoWireEsp32DmaSpiImple (Currently just able to use HSPI and VSPI in parallel, no DMA)

* Update names for TwoWireEsp32DmaSpi and set set spi_bus using template not constructor

* Update example with new functionality and bugfixes

* DotStarEsp32DmaSpiMethod -

* Add 5MHz option to all SPI-based classes

* DotStarGenericMethod - Give option to use Vspi alias of Spi class if wanting to specify which SPI peripheral is used on the ESP32
- Add missing DotStarHspiHzMethod

* TwoWireHspiImple - bring up to date with applySettings() method

* DotStarTest_Esp32Advanced example - update to show how to change clock speed at runtime
- Remove commented out pins cluttering up example

* DotStarTest_Esp32DmaSpi example -

Co-authored-by: Louis Beaudoin <louis@embedded-creations.com>
This commit is contained in:
Louis BeaudoinandLouis Beaudoin authored and GitHub committed 2021-04-12 14:59:09 -07:00
1 parent cc17ec6fa1
commit b90992fdc2
11 files changed
+783 -3

No files matched your search

+9 -1
View File
@@ -104,6 +104,7 @@ License along with NeoPixel. If not, see
#include "internal/NeoEsp32I2sMethod.h"
#include "internal/NeoEsp32RmtMethod.h"
#include "internal/NeoEspBitBangMethod.h"
#include "internal/DotStarEsp32DmaSpiMethod.h"
#elif defined(ARDUINO_ARCH_NRF52840) // must be before __arm__
@@ -172,13 +173,20 @@ public:
ClearTo(0);
}
// used by DotStartSpiMethod if pins can be configured
// used by DotStarSpiMethod/DotStarEsp32DmaSpiMethod if pins can be configured
void Begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
{
_method.Initialize(sck, miso, mosi, ss);
ClearTo(0);
}
// used by DotStarEsp32DmaSpiMethod if pins can be configured - reordered and extended version supporting quad SPI
void Begin(int8_t sck, int8_t dat0, int8_t dat1, int8_t dat2, int8_t dat3, int8_t ss)
{
_method.Initialize(sck, dat0, dat1, dat2, dat3, ss);
ClearTo(0);
}
void Show(bool maintainBufferConsistency = true)
{
if (!IsDirty())