lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
MIT License
651 stars 125 forks source link

Add support for recent series of attiny MCUs #147

Open JasXSL opened 2 years ago

JasXSL commented 2 years ago

Is your feature request related to a problem? Please describe. Thanks to megatiny you can use the newer series of attiny 1604, 3227 etc with arduino.

Describe the solution you'd like Support for this library isn't too hard to add in. I forked the repo and added the following to io.h

#elif defined(__AVR_ATtinyxy4__) || defined(__AVR_ATtinyxy2__) || defined(__AVR_ATtinyxy6__) || defined(__AVR_ATtinyxy7__)
    /** The macro is defined when i2c Wire library is available */
    #define CONFIG_PLATFORM_I2C_AVAILABLE
    /** The macro is defined when SPI library is available */
    #define CONFIG_PLATFORM_SPI_AVAILABLE
    /** Define lcdint as smallest types to reduce memo usage on tiny controllers. *
     * Remember, that this can cause issues with large lcd displays, i.e. 320x240*/
    #define LCDINT_TYPES_DEFINED
    /** This is for Attiny controllers */
    typedef int8_t lcdint_t;
    /** This is for Attiny controllers */
    typedef uint8_t lcduint_t;

Nothing else was needed to run a simple 0.93" OLED. However, there are probably some things to think about before any eventual pull request:

tpimh commented 2 years ago

Thank you for your patch, it should be very useful.

Designing a circuit with ATtiny826 now, I'm wondering about the feasibility of using this library with it. My display is SSD1306 SPI 128x32. I guess, half RAM would be sacrifised for the display buffer (no double buffering).

I wonder what displays can be used with the 2k RAM microcontrollers.

lexus2k commented 1 year ago

@JasXSL Hi

Can you create pull request for you change?