Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Every time an stratum job notification is received miner update its current work
- ESP32-C3 Super Mini ([Board Info](https://docs.platformio.org/en/latest/boards/espressif32/seeed_xiao_esp32c3.html))
- Waveshare ESP32-S3-GEEK ([Board Info](https://www.waveshare.com/wiki/ESP32-S3-GEEK))
- LILYGO T-HMI ([Aliexpress link\*](https://s.click.aliexpress.com/e/_oFII4s2)) / Dev support: @cosmicpsyop
- GUITION JC3248W535C ([Aliexpress link\*](https://s.click.aliexpress.com/e/_c2vAGr5f)) / Dev support: @cosmicpsyop
- ESP32-C3 0.42 Inch OLED ([Aliexpress link\*](https://s.click.aliexpress.com/e/_oDmT4Id) / Dev support: @mrthiti / ⚡ wallet@thiti.dev)
- ESP32-S3 0.42 Inch OLED ([Aliexpress link\*](https://s.click.aliexpress.com/e/_oFIMUoh) / Dev support: @mrthiti / ⚡ wallet@thiti.dev)

Expand Down
39 changes: 39 additions & 0 deletions boards/jc3248w535.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DBOARD_HAS_PSRAM"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"hwids": [
["0x303A", "0x1001"]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": ["wifi", "bluetooth"],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": ["esp-builtin"],
"openocd_target": "esp32s3.cfg"
},
"frameworks": ["arduino", "espidf"],
"name": "Guition JC3248W535 (ESP32-S3 N16R8)",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.guition.com/",
"vendor": "Guition"
}
74 changes: 73 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[platformio]
globallib_dir = lib

default_envs = NerdminerV2, NerdminerV2-T-HMI, wt32-sc01, wt32-sc01-plus, han_m5stack, M5Stick-C, M5Stick-C-Plus2, M5Stick-CPlus, esp32cam, ESP32-2432S028R, ESP32_2432S028_2USB, ESP32-2432S024, Lilygo-T-Embed, ESP32-devKitv1, NerdminerV2-S3-DONGLE, NerdminerV2-S3-GEEK, NerdminerV2-S3-AMOLED, NerdminerV2-S3-AMOLED-TOUCH, NerdminerV2-T-QT, NerdminerV2-T-Display_V1, TTGO-T-Display, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S2-mini-wemos, ESP32-S3-mini-weact, ESP32-D0WD-V3-weact, ESP32-C3-super-mini, ESP32-C3-devKitmv1, ESP32-C3-042-OLED, ESP32-S3-042-OLED, ESP32-C3-spotpear, esp32-s3-devkitc1-n32r8
default_envs = NerdminerV2, NerdminerV2-T-HMI, wt32-sc01, wt32-sc01-plus, han_m5stack, M5Stick-C, M5Stick-C-Plus2, M5Stick-CPlus, esp32cam, ESP32-2432S028R, ESP32_2432S028_2USB, ESP32-2432S024, Lilygo-T-Embed, ESP32-devKitv1, NerdminerV2-S3-DONGLE, NerdminerV2-S3-GEEK, NerdminerV2-S3-AMOLED, NerdminerV2-S3-AMOLED-TOUCH, NerdminerV2-T-QT, NerdminerV2-T-Display_V1, TTGO-T-Display, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S2-mini-wemos, ESP32-S3-mini-weact, ESP32-D0WD-V3-weact, ESP32-C3-super-mini, ESP32-C3-devKitmv1, ESP32-C3-042-OLED, ESP32-S3-042-OLED, ESP32-C3-spotpear, esp32-s3-devkitc1-n32r8, jc3248w535

; Global configuration for all environments
[env]
Expand Down Expand Up @@ -1168,3 +1168,75 @@ lib_ignore =




;------------------------------------------------------------------------
; Guition JC3248W535 — 3.5" 320x480 QSPI capacitive touch
;
; ESP32-S3 N16R8 (16MB flash, 8MB OPI PSRAM)
; Display: AXS15231B over QSPI Touch: AXS @ I2C 0x3B Backlight: GPIO1
;
; Custom board JSON (boards/jc3248w535.json) hard-codes 16MB flash +
; 8MB OPI PSRAM because the stock esp32-s3-devkitc-1 board variant in
; espressif32@6.6.0 reports as N8 (no PSRAM) and breaks framebuffer alloc.
;
; IMPORTANT: Arduino_GFX_Library MUST be pinned to 1.6.0.
; 1.6.1+ breaks the AXS15231B init sequence on this panel.
;------------------------------------------------------------------------
[env:jc3248w535]
platform = espressif32@6.6.0
board = jc3248w535
framework = arduino
extra_scripts =
pre:auto_firmware_version.py
post:post_build_merge.py
monitor_filters =
esp32_exception_decoder
time
log2file
monitor_speed = 115200
; Prevent the act of opening `pio device monitor` from auto-resetting the
; board via DTR/RTS — common ESP32-S3 USB-CDC quirk.
; v0.8.17: flipped back to 1 (default) to allow USB-CDC enumeration
; handshake. Was 0 to suppress auto-reset on monitor open, but on the
; ESP32-S3 built-in USB-Serial/JTAG the chip needs DTR to know a host
; is listening — otherwise Serial.println output is silently dropped.
monitor_rts = 1
monitor_dtr = 1
upload_speed = 460800
; 16MB layout — uses built-in PIO partitions; if you need OTA pick default_16MB.csv
board_build.partitions = huge_app.csv
build_flags =
-D BOARD_HAS_PSRAM
-D JC3248W535=1
; v0.8.24: hook the global `Serial` object to the ESP32-S3 built-in
; USB-Serial/JTAG peripheral (HWCDC). Without these, Serial defaults to
; UART0 (GPIO 43/44) which isn't wired to the board's USB-C connector,
; so `picocom /dev/ttyACM0` sees only the ROM bootloader and never the
; app's Serial.println output. Reference: Arduino-ESP32 HWCDC.h.
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-I lib
;-D DEBUG_MINING=1
;-D JC_TOUCH_DEBUG=1 ; uncomment for on-screen touch poll/hit counters + raw coord readout
;-D JC_NO_TOUCH_POLL=1 ; A/B: disable touch I2C polling (RULED OUT v0.9.2: touch off, SD still drops -> not the cause)
;-D JC_NO_SD_PIXEL=1 ; A/B: disable SD status pixel + queries (tests if SD-probe activity drops the card)
-D JC_NO_SLIDESHOW=1 ; A/B: disable JPEG slideshow screen. 5th cyclic still exists but shows a placeholder message. Saves ~30KB flash from TJpg_Decoder.
;-D JC_NO_SNAPSHOT=1 ; A/B: disable all snapshot/quantization logic and force gated full flush every tick.
lib_deps =
bblanchon/ArduinoJson@^6.21.5
https://github.com/tzapu/WiFiManager.git#v2.0.17
arduino-libraries/NTPClient@^3.2.1
mathertel/oneButton@^2.6.1
fbiego/ESP32Time@^2.0.6
moononournation/GFX Library for Arduino @ =1.6.0
https://github.com/takkaO/OpenFontRender#v1.2
; SLIDESHOW mode depends on TJpg_Decoder for JPEG rendering;
; if disabled, can save ~30KB flash by excluding the library entirely.
;bodmer/TJpg_Decoder@^1.1.0
lib_ignore =
TFT_eSPI
LovyanGFX
rm67162
HANSOLOminerv2

;--------------------------------------------------------------------
2 changes: 2 additions & 0 deletions src/drivers/devices/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#include "lilygoT_HMI.h"
#elif defined(SPOTPEAR)
#include "spotpearKeychain.h"
#elif defined(JC3248W535)
#include "jc3248w535.h"

#else
#error "No device defined"
Expand Down
82 changes: 82 additions & 0 deletions src/drivers/devices/jc3248w535.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// =============================================================================
// Guition JC3248W535 — 3.5" 320x480 QSPI capacitive touch
// =============================================================================
// ESP32-S3 N16R8 (16MB flash, 8MB OPI PSRAM)
// Display: AXS15231B over QSPI (CS=45, SCK=47, D0=21, D1=48, D2=40, D3=39)
// Touch: AXS-touch over I2C @ 0x3B (SDA=4, SCL=8)
// Backlight: GPIO 1 (active HIGH)
//
// Pins confirmed against the F1ATB working sample:
// https://github.com/AudunKodehode/JC3248W535EN-Touch-LCD
// =============================================================================
#ifndef _JC3248W535_H
#define _JC3248W535_H

#define JC3248W535_DISPLAY

// ---------------- LCD (AXS15231B QSPI) ---------------------------------------
#define LCD_CS 45
#define LCD_SCK 47
#define LCD_D0 21
#define LCD_D1 48
#define LCD_D2 40
#define LCD_D3 39
#define LCD_BL 1 // backlight, active HIGH

// ---------------- Touch (AXS controller, I2C) --------------------------------
#define TOUCH_SDA 4
#define TOUCH_SCL 8
#define TOUCH_INT 11 // ⚠ shared with SDMMC_CMD — see SD card note
#define TOUCH_RST 12 // ⚠ shared with SDMMC_CLK — see SD card note
#define TOUCH_I2C_ADDR 0x3B
#define TOUCH_I2C_HZ 400000

// ---------------- SD card (SDMMC 1-bit mode) ---------------------------------
// Board wiring per JC3248W535 silkscreen, matches hd2_macropad reference.
// 1-bit SDMMC needs only CLK + CMD + D0 — D1/D2/D3 unused.
//
// IMPORTANT: SDMMC_CLK shares GPIO 12 with TOUCH_RST, and SDMMC_CMD
// shares GPIO 11 with TOUCH_INT. The display driver does NOT call
// pinMode(TOUCH_RST,OUTPUT) or pinMode(TOUCH_INT,INPUT_PULLUP) so the
// SDMMC peripheral can drive these pins. The AXS-touch chip self-resets
// at power-on (per hd2_macropad reference) and we poll touch via I2C
// (not interrupt), so neither shared signal is needed for touch to work.
#define SDMMC_CLK 12
#define SDMMC_CMD 11
#define SDMMC_D0 13
#define SD_FREQUENCY 20000 // 20 MHz (matches T-HMI's reliability fix)
#define SDMMC_1BIT_FIX (1) // tells NerdMinerV2.ino.cpp to defer SD
// init until after main subsystems are up

// ---------------- NerdMiner expected pins ------------------------------------
// LED — board has no dedicated user LED; reuse backlight so doLedStuff() does
// something visible (briefly dims the screen during "Connecting" blinks).
// If you wire an external LED, redefine LED_PIN to its GPIO.
// #define LED_PIN LCD_BL
#define ACTIVE_LED HIGH
#define INACTIVE_LED LOW

// Buttons — JC3248W535 has no physical user buttons exposed to the firmware.
// Touch is used instead (see jc3248w535DisplayDriver.cpp).
// Define PIN_BUTTON_1 only if you wire one to a free GPIO.
//#define PIN_BUTTON_1 0

// Screen size in landscape orientation (matches setRotation(1))
#define SCREEN_WIDTH 480
#define SCREEN_HEIGHT 320

// ---------------- Optional NerdMiner subsystem enables -----------------------
// SCREEN_WORKERS_ENABLE — adds the pool worker API call so the bottom POOL
// panel can show real workers count / total worker hashrate / best difficulty.
// Without this, those fields stay zeros.
#define SCREEN_WORKERS_ENABLE (1)

// SCREEN_FEES_ENABLE — adds the extra mempool fee fields (fastestFee,
// hourFee, economyFee, minimumFee) to coin_data so the FEES bottom panel
// can show the full T-HMI-style 3-column fee view instead of just one value.
//
// NOTE: This also requires the matching #if guard in src/monitor.h to allow
// JC3248W535 to access those fields (added in v0.7.2).
#define SCREEN_FEES_ENABLE (1)

#endif // _JC3248W535_H
4 changes: 4 additions & 0 deletions src/drivers/displays/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ DisplayDriver *currentDisplayDriver = &t_hmiDisplayDriver;
DisplayDriver *currentDisplayDriver = &sp_kcDisplayDriver;
#endif

#ifdef JC3248W535_DISPLAY
DisplayDriver *currentDisplayDriver = &jc3248w535DisplayDriver;
#endif


// Initialize the display
void initDisplay()
Expand Down
1 change: 1 addition & 0 deletions src/drivers/displays/displayDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extern DisplayDriver m5stickCDriver;
extern DisplayDriver m5stickCPlusDriver;
extern DisplayDriver t_hmiDisplayDriver;
extern DisplayDriver sp_kcDisplayDriver;
extern DisplayDriver jc3248w535DisplayDriver;

#define SCREENS_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

Expand Down
Loading