Generic LCD Driver as an ESP32 Component
Go to file
2023-03-23 11:39:03 +03:00
include Fix a very long standing bug with cursor decoding. 2023-03-23 11:39:03 +03:00
src Initial commit. 2022-08-22 14:34:04 +03:00
CMakeLists.txt Initial commit. 2022-08-22 14:34:04 +03:00
LICENSE.md Add License. 2022-08-22 14:36:38 +03:00
README.md Initial commit. 2022-08-22 14:34:04 +03:00

Generic LCD driver as a ESP32 Component

This is a generic LCD driver wrapped as a ESP32 component. You are free to use the driver component as you wish as long as you follow the license agreement in LICENSE.md.

Usage Example


int lcdBusIO(lcdDriver_t *driver, bool rw, bool rs, bool en, uint8_t data)
{
    // Implement for your own setup.
}

int lcdDelay(lcdDriver_t *driver, uint32_t delay)
{
    // Implement for your own setup.
    return usleep((useconds_t)delay);
}

void app_main(void)
{
    lcdDriver_t lcd = {
        .userData = NULL,
        .dimensions = {16, 2},
        .writeOnly = true,
        .fourBits = true
    };

    // Do GPIO initialization.

    // Reset GPIO pins to their default state.
    lcdBusIO(&lcd, false, false, false, 0xFF);

    lcdLoadDefaultTiming(&lcd);     // Load default LCD timings.
    lcdInit(&lcd);                  // Initialize the LCD and driver.

    lcdDirection(&lcd, true);                   // Set the direction to forward.
    lcdSetDisplay(&lcd, true, false, false);    // Enable display.
    lcdHome(&lcd);                              // Home the LCD cursor.

    lcdPutZString(&driver, "Hello World!");
}

TO-DO

  • Implement read-write mode.
  • Implement 8-bit mode.