small changes and many new sensors

This commit is contained in:
2023-10-30 14:30:02 +01:00
parent 07917fe5ba
commit aad07c1b0a
21 changed files with 1642 additions and 297 deletions

View File

@@ -5,7 +5,11 @@
#include "../../Debug.h"
#ifndef usleep
void usleep(int val) {
vTaskDelay(val / 1000 / portTICK_PERIOD_MS);
}
#endif
/**
* base-class for Waveshare SPI E-Ink displays
@@ -16,11 +20,11 @@ template <int PIN_CS, int PIN_BUSY, int PIN_RST, int PIN_DC, typename SPI> class
static constexpr const char* NAME = "E-Ink";
SPI& spi;
public:
Waveshare(SPI& spi) : spi(spi) {
debugMod4(NAME, "ctor() CS:%d BUSY:%d RST:%d DC:%d", PIN_CS, PIN_BUSY, PIN_RST, PIN_DC);
Log::addInfo(NAME, "ctor() CS:%d BUSY:%d RST:%d DC:%d", PIN_CS, PIN_BUSY, PIN_RST, PIN_DC);
MyGPIO::setInput(PIN_BUSY);
MyGPIO::setOutput(PIN_RST);
MyGPIO::setOutput(PIN_DC);
@@ -30,7 +34,7 @@ public:
protected:
void reset() {
debugMod(NAME, "reset()");
Log::addInfo(NAME, "reset()");
MyGPIO::clear(PIN_RST);
usleep(200*1000);
MyGPIO::set(PIN_RST);
@@ -54,9 +58,9 @@ protected:
}
void waitUntilIdle() {
debugMod(NAME, "waitUntilIdle()");
Log::addInfo(NAME, "waitUntilIdle()");
while(MyGPIO::get(PIN_BUSY) == 0) {usleep(200*1000);}
debugMod(NAME, "OK");
Log::addInfo(NAME, "OK");
}
void lut(uint8_t c, uint8_t l, const uint8_t* p) {