Files
MeshCore/variants/m5stack_cardputer_adv/platformio.ini
T
mjgodatandClaude Opus 5.5 5681898ad4 Add M5Stack Cardputer-Adv variant with keyboard/display companion UI
New variant variants/m5stack_cardputer_adv for the Cardputer-Adv
(ESP32-S3, 8 MB) with the Cap LoRa-1262 (SX1262 + GNSS):

- Envs: companion_radio_ble, companion_radio_usb, repeater, room_server.
- Board: enables the Cap's antenna path via the PI4IOE5V6408 on the
  internal I2C bus (Wire1, G8/G9); Wire stays on the Grove port. LoRa and
  microSD share FSPI because the display owns SPI3. TCXO 1.8 V.
- Companion UI adapted from MultiMote/meshcore-cardputer-adv (MIT,
  LICENSE.MultiMote), running on the standard companion so the USB
  terminal CLI stays available. Contacts/identity stay in internal
  SPIFFS; the microSD card is optional (chat history, keyboard layouts).
- Sticky Shift, one-shot Fn with Fn+letter shortcuts, top button (G0)
  sends a flood advert, brightness control.
- Text size setting (Normal/Large/Extra large) with DejaVu Sans fonts
  generated by tools/gen_vlw_font.py; layouts derive from the font size.
- Power save maps to the companion's powersaving pref; the UI vetoes
  light sleep while the screen is on. Low-battery power-off at 3.4 V.
- win_long_cmdline.py: Windows-only -iprefix include shortening so the
  ESP32 compile command stays under the 32,767-character limit.

Shared companion changes are guarded by CARDPUTER_ADV_UI: main.cpp
selects CardputerDataStore/CardputerUITask/CardputerMesh, and MyMesh.h
maps the_mesh to the subclass like the PSRAM storage path does.

Tested on hardware (910.525 MHz mesh): radio RX/TX, USB CLI, BLE, UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:24:43 -07:00

121 lines
3.9 KiB
INI

; M5Stack Cardputer-Adv (StampS3A, ESP32-S3, 8 MB) + Cap LoRa-1262 (SX1262).
; Pin map: docs.m5stack.com/en/cap/Cap_LoRa-1262 (EXT 2.54-14P header).
; Internal I2C (Wire1, G8/G9): TCA8418 keyboard, ES8311 codec and the Cap's
; PI4IOE5V6408 antenna switch. Wire is the Grove port (G2/G1).
; microSD (CS G12) shares the LoRa SPI bus.
; Companion builds use the keyboard/display UI adapted from
; MultiMote/meshcore-cardputer-adv (MIT); repeater/room builds are headless.
; TCXO 1.8 V verified on hardware (radio init + RX/TX on 910.525 MHz).
[M5Stack_Cardputer_Adv]
extends = esp32_base
board = m5stack-stamps3
board_check = true
board_build.mcu = esp32s3
board_build.partitions = default_8MB.csv
extra_scripts =
${esp32_base.extra_scripts}
pre:variants/m5stack_cardputer_adv/win_long_cmdline.py
build_flags = ${esp32_base.build_flags}
-I variants/m5stack_cardputer_adv
-I src/helpers/sensors
-D M5STACK_CARDPUTER_ADV
; StampS3 board JSON sets USB_MODE=1 but not CDC_ON_BOOT; without this the
; console/CLI is on UART0 pins instead of the USB-C port.
-D ARDUINO_USB_CDC_ON_BOOT=1
-D PIN_VBAT_READ=10
-D PIN_BOARD_SDA=2
-D PIN_BOARD_SCL=1
-D PIN_SD_CS=12
-D P_LORA_NSS=5
-D P_LORA_SCLK=40
-D P_LORA_MISO=39
-D P_LORA_MOSI=14
-D P_LORA_RESET=3
-D P_LORA_BUSY=6
-D P_LORA_DIO_1=4
-D PIN_GPS_RX=13
-D PIN_GPS_TX=15
-D GPS_BAUD_RATE=115200
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D USE_SX1262
-D MC_SX1262_SPI_HZ=8000000
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
build_src_filter = ${esp32_base.build_src_filter}
+<helpers/sensors/EnvironmentSensorManager.cpp>
+<../variants/m5stack_cardputer_adv/target.cpp>
lib_deps =
${esp32_base.lib_deps}
; Keyboard + display UI on top of the Cascade companion (CLI stays on USB).
[M5Stack_Cardputer_Adv_ui]
extends = M5Stack_Cardputer_Adv
build_flags =
${M5Stack_Cardputer_Adv.build_flags}
-I variants/m5stack_cardputer_adv/companion_radio
-I variants/m5stack_cardputer_adv/companion_radio/ui-cardputer
-I examples/companion_radio
-D CARDPUTER_ADV_UI=1
-D ENV_INCLUDE_GPS=1
-D AUTO_SHUTDOWN_MILLIVOLTS=3400
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D ENABLE_USB_INTERFACE
build_src_filter = ${M5Stack_Cardputer_Adv.build_src_filter}
-<helpers/sensors/EnvironmentSensorManager.cpp>
+<helpers/esp32/*.cpp>
+<../examples/companion_radio/*.cpp>
+<../variants/m5stack_cardputer_adv/*.cpp>
+<../variants/m5stack_cardputer_adv/hw>
+<../variants/m5stack_cardputer_adv/companion_radio>
lib_deps =
${M5Stack_Cardputer_Adv.lib_deps}
densaugeo/base64 @ ~1.4.0
lovyan03/LovyanGFX @ ^1.2.24
adafruit/Adafruit TCA8418 @ ^1.0.2
stevemarple/MicroNMEA @ ^2.0.6
[env:M5Stack_Cardputer_Adv_repeater]
extends = M5Stack_Cardputer_Adv
build_src_filter = ${M5Stack_Cardputer_Adv.build_src_filter}
+<../examples/simple_repeater/*.cpp>
build_flags =
${M5Stack_Cardputer_Adv.build_flags}
-D ADVERT_NAME='"Cardputer Repeater"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D MAX_NEIGHBOURS=50
lib_deps =
${M5Stack_Cardputer_Adv.lib_deps}
${esp32_ota.lib_deps}
[env:M5Stack_Cardputer_Adv_room_server]
extends = M5Stack_Cardputer_Adv
build_src_filter = ${M5Stack_Cardputer_Adv.build_src_filter}
+<../examples/simple_room_server>
build_flags =
${M5Stack_Cardputer_Adv.build_flags}
-D ADVERT_NAME='"Cardputer Room"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
-D ROOM_PASSWORD='"hello"'
lib_deps =
${M5Stack_Cardputer_Adv.lib_deps}
${esp32_ota.lib_deps}
[env:M5Stack_Cardputer_Adv_companion_radio_usb]
extends = M5Stack_Cardputer_Adv_ui
[env:M5Stack_Cardputer_Adv_companion_radio_ble]
extends = M5Stack_Cardputer_Adv_ui
build_flags =
${M5Stack_Cardputer_Adv_ui.build_flags}
-D BLE_PIN_CODE=123456