Skip to content

Commit

Permalink
Merge pull request #677 from MitchBradley/Guition
Browse files Browse the repository at this point in the history
Autodetect for Guition JC2432W328C
  • Loading branch information
lovyan03 authored Feb 17, 2025
2 parents 61b5e0a + b098a0d commit 178f373
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lgfx/boards.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace lgfx
, board_ESP32_S3_BOX_Lite
, board_LoLinS3Pro
, board_ESP32_S3_BOX_V3
, board_Guition_ESP32_2432W328
};
}
using namespace boards;
Expand Down
65 changes: 65 additions & 0 deletions src/lgfx/v1_autodetect/LGFX_AutoDetect_ESP32_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3187,6 +3187,67 @@ namespace lgfx
}
};

struct _detector_Guition_JC2432W328C_t : public _detector_Sunton_ESP32_2432S028_t
{
constexpr _detector_Guition_JC2432W328C_t(void)
: _detector_Sunton_ESP32_2432S028_t
{ board_t::board_Guition_ESP32_2432W328
, 0x04, 0xFFFF00, 0xb38100
, 55000000, 20000000
, GPIO_NUM_13 // MOSI
, GPIO_NUM_12 // MISO
, GPIO_NUM_14 // SCLK
, GPIO_NUM_2 // DC
, GPIO_NUM_15 // CS
, (gpio_num_t)-1 // RST
, (gpio_num_t)-1 // TF CARD CS
, 0 // SPI MODE
, false // SPI 3wire
, HSPI_HOST // SPI HOST
} {}

void setup(_detector_result_t* result) const override
{
ESP_LOGI(LIBRARY_NAME, "[Autodetect] Guition_JC2432W328C");

result->panel = new Panel_ILI9341_2();

auto p = result->panel;
{
auto cfg = p->config();
cfg.offset_x = 0;
cfg.offset_y = 0;
cfg.offset_rotation = 6;
cfg.dummy_read_pixel = 8;
cfg.dummy_read_bits = 1;
cfg.readable = true;
cfg.invert = true;
cfg.rgb_order = false;
cfg.dlen_16bit = false;
cfg.bus_shared = false;
p->config(cfg);

p->light(_create_pwm_backlight(GPIO_NUM_27, 7));
}
{
auto t = new lgfx::Touch_CST816S();

auto cfg = t->config();
cfg.i2c_port = I2C_NUM_0;
cfg.pin_sda = GPIO_NUM_33;
cfg.pin_scl = GPIO_NUM_32;
cfg.pin_rst = GPIO_NUM_25;
cfg.pin_int = -1;
cfg.offset_rotation = 6;
cfg.freq = 400000;
cfg.x_max = 240;
cfg.y_max = 320;
t->config(cfg);
p->touch(t);
}
}
};

struct _detector_WT32_SC01_t : public _detector_spi_t
{
constexpr _detector_WT32_SC01_t(void)
Expand Down Expand Up @@ -3427,6 +3488,7 @@ namespace lgfx
static constexpr const _detector_board_LoLinD32_9341_t detector_board_LoLinD32_9341;
static constexpr const _detector_ESP_WROVER_KIT_7789_t detector_ESP_WROVER_KIT_7789;
static constexpr const _detector_ESP_WROVER_KIT_9341_t detector_ESP_WROVER_KIT_9341;
static constexpr const _detector_Guition_JC2432W328C_t detector_Guition_JC2432W328C;
static constexpr const _detector_Sunton_2432S028_9341_t detector_Sunton_2432S028_9341;
static constexpr const _detector_Sunton_2432S028_7789_t detector_Sunton_2432S028_7789;
static constexpr const _detector_ODROID_GO_t detector_ODROID_GO;
Expand Down Expand Up @@ -3476,6 +3538,9 @@ namespace lgfx
&detector_ESP_WROVER_KIT_7789,
&detector_ESP_WROVER_KIT_9341,
#endif
#if defined ( LGFX_AUTODETECT ) || defined ( LGFX_ESP32_2432W328 ) || defined ( LGFX_GUITION_ESP32_2432W328 )
&detector_Guition_JC2432W328C,
#endif
#if defined ( LGFX_AUTODETECT ) || defined ( LGFX_ESP32_2432S028 ) || defined ( LGFX_SUNTON_ESP32_2432S028 )
&detector_Sunton_2432S028_9341,
&detector_Sunton_2432S028_7789,
Expand Down

0 comments on commit 178f373

Please sign in to comment.