How to create a handle for the PCA9554 io_expander when using it with esp32-S3 on Adafruit Qualia board?

karunt
Posts: 85
Joined: Sat Apr 03, 2021 7:58 am

How to create a handle for the PCA9554 io_expander when using it with esp32-S3 on Adafruit Qualia board?

Postby karunt » Fri May 31, 2024 1:28 pm

I'm using the Adafruit Qualia board with ESP32-S3. The board uses the PCA9554 io_expander to provide the SPI interface for a 40 pin LCD display (which uses the ST7701 driver). See schematics for reference:
AdaFruit Qualia Board Connections to ESP32-S3.png
AdaFruit Qualia Board Connections to ESP32-S3.png (481.41 KiB) Viewed 499 times
To install the SPI panel, here's the code I've got:

Code: Select all

    spi_line_config_t line_config = {
        .cs_io_type = IO_TYPE_EXPANDER,
        .cs_expander_pin = EXAMPLE_LCD_IO_SPI_CS,
        .scl_io_type = IO_TYPE_EXPANDER,
        .scl_expander_pin = EXAMPLE_LCD_IO_SPI_SCL,
        .sda_io_type = IO_TYPE_EXPANDER,
        .sda_expander_pin = EXAMPLE_LCD_IO_SPI_SDA,
        .io_expander = io_expander, //handle for io_expander
    };
What I'm struggling with is how to create this io_expander handle for the PCA9554 expander. I see a library on github for the TCA9554 expander (which is presumably the newer version of PCA9554? I'm not sure) (https://github.com/espressif/esp-bsp/tr ... er_tca9554). But I don't see a library for the PCA9554 expander. Any idea on how to go about this? Can the library for TCA9554 be used for PCA9554 instead? If yes, any modifications necessary?

The ESP example I've got (example_rgb_avoid_tearing.c) uses the esp_lcd_panel_io_additions library (https://github.com/espressif/esp-iot-so ... _additions), which itself uses the esp_io_expander library (https://github.com/espressif/esp-bsp/tr ... o_expander) as a dependency. Any help would be greatly appreciated.

Who is online

Users browsing this forum: No registered users and 6 guests