Add LilyGO T3 STM32 support
This commit is contained in:
1 parent
c9fa617c38
commit
e296c49580
10 files changed
+288
-1
No files matched your search
@@ -25,7 +25,12 @@ bool SSD1306Display::begin() {
|
||||
#ifdef DISPLAY_ROTATION
|
||||
display.setRotation(DISPLAY_ROTATION);
|
||||
#endif
|
||||
return display.begin(SSD1306_SWITCHCAPVCC, DISPLAY_ADDRESS, true, false) && i2c_probe(Wire, DISPLAY_ADDRESS);
|
||||
bool success = display.begin(SSD1306_SWITCHCAPVCC, DISPLAY_ADDRESS, true, false);
|
||||
#if defined(PIN_OLED_CS) && defined(PIN_OLED_DC)
|
||||
return success;
|
||||
#else
|
||||
return success && i2c_probe(Wire, DISPLAY_ADDRESS);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SSD1306Display::turnOn() {
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
#define DISPLAY_ADDRESS 0x3C
|
||||
#endif
|
||||
|
||||
#if defined(PIN_OLED_CS) != defined(PIN_OLED_DC)
|
||||
#error "SPI OLED requires both PIN_OLED_CS and PIN_OLED_DC"
|
||||
#endif
|
||||
|
||||
class SSD1306Display : public DisplayDriver {
|
||||
Adafruit_SSD1306 display;
|
||||
bool _isOn;
|
||||
@@ -24,7 +28,11 @@ class SSD1306Display : public DisplayDriver {
|
||||
bool i2c_probe(TwoWire& wire, uint8_t addr);
|
||||
public:
|
||||
SSD1306Display(RefCountedDigitalPin* peripher_power=NULL) : DisplayDriver(128, 64),
|
||||
#if defined(PIN_OLED_CS) && defined(PIN_OLED_DC)
|
||||
display(128, 64, &SPI, PIN_OLED_DC, PIN_OLED_RESET, PIN_OLED_CS),
|
||||
#else
|
||||
display(128, 64, &Wire, PIN_OLED_RESET),
|
||||
#endif
|
||||
_peripher_power(peripher_power)
|
||||
{
|
||||
_isOn = false;
|
||||
|
||||
Reference in new issue
Block a user