#ifndef RAYLIB_ESP32_DISPLAYS_H #define RAYLIB_ESP32_DISPLAYS_H #ifdef __cplusplus extern "C" { #endif #include "esp_err.h" #include "esp_idf_version.h" // #include "esp_lcd_panel_io.h" #include "esp_lcd_io_spi.h" #include "esp_lcd_panel_ops.h" #include "esp_lcd_panel_vendor.h" #include "driver/spi_master.h" #include #include /* IDF 4.4 uses void* for the SPI bus handle; IDF 5.x takes spi_host_device_t directly */ #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #define RAYLIB_LCD_SPI_HOST(h) ((esp_lcd_spi_bus_handle_t)(h)) #else #define RAYLIB_LCD_SPI_HOST(h) (h) #endif typedef enum { RAYLIB_DRIVER_GC9A01, RAYLIB_DRIVER_ST7789, RAYLIB_DRIVER_ST7796S, RAYLIB_DRIVER_ILI9341, RAYLIB_DRIVER_CUSTOM, } raylib_display_driver_e; typedef struct { const char *name; esp_err_t (*init_panel)(spi_host_device_t spi_host, int pin_cs, int pin_dc, int pin_rst, uint16_t width, uint16_t height, uint32_t spi_freq_hz, esp_lcd_panel_handle_t *out_panel, esp_lcd_panel_io_handle_t *out_io); bool needs_invert_color; bool needs_byte_swap; uint32_t default_spi_freq_hz; } raylib_display_driver_t; const raylib_display_driver_t *raylib_esp32_get_driver(raylib_display_driver_e id); #ifdef __cplusplus } #endif #endif // RAYLIB_ESP32_DISPLAYS_H