@@ -1165,8 +1165,10 @@ namespace m5gfx
11651165
11661166 std::uint32_t id;
11671167
1168- // std::uint32_t pkg_ver = m5gfx::get_pkg_ver();
1169- // ESP_LOGE("DEBUG","pkg_ver:%02x", (int)pkg_ver);
1168+ std::uint32_t pkg_ver = m5gfx::get_pkg_ver ();
1169+ // ESP_LOGD(LIBRARY_NAME, "pkg_ver : %02x", (int)pkg_ver);
1170+ switch (pkg_ver) {
1171+ case 0 : // EFUSE_PKG_VERSION_ESP32S3: // QFN56
11701172
11711173 if (board == 0 || board == board_t ::board_M5StackCoreS3 || board == board_t ::board_M5StackCoreS3SE)
11721174 {
@@ -1255,50 +1257,6 @@ namespace m5gfx
12551257 lgfx::i2c::release (i2c_port);
12561258 }
12571259
1258- if (board == 0 || board == board_t ::board_M5AtomS3R)
1259- {
1260- _pin_reset (GPIO_NUM_48, use_reset); // LCD RST
1261- bus_cfg.pin_mosi = GPIO_NUM_21;
1262- bus_cfg.pin_miso = (gpio_num_t )-1 ; // GPIO_NUM_NC;
1263- bus_cfg.pin_sclk = GPIO_NUM_15;
1264- bus_cfg.pin_dc = GPIO_NUM_42;
1265- bus_cfg.spi_mode = 0 ;
1266- bus_cfg.spi_3wire = true ;
1267- bus_spi->config (bus_cfg);
1268- bus_spi->init ();
1269- id = _read_panel_id (bus_spi, GPIO_NUM_14);
1270- if ((id & 0xFFFFFF ) == 0x079100 )
1271- { // check panel (GC9107)
1272- board = board_t ::board_M5AtomS3R;
1273- ESP_LOGW (LIBRARY_NAME, " [Autodetect] board_M5AtomS3R" );
1274- bus_spi->release ();
1275- bus_cfg.spi_host = SPI3_HOST;
1276- bus_cfg.freq_write = 40000000 ;
1277- bus_cfg.freq_read = 16000000 ;
1278- bus_spi->config (bus_cfg);
1279- bus_spi->init ();
1280- auto p = new Panel_GC9107 ();
1281- p->bus (bus_spi);
1282- {
1283- auto cfg = p->config ();
1284- cfg.pin_cs = GPIO_NUM_14;
1285- cfg.pin_rst = GPIO_NUM_48;
1286- cfg.panel_width = 128 ;
1287- cfg.panel_height = 128 ;
1288- cfg.offset_y = 32 ;
1289- cfg.readable = false ;
1290- cfg.bus_shared = false ;
1291- p->config (cfg);
1292- }
1293- _panel_last.reset (p);
1294- _set_backlight (new Light_M5StackAtomS3R ());
1295-
1296- goto init_clear;
1297- }
1298- lgfx::pinMode (GPIO_NUM_48, lgfx::pin_mode_t ::input); // LCD RST
1299- bus_spi->release ();
1300- }
1301-
13021260 if (board == 0 || board == board_t ::board_M5AtomS3)
13031261 {
13041262 _pin_reset (GPIO_NUM_34, use_reset); // LCD RST
@@ -1346,7 +1304,7 @@ namespace m5gfx
13461304 {
13471305 _pin_reset (GPIO_NUM_8, use_reset); // LCD RST
13481306 bus_cfg.pin_mosi = GPIO_NUM_5;
1349- bus_cfg.pin_miso = GPIO_NUM_NC;
1307+ bus_cfg.pin_miso = ( gpio_num_t )- 1 ; // GPIO_NUM_NC;
13501308 bus_cfg.pin_sclk = GPIO_NUM_6;
13511309 bus_cfg.pin_dc = GPIO_NUM_4;
13521310 bus_cfg.spi_mode = 0 ;
@@ -1415,7 +1373,7 @@ namespace m5gfx
14151373 {
14161374 _pin_reset (GPIO_NUM_8, use_reset); // LCD RST
14171375 bus_cfg.pin_mosi = GPIO_NUM_5;
1418- bus_cfg.pin_miso = GPIO_NUM_NC;
1376+ bus_cfg.pin_miso = ( gpio_num_t )- 1 ; // GPIO_NUM_NC;
14191377 bus_cfg.pin_sclk = GPIO_NUM_6;
14201378 bus_cfg.pin_dc = GPIO_NUM_4;
14211379 bus_cfg.spi_mode = 0 ;
@@ -1460,7 +1418,7 @@ namespace m5gfx
14601418 {
14611419 _pin_reset (GPIO_NUM_33, use_reset); // LCD RST
14621420 bus_cfg.pin_mosi = GPIO_NUM_35;
1463- bus_cfg.pin_miso = GPIO_NUM_NC;
1421+ bus_cfg.pin_miso = ( gpio_num_t )- 1 ; // GPIO_NUM_NC;
14641422 bus_cfg.pin_sclk = GPIO_NUM_36;
14651423 bus_cfg.pin_dc = GPIO_NUM_34;
14661424 bus_cfg.spi_mode = 0 ;
@@ -1533,7 +1491,7 @@ namespace m5gfx
15331491 {
15341492 _pin_reset ( GPIO_NUM_2, true ); // EPDがDeepSleepしている場合は自動認識に失敗する。そのためRST制御を必ず行う。;
15351493 bus_cfg.pin_mosi = GPIO_NUM_6;
1536- bus_cfg.pin_miso = GPIO_NUM_NC;
1494+ bus_cfg.pin_miso = ( gpio_num_t )- 1 ; // GPIO_NUM_NC;
15371495 bus_cfg.pin_sclk = GPIO_NUM_5;
15381496 bus_cfg.pin_dc = GPIO_NUM_3;
15391497 bus_cfg.spi_3wire = true ;
@@ -1577,6 +1535,58 @@ namespace m5gfx
15771535 bus_spi->release ();
15781536 }
15791537
1538+ break ;
1539+ case 1 : // EFUSE_PKG_VERSION_ESP32S3PICO: // LGA56
1540+
1541+ if (board == 0 || board == board_t ::board_M5AtomS3R)
1542+ {
1543+ _pin_reset (GPIO_NUM_48, use_reset); // LCD RST
1544+ bus_cfg.pin_mosi = GPIO_NUM_21;
1545+ bus_cfg.pin_miso = (gpio_num_t )-1 ; // GPIO_NUM_NC;
1546+ bus_cfg.pin_sclk = GPIO_NUM_15;
1547+ bus_cfg.pin_dc = GPIO_NUM_42;
1548+ bus_cfg.spi_mode = 0 ;
1549+ bus_cfg.spi_3wire = true ;
1550+ bus_spi->config (bus_cfg);
1551+ bus_spi->init ();
1552+ id = _read_panel_id (bus_spi, GPIO_NUM_14);
1553+ if ((id & 0xFFFFFF ) == 0x079100 )
1554+ { // check panel (GC9107)
1555+ board = board_t ::board_M5AtomS3R;
1556+ ESP_LOGW (LIBRARY_NAME, " [Autodetect] board_M5AtomS3R" );
1557+ bus_spi->release ();
1558+ bus_cfg.spi_host = SPI3_HOST;
1559+ bus_cfg.freq_write = 40000000 ;
1560+ bus_cfg.freq_read = 16000000 ;
1561+ bus_spi->config (bus_cfg);
1562+ bus_spi->init ();
1563+ auto p = new Panel_GC9107 ();
1564+ p->bus (bus_spi);
1565+ {
1566+ auto cfg = p->config ();
1567+ cfg.pin_cs = GPIO_NUM_14;
1568+ cfg.pin_rst = GPIO_NUM_48;
1569+ cfg.panel_width = 128 ;
1570+ cfg.panel_height = 128 ;
1571+ cfg.offset_y = 32 ;
1572+ cfg.readable = false ;
1573+ cfg.bus_shared = false ;
1574+ p->config (cfg);
1575+ }
1576+ _panel_last.reset (p);
1577+ _set_backlight (new Light_M5StackAtomS3R ());
1578+
1579+ goto init_clear;
1580+ }
1581+ lgfx::pinMode (GPIO_NUM_48, lgfx::pin_mode_t ::input); // LCD RST
1582+ bus_spi->release ();
1583+ }
1584+
1585+ break ;
1586+
1587+ default : break ;
1588+ }
1589+
15801590#endif
15811591
15821592 board = board_t ::board_unknown;
0 commit comments