Merge branch 'master' into use_detected_ina_addr

This commit is contained in:
Michael Gjelsø 2025-05-13 20:40:20 +02:00 committed by GitHub
commit 39e42f64e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 140 additions and 190 deletions

View File

@ -43,6 +43,16 @@ S3_VARIANTS=(
"wireless-tracker"
"station-g2"
"unphone"
"t-eth-elite"
"mesh-tab"
"dreamcatcher"
"ESP32-S3-Pico"
"seeed-sensecap-indicator"
"heltec_capsule_sensor_v3"
"vision-master"
"icarus"
"tracksenger"
"elecrow-adv"
)
# Determine the correct esptool command to use

View File

@ -8,8 +8,8 @@
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_USB_MODE=0",
"-DARDUINO_USB_CDC_ON_BOOT=0",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=0"
],

@ -1 +1 @@
Subproject commit 078ac8dfbe5f7533d7755cbe2ca3d08d86e5af34
Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705

View File

@ -65,8 +65,8 @@
#endif
#if (defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ILI9342_DRIVER) || defined(ST7701_CS) || defined(ST7735_CS) || \
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS)) || \
defined(ILI9488_CS) && !defined(DISPLAY_FORCE_SMALL_FONTS)
defined(ST7789_CS) || defined(USE_ST7789) || defined(HX8357_CS) || defined(ILI9488_CS)) && \
!defined(DISPLAY_FORCE_SMALL_FONTS)
// The screen is bigger so use bigger fonts
#define FONT_SMALL FONT_MEDIUM_LOCAL // Height: 19
#define FONT_MEDIUM FONT_LARGE_LOCAL // Height: 28

View File

@ -584,7 +584,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false)
strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32);
#if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \
defined(ELECROW)) && \
defined(ELECROW_PANEL)) && \
HAS_TFT
// switch BT off by default; use TFT programming mode or hotkey to enable
config.bluetooth.enabled = false;
@ -689,7 +689,7 @@ void NodeDB::initConfigIntervals()
config.display.screen_on_secs = default_screen_on_secs;
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(UNPHONE) || defined(MESH_TAB) || defined(RAK14014) || defined(ELECROW)
#if defined(USE_POWERSAVE)
config.power.is_power_saving = true;
config.display.screen_on_secs = 30;
config.power.wait_bluetooth_secs = 30;

View File

@ -15,6 +15,9 @@ PB_BIND(meshtastic_HamParameters, meshtastic_HamParameters, AUTO)
PB_BIND(meshtastic_NodeRemoteHardwarePinsResponse, meshtastic_NodeRemoteHardwarePinsResponse, 2)
PB_BIND(meshtastic_SharedContact, meshtastic_SharedContact, AUTO)

View File

@ -99,6 +99,14 @@ typedef struct _meshtastic_NodeRemoteHardwarePinsResponse {
meshtastic_NodeRemoteHardwarePin node_remote_hardware_pins[16];
} meshtastic_NodeRemoteHardwarePinsResponse;
typedef struct _meshtastic_SharedContact {
/* The node number of the contact */
uint32_t node_num;
/* The User of the contact */
bool has_user;
meshtastic_User user;
} meshtastic_SharedContact;
typedef PB_BYTES_ARRAY_T(8) meshtastic_AdminMessage_session_passkey_t;
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
This message is used to do settings operations to both remote AND local nodes.
@ -202,6 +210,8 @@ typedef struct _meshtastic_AdminMessage {
bool begin_edit_settings;
/* Commits an open transaction for any edits made to config, module config, owner, and channel settings */
bool commit_edit_settings;
/* Add a contact (User) to the nodedb */
meshtastic_SharedContact add_contact;
/* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared. */
int32_t factory_reset_device;
/* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
@ -252,13 +262,16 @@ extern "C" {
/* Initializer values for message structs */
#define meshtastic_AdminMessage_init_default {0, {0}, {0, {0}}}
#define meshtastic_HamParameters_init_default {"", 0, 0, ""}
#define meshtastic_NodeRemoteHardwarePinsResponse_init_default {0, {meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default, meshtastic_NodeRemoteHardwarePin_init_default}}
#define meshtastic_SharedContact_init_default {0, false, meshtastic_User_init_default}
#define meshtastic_AdminMessage_init_zero {0, {0}, {0, {0}}}
#define meshtastic_HamParameters_init_zero {"", 0, 0, ""}
#define meshtastic_NodeRemoteHardwarePinsResponse_init_zero {0, {meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero, meshtastic_NodeRemoteHardwarePin_init_zero}}
#define meshtastic_SharedContact_init_zero {0, false, meshtastic_User_init_zero}
/* Field tags (for use in manual encoding/decoding) */
#define meshtastic_HamParameters_call_sign_tag 1
@ -266,6 +279,8 @@ extern "C" {
#define meshtastic_HamParameters_frequency_tag 3
#define meshtastic_HamParameters_short_name_tag 4
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag 1
#define meshtastic_SharedContact_node_num_tag 1
#define meshtastic_SharedContact_user_tag 2
#define meshtastic_AdminMessage_get_channel_request_tag 1
#define meshtastic_AdminMessage_get_channel_response_tag 2
#define meshtastic_AdminMessage_get_owner_request_tag 3
@ -310,6 +325,7 @@ extern "C" {
#define meshtastic_AdminMessage_remove_ignored_node_tag 48
#define meshtastic_AdminMessage_begin_edit_settings_tag 64
#define meshtastic_AdminMessage_commit_edit_settings_tag 65
#define meshtastic_AdminMessage_add_contact_tag 66
#define meshtastic_AdminMessage_factory_reset_device_tag 94
#define meshtastic_AdminMessage_reboot_ota_seconds_tag 95
#define meshtastic_AdminMessage_exit_simulator_tag 96
@ -365,6 +381,7 @@ X(a, STATIC, ONEOF, UINT32, (payload_variant,set_ignored_node,set_ignored
X(a, STATIC, ONEOF, UINT32, (payload_variant,remove_ignored_node,remove_ignored_node), 48) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,begin_edit_settings,begin_edit_settings), 64) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,commit_edit_settings,commit_edit_settings), 65) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,add_contact,add_contact), 66) \
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset_device,factory_reset_device), 94) \
X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_ota_seconds,reboot_ota_seconds), 95) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \
@ -390,6 +407,7 @@ X(a, STATIC, SINGULAR, BYTES, session_passkey, 101)
#define meshtastic_AdminMessage_payload_variant_set_fixed_position_MSGTYPE meshtastic_Position
#define meshtastic_AdminMessage_payload_variant_get_ui_config_response_MSGTYPE meshtastic_DeviceUIConfig
#define meshtastic_AdminMessage_payload_variant_store_ui_config_MSGTYPE meshtastic_DeviceUIConfig
#define meshtastic_AdminMessage_payload_variant_add_contact_MSGTYPE meshtastic_SharedContact
#define meshtastic_HamParameters_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, STRING, call_sign, 1) \
@ -405,20 +423,30 @@ X(a, STATIC, REPEATED, MESSAGE, node_remote_hardware_pins, 1)
#define meshtastic_NodeRemoteHardwarePinsResponse_DEFAULT NULL
#define meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_MSGTYPE meshtastic_NodeRemoteHardwarePin
#define meshtastic_SharedContact_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, node_num, 1) \
X(a, STATIC, OPTIONAL, MESSAGE, user, 2)
#define meshtastic_SharedContact_CALLBACK NULL
#define meshtastic_SharedContact_DEFAULT NULL
#define meshtastic_SharedContact_user_MSGTYPE meshtastic_User
extern const pb_msgdesc_t meshtastic_AdminMessage_msg;
extern const pb_msgdesc_t meshtastic_HamParameters_msg;
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePinsResponse_msg;
extern const pb_msgdesc_t meshtastic_SharedContact_msg;
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
#define meshtastic_AdminMessage_fields &meshtastic_AdminMessage_msg
#define meshtastic_HamParameters_fields &meshtastic_HamParameters_msg
#define meshtastic_NodeRemoteHardwarePinsResponse_fields &meshtastic_NodeRemoteHardwarePinsResponse_msg
#define meshtastic_SharedContact_fields &meshtastic_SharedContact_msg
/* Maximum encoded size of messages (where known) */
#define MESHTASTIC_MESHTASTIC_ADMIN_PB_H_MAX_SIZE meshtastic_AdminMessage_size
#define meshtastic_AdminMessage_size 511
#define meshtastic_HamParameters_size 31
#define meshtastic_NodeRemoteHardwarePinsResponse_size 496
#define meshtastic_SharedContact_size 121
#ifdef __cplusplus
} /* extern "C" */

View File

@ -24,6 +24,7 @@
#include "mesh/wifi/WiFiAPClient.h"
#endif
#include "rom/rtc.h"
#include <RadioLib.h>
#include <driver/rtc_io.h>
#include <driver/uart.h>
@ -284,6 +285,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false, bool skipSaveN
pinMode(LORA_CS, OUTPUT);
digitalWrite(LORA_CS, HIGH);
gpio_hold_en((gpio_num_t)LORA_CS);
#elif defined(ELECROW_PANEL)
// Elecrow panels do not use LORA_CS, do nothing
#else
if (GPIO_IS_VALID_OUTPUT_GPIO(LORA_CS)) {
// LoRa CS (RADIO_NSS) needs to stay HIGH, even during deep sleep
@ -400,7 +403,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
#ifdef INPUTDRIVER_ENCODER_BTN
gpio_wakeup_enable((gpio_num_t)INPUTDRIVER_ENCODER_BTN, GPIO_INTR_LOW_LEVEL);
#endif
#if defined(T_WATCH_S3) || defined(ELECROW)
#if defined(WAKE_ON_TOUCH)
gpio_wakeup_enable((gpio_num_t)SCREEN_TOUCH_INT, GPIO_INTR_LOW_LEVEL);
#endif
enableLoraInterrupt();
@ -433,11 +436,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
// Disable wake-on-button interrupt. Re-attach normal button-interrupts
gpio_wakeup_disable(pin);
#endif
#if defined(T_WATCH_S3) || defined(ELECROW)
#if defined(INPUTDRIVER_ENCODER_BTN)
gpio_wakeup_disable((gpio_num_t)INPUTDRIVER_ENCODER_BTN);
#endif
#if defined(WAKE_ON_TOUCH)
gpio_wakeup_disable((gpio_num_t)SCREEN_TOUCH_INT);
#endif
#if !defined(SOC_PM_SUPPORT_EXT_WAKEUP) && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
if (radioType != RF95_RADIO) {
gpio_wakeup_disable((gpio_num_t)LORA_DIO1);
@ -506,23 +510,24 @@ bool shouldLoraWake(uint32_t msecToWake)
void enableLoraInterrupt()
{
esp_err_t res;
#if SOC_PM_SUPPORT_EXT_WAKEUP && defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
gpio_pulldown_en((gpio_num_t)LORA_DIO1);
res = gpio_pulldown_en((gpio_num_t)LORA_DIO1);
if (res != ESP_OK) {
LOG_ERROR("gpio_pulldown_en(LORA_DIO1) result %d", res);
}
#if defined(LORA_RESET) && (LORA_RESET != RADIOLIB_NC)
gpio_pullup_en((gpio_num_t)LORA_RESET);
res = gpio_pullup_en((gpio_num_t)LORA_RESET);
if (res != ESP_OK) {
LOG_ERROR("gpio_pullup_en(LORA_RESET) result %d", res);
}
#endif
#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC)
#if defined(LORA_CS) && (LORA_CS != RADIOLIB_NC) && !defined(ELECROW_PANEL)
gpio_pullup_en((gpio_num_t)LORA_CS);
#endif
if (rtc_gpio_is_valid_gpio((gpio_num_t)LORA_DIO1)) {
// Setup light/deep sleep with wakeup by external source
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by external source", LORA_DIO1);
esp_sleep_enable_ext0_wakeup((gpio_num_t)LORA_DIO1, HIGH);
} else {
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1);
gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL);
}
LOG_INFO("setup LORA_DIO1 (GPIO%02d) with wakeup by gpio interrupt", LORA_DIO1);
gpio_wakeup_enable((gpio_num_t)LORA_DIO1, GPIO_INTR_HIGH_LEVEL);
#elif defined(LORA_DIO1) && (LORA_DIO1 != RADIOLIB_NC)
if (radioType != RF95_RADIO) {

View File

@ -3,13 +3,11 @@
#include <stdint.h>
// static const uint8_t LED_BUILTIN = -1;
static const uint8_t TX = 43;
static const uint8_t RX = 44;
// static const uint8_t TX = 43;
// static const uint8_t RX = 44;
static const uint8_t SDA = 39;
static const uint8_t SCL = 40;
static const uint8_t SDA = 15;
static const uint8_t SCL = 16;
// Default SPI will be mapped to Radio
static const uint8_t SS = -1;
@ -17,13 +15,9 @@ static const uint8_t MOSI = 48;
static const uint8_t MISO = 47;
static const uint8_t SCK = 41;
#ifndef CROW_SELECT
static const uint8_t SPI_MOSI = 6;
static const uint8_t SPI_SCK = 5;
static const uint8_t SPI_MISO = 4;
static const uint8_t SPI_CS = 7; // SD does not support -1
static const uint8_t SDCARD_CS = SPI_CS;
#endif
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;

View File

@ -4,10 +4,8 @@ board = crowpanel
board_check = true
upload_protocol = esptool
board_build.partitions = default_16MB.csv ; must be here for some reason, board.json is not enough !?
build_flags = ${esp32s3_base.build_flags} -Os
-I variants/elecrow_panel
-D ELECROW
-D ELECROW_PANEL
-D CONFIG_ARDUHAL_LOG_COLORS
-D RADIOLIB_DEBUG_SPI=0
@ -22,15 +20,15 @@ build_flags = ${esp32s3_base.build_flags} -Os
-D MESHTASTIC_EXCLUDE_SOCKETAPI=1
-D MESHTASTIC_EXCLUDE_SCREEN=1
-D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
; -D INPUTDRIVER_BUTTON_TYPE=0
-D HAS_TELEMETRY=0
-D CONFIG_DISABLE_HAL_LOCKS=1
-D USE_PIN_BUZZER
-D HAS_SCREEN=0
-D HAS_TFT=1
-D RAM_SIZE=6144
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D LV_LVGL_H_INCLUDE_SIMPLE
-D LV_CONF_INCLUDE_SIMPLE
-D LV_COMP_CONF_INCLUDE_SIMPLE
-D LV_USE_SYSMON=0
-D LV_USE_PROFILER=0
-D LV_USE_PERF_MONITOR=0
@ -40,29 +38,44 @@ build_flags = ${esp32s3_base.build_flags} -Os
-D USE_LOG_DEBUG
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
-D USE_PACKET_API
-D HAS_SDCARD
-D SD_SPI_FREQUENCY=75000000
lib_deps = ${esp32s3_base.lib_deps}
${device-ui_base.lib_deps}
earlephilhower/ESP8266Audio@^1.9.9
earlephilhower/ESP8266SAM@^1.0.1
lovyan03/LovyanGFX@^1.2.0
hideakitai/TCA9534@^0.1.1
earlephilhower/ESP8266Audio@1.9.9
earlephilhower/ESP8266SAM@1.0.1
lovyan03/LovyanGFX@1.2.0 ; note: v1.2.7 breaks the elecrow 7" display functionality
hideakitai/TCA9534@0.1.1
[env:elecrow-24-28-tft]
[crowpanel_small] ; 2.4, 2.8, 3.5 inch
extends = crowpanel_base
build_flags =
${crowpanel_base.build_flags}
-D TFT_HEIGHT=320 ; needed in variant.h
-D HAS_SDCARD
-D CROW_SELECT=1
-D SDCARD_USE_SOFT_SPI
-D SDCARD_CS=7
-D SPI_DRIVER_SELECT=2
-D USE_PIN_BUZZER
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
-D LGFX_DRIVER_TEMPLATE
-D LGFX_DRIVER=LGFX_GENERIC
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
-D VIEW_320x240
-D MAP_FULL_REDRAW
[crowpanel_large] ; 4.3, 5.0, 7.0 inch
extends = crowpanel_base
build_flags =
${crowpanel_base.build_flags}
-D CROW_SELECT=2
-D SDCARD_CS=7
-D LGFX_DRIVER=LGFX_ELECROW70
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_ELECROW70.h\"
-D DISPLAY_SET_RESOLUTION
[env:elecrow-adv-24-28-tft]
extends = crowpanel_small
build_flags =
${crowpanel_small.build_flags}
-D SPI_FREQUENCY=80000000
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
@ -81,25 +94,12 @@ build_flags =
-D LGFX_TOUCH_INT=47
-D LGFX_TOUCH_RST=48
-D LGFX_TOUCH_ROTATION=0
-D VIEW_320x240
-D MAP_FULL_REDRAW
[env:elecrow-35-tft]
extends = crowpanel_base
[env:elecrow-adv-35-tft]
extends = crowpanel_small
build_flags =
${crowpanel_base.build_flags}
-D TFT_HEIGHT=480 ; needed in variant.h
-D HAS_SDCARD
-D SDCARD_USE_SOFT_SPI
-D SPI_DRIVER_SELECT=2
-D USE_PIN_BUZZER
; -D INPUTDRIVER_BUTTON_TYPE=0 ; no button as this pin is assigned to LoRa cs!
-D SCREEN_TOUCH_INT=47 ; used to wake up the MCU by touch
${crowpanel_small.build_flags}
-D LV_CACHE_DEF_SIZE=2097152
-D LGFX_DRIVER_TEMPLATE
-D LGFX_DRIVER=LGFX_GENERIC
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\"
-D SPI_FREQUENCY=60000000
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
@ -119,5 +119,10 @@ build_flags =
-D LGFX_TOUCH_RST=48
-D LGFX_TOUCH_ROTATION=0
-D DISPLAY_SET_RESOLUTION
; 4.3, 5.0, 7.0 inch 800x480 IPS (V1)
[env:elecrow-adv1-43-50-70-tft]
extends = crowpanel_large
build_flags =
${crowpanel_large.build_flags}
-D VIEW_320x240
-D MAP_FULL_REDRAW

View File

@ -1,124 +1,14 @@
#define I2C_SDA 15
#define I2C_SCL 16
#if TFT_HEIGHT == 320 && not defined(HAS_TFT) // 2.4 and 2.8 TFT
// ST7789 TFT LCD
#define ST7789_CS 40
#define ST7789_RS 41 // DC
#define ST7789_SDA 39 // MOSI
#define ST7789_SCK 42
#define ST7789_RESET -1
#define ST7789_MISO 38
#define ST7789_BUSY -1
#define ST7789_BL 38
#define ST7789_SPI_HOST SPI2_HOST
#define TFT_BL 38
#define SPI_FREQUENCY 60000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define TFT_DUMMY_READ_PIXELS 8
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#define HAS_TOUCHSCREEN 1
#if CROW_SELECT == 1
#define WAKE_ON_TOUCH
#define SCREEN_TOUCH_INT 47
#define SCREEN_TOUCH_RST 48
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x38 // FT5x06
#define USE_POWERSAVE
#define SLEEP_TIME 180
#endif
#if TFT_HEIGHT == 480 && not defined(HAS_TFT) // 3.5 TFT
// ILI9488 TFT LCD
#define ILI9488_CS 40
#define ILI9488_RS 41 // DC
#define ILI9488_SDA 39 // MOSI
#define ILI9488_SCK 42
#define ILI9488_RESET -1
#define ILI9488_MISO 38
#define ILI9488_BUSY -1
#define ILI9488_BL 38
#define ILI9488_SPI_HOST SPI2_HOST
#define TFT_BL 38
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_OFFSET_ROTATION 0
#define SCREEN_ROTATE
#define TFT_DUMMY_READ_PIXELS 8
#define SCREEN_TRANSITION_FRAMERATE 5
#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
#define HAS_TOUCHSCREEN 1
#define SCREEN_TOUCH_INT 47
#define SCREEN_TOUCH_RST 48
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
#endif
#ifdef CROW_SELECT
#define ST72xx_DE 42
#define ST72xx_VSYNC 41
#define ST72xx_HSYNC 40
#define ST72xx_PCLK 39
#define ST72xx_R0 7
#define ST72xx_R1 17
#define ST72xx_R2 18
#define ST72xx_R3 3
#define ST72xx_R4 46
#define ST72xx_G0 9
#define ST72xx_G1 10
#define ST72xx_G2 11
#define ST72xx_G3 12
#define ST72xx_G4 13
#define ST72xx_G5 14
#define ST72xx_B0 21
#define ST72xx_B1 47
#define ST72xx_B2 48
#define ST72xx_B3 45
#define ST72xx_B4 38
#define HAS_TOUCHSCREEN 1
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 1 // 4.3 TFT 800x480
#define ST7265_HSYNC_POLARITY 0
#define ST7265_HSYNC_FRONT_PORCH 24
#define ST7265_HSYNC_PULSE_WIDTH 8
#define ST7265_HSYNC_BACK_PORCH 24
#define ST7265_VSYNC_POLARITY 1
#define ST7265_VSYNC_FRONT_PORCH 24
#define ST7265_VSYNC_PULSE_WIDTH 8
#define ST7265_VSYNC_BACK_PORCH 24
#define ST7265_PCLK_ACTIVE_NEG 1
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 2 // 5.0 TFT 800x480
#define ST7262_HSYNC_POLARITY 0
#define ST7262_HSYNC_FRONT_PORCH 8
#define ST7262_HSYNC_PULSE_WIDTH 4
#define ST7262_HSYNC_BACK_PORCH 8
#define ST7262_VSYNC_POLARITY 0
#define ST7262_VSYNC_FRONT_PORCH 8
#define ST7262_VSYNC_PULSE_WIDTH 4
#define ST7262_VSYNC_BACK_PORCH 8
#define ST7262_PCLK_ACTIVE_NEG 0
#endif
#if defined(CROW_SELECT) && CROW_SELECT == 3 // 7.0 TFT 800x480
#define SC7277_HSYNC_POLARITY 0
#define SC7277_HSYNC_FRONT_PORCH 8
#define SC7277_HSYNC_PULSE_WIDTH 4
#define SC7277_HSYNC_BACK_PORCH 8
#define SC7277_VSYNC_POLARITY 0
#define SC7277_VSYNC_FRONT_PORCH 8
#define SC7277_VSYNC_PULSE_WIDTH 4
#define SC7277_VSYNC_BACK_PORCH 8
#define SC7277_PCLK_ACTIVE_NEG 0
#endif
#if TFT_HEIGHT == 320 // 2.4-2.8 have I2S audio
#if CROW_SELECT == 1
// dac / amp
// #define HAS_I2S // didn't get I2S sound working
#define PIN_BUZZER 8 // using pwm buzzer instead (nobody will notice, lol)
@ -131,10 +21,16 @@
#endif
// GPS via UART1 connector
#define HAS_GPS 1
#define GPS_DEFAULT_NOT_PRESENT 1
#define HAS_GPS 1
#if CROW_SELECT == 1
#define GPS_RX_PIN 18
#define GPS_TX_PIN 17
#else
// GPIOs shared with LoRa or MIC module
#define GPS_RX_PIN 19
#define GPS_TX_PIN 20
#endif
// Extension Slot Layout, viewed from above (2.4-3.5)
// DIO1/IO1 o o IO2/NRESET
@ -158,9 +54,11 @@
// LoRa
#define USE_SX1262
#define LORA_CS 0 // GND
#if TFT_HEIGHT == 320 || TFT_HEIGHT == 480 // 2.4 - 3.5 TFT
#if CROW_SELECT == 1
// 2.4", 2.8, 3.5"""
#define HW_SPI1_DEVICE
#define LORA_CS 0
#define LORA_SCK 10
#define LORA_MISO 9
#define LORA_MOSI 3
@ -173,6 +71,8 @@
#define SENSOR_POWER_CTRL_PIN 45
#define SENSOR_POWER_ON LOW
#else
// 4.3", 5.0", 7.0"
#define LORA_CS 0
#define LORA_SCK 5
#define LORA_MISO 4
#define LORA_MOSI 6
@ -182,14 +82,9 @@
#define LORA_DIO2 2 // SX1262 BUSY
#endif
#define HW_SPI1_DEVICE
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 3.3
#define USE_VIRTUAL_KEYBOARD 1
#define DISPLAY_CLOCK_FRAME 1

View File

@ -3,7 +3,8 @@
#define HAS_TOUCHSCREEN 1
#define SLEEP_TIME 120
#define USE_POWERSAVE
#define SLEEP_TIME 180
// Analog pins
#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage

View File

@ -305,6 +305,9 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG
#define HAS_TOUCHSCREEN 1
#define SCREEN_TOUCH_INT WB_IO6
#define USE_POWERSAVE
#define SLEEP_TIME 120
#define CANNED_MESSAGE_MODULE_ENABLE 1
#define USE_VIRTUAL_KEYBOARD 1
/*----------------------------------------------------------------------------

View File

@ -31,6 +31,7 @@
#define TOUCH_I2C_PORT 0
#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
#define USE_POWERSAVE
#define SLEEP_TIME 120
#ifndef HAS_TFT

View File

@ -24,7 +24,9 @@
#define SCREEN_TOUCH_USE_I2C1
#define TOUCH_I2C_PORT 1
#define TOUCH_SLAVE_ADDRESS 0x38
#define WAKE_ON_TOUCH
#define USE_POWERSAVE
#define SLEEP_TIME 180
#define I2C_SDA1 39 // Used for capacitive touch

View File

@ -41,6 +41,9 @@
#define USE_XPT2046 1
#define TOUCH_CS 38
#define USE_POWERSAVE
#define SLEEP_TIME 180
#define HAS_GPS \
0 // the unphone doesn't have a gps module by default (though
// GPS featherwing -- https://www.adafruit.com/product/3133