Merge branch 'master' into master

This commit is contained in:
GUVWAF 2024-12-27 15:28:15 +01:00 committed by GitHub
commit e057dc9a64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 335 additions and 91 deletions

View File

@ -29,6 +29,8 @@
#define _MPR121_REG_CONFIG1 0x5C #define _MPR121_REG_CONFIG1 0x5C
#define _MPR121_REG_CONFIG2 0x5D #define _MPR121_REG_CONFIG2 0x5D
#define _MPR121_REG_ELECTRODE_CONFIG 0x5E #define _MPR121_REG_ELECTRODE_CONFIG 0x5E
#define _MPR121_REG_AUTOCONF_CTRL0 0x7B
#define _MPR121_REG_AUTOCONF_CTRL1 0x7C
#define _MPR121_REG_SOFT_RESET 0x80 #define _MPR121_REG_SOFT_RESET 0x80
#define _KEY_MASK 0x0FFF // Key mask for the first 12 bits #define _KEY_MASK 0x0FFF // Key mask for the first 12 bits
@ -132,18 +134,18 @@ void MPR121Keyboard::reset()
writeRegister(_MPR121_REG_ELECTRODE_CONFIG, 0x00); writeRegister(_MPR121_REG_ELECTRODE_CONFIG, 0x00);
delay(100); delay(100);
LOG_DEBUG("MPR121 Configure"); LOG_DEBUG("MPR121 Configuring");
// Set touch release thresholds // Set touch release thresholds
for (uint8_t i = 0; i < 12; i++) { for (uint8_t i = 0; i < 12; i++) {
// Set touch threshold // Set touch threshold
writeRegister(_MPR121_REG_TOUCH_THRESHOLD + (i * 2), 15); writeRegister(_MPR121_REG_TOUCH_THRESHOLD + (i * 2), 10);
delay(20); delay(20);
// Set release threshold // Set release threshold
writeRegister(_MPR121_REG_RELEASE_THRESHOLD + (i * 2), 7); writeRegister(_MPR121_REG_RELEASE_THRESHOLD + (i * 2), 5);
delay(20); delay(20);
} }
// Configure filtering and baseline registers // Configure filtering and baseline registers
writeRegister(_MPR121_REG_MAX_HALF_DELTA_RISING, 0x01); writeRegister(_MPR121_REG_MAX_HALF_DELTA_RISING, 0x05);
delay(20); delay(20);
writeRegister(_MPR121_REG_MAX_HALF_DELTA_FALLING, 0x01); writeRegister(_MPR121_REG_MAX_HALF_DELTA_FALLING, 0x01);
delay(20); delay(20);
@ -153,7 +155,7 @@ void MPR121Keyboard::reset()
delay(20); delay(20);
writeRegister(_MPR121_REG_NOISE_HALF_DELTA_TOUCHED, 0x00); writeRegister(_MPR121_REG_NOISE_HALF_DELTA_TOUCHED, 0x00);
delay(20); delay(20);
writeRegister(_MPR121_REG_NOISE_COUNT_LIMIT_RISING, 0x0e); writeRegister(_MPR121_REG_NOISE_COUNT_LIMIT_RISING, 0x05);
delay(20); delay(20);
writeRegister(_MPR121_REG_NOISE_COUNT_LIMIT_FALLING, 0x01); writeRegister(_MPR121_REG_NOISE_COUNT_LIMIT_FALLING, 0x01);
delay(20); delay(20);
@ -165,18 +167,19 @@ void MPR121Keyboard::reset()
delay(20); delay(20);
writeRegister(_MPR121_REG_FILTER_DELAY_COUNT_TOUCHED, 0x00); writeRegister(_MPR121_REG_FILTER_DELAY_COUNT_TOUCHED, 0x00);
delay(20); delay(20);
// Set Debounce to 0x02 writeRegister(_MPR121_REG_AUTOCONF_CTRL0, 0x04); // Auto-config enable
writeRegister(_MPR121_REG_DEBOUNCE, 0x00);
delay(20); delay(20);
// Set Filter1 itterations and discharge current 6x and 16uA respectively (0x10) writeRegister(_MPR121_REG_AUTOCONF_CTRL1, 0x00); // Ensure no auto-config interrupt
writeRegister(_MPR121_REG_CONFIG1, 0x10);
delay(20); delay(20);
// Set CDT to 0.5us, Filter2 itterations to 4x, and Sample interval = 0 (0x20) writeRegister(_MPR121_REG_DEBOUNCE, 0x02);
writeRegister(_MPR121_REG_CONFIG2, 0x20); delay(20);
writeRegister(_MPR121_REG_CONFIG1, 0x20);
delay(20);
writeRegister(_MPR121_REG_CONFIG2, 0x21);
delay(20); delay(20);
// Enter run mode by Seting partial filter calibration tracking, disable proximity detection, enable 12 channels // Enter run mode by Seting partial filter calibration tracking, disable proximity detection, enable 12 channels
writeRegister(_MPR121_REG_ELECTRODE_CONFIG, writeRegister(_MPR121_REG_ELECTRODE_CONFIG,
ECR_CALIBRATION_TRACK_FROM_PARTIAL_FILTER | ECR_PROXIMITY_DETECTION_OFF | ECR_TOUCH_DETECTION_12CH); ECR_CALIBRATION_TRACK_FROM_FULL_FILTER | ECR_PROXIMITY_DETECTION_OFF | ECR_TOUCH_DETECTION_12CH);
delay(100); delay(100);
LOG_DEBUG("MPR121 Run"); LOG_DEBUG("MPR121 Run");
state = Idle; state = Idle;
@ -427,4 +430,4 @@ void MPR121Keyboard::writeRegister(uint8_t reg, uint8_t value)
if (writeCallback) { if (writeCallback) {
writeCallback(m_addr, data[0], &(data[1]), 1); writeCallback(m_addr, data[0], &(data[1]), 1);
} }
} }

View File

@ -1,5 +1,6 @@
#include <Arduino.h> #include <Arduino.h>
#include <functional> #include <functional>
#include <string>
#define BoolToString(x) ((x) ? "true" : "false") #define BoolToString(x) ((x) ? "true" : "false")

View File

@ -243,6 +243,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
case meshtastic_AdminMessage_store_ui_config_tag: { case meshtastic_AdminMessage_store_ui_config_tag: {
LOG_INFO("Storing device-ui config"); LOG_INFO("Storing device-ui config");
handleStoreDeviceUIConfig(r->store_ui_config); handleStoreDeviceUIConfig(r->store_ui_config);
handled = true;
break; break;
} }
case meshtastic_AdminMessage_begin_edit_settings_tag: { case meshtastic_AdminMessage_begin_edit_settings_tag: {
@ -1010,7 +1011,7 @@ void AdminModule::handleGetDeviceUIConfig(const meshtastic_MeshPacket &req)
{ {
meshtastic_AdminMessage r = meshtastic_AdminMessage_init_default; meshtastic_AdminMessage r = meshtastic_AdminMessage_init_default;
r.which_payload_variant = meshtastic_AdminMessage_get_ui_config_response_tag; r.which_payload_variant = meshtastic_AdminMessage_get_ui_config_response_tag;
r.store_ui_config = uiconfig; r.get_ui_config_response = uiconfig;
myReply = allocDataProtobuf(r); myReply = allocDataProtobuf(r);
} }

View File

@ -174,6 +174,8 @@
#define HW_VENDOR meshtastic_HardwareModel_SENSECAP_INDICATOR #define HW_VENDOR meshtastic_HardwareModel_SENSECAP_INDICATOR
#elif defined(SEEED_XIAO_S3) #elif defined(SEEED_XIAO_S3)
#define HW_VENDOR meshtastic_HardwareModel_SEEED_XIAO_S3 #define HW_VENDOR meshtastic_HardwareModel_SEEED_XIAO_S3
#elif defined(MESH_TAB)
#define HW_VENDOR meshtastic_HardwareModel_MESH_TAB
#endif #endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View File

@ -87,73 +87,3 @@ build_flags =
-D ARDUINO_USB_MODE=0 -D ARDUINO_USB_MODE=0
-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_CDC_ON_BOOT=1
-I variants/diy/t-energy-s3_e22 -I variants/diy/t-energy-s3_e22
; esp32-s3 + ra-sh01 lora + 3.2" ILI9143
[env:mesh-tab]
extends = esp32s3_base
board = um_feathers3
board_level = extra
board_upload.flash_size = 16MB
board_build.partitions = default_16MB.csv
upload_protocol = esptool
build_flags = ${esp32s3_base.build_flags}
-D MESH_TAB
-D PRIVATE_HW
-D CONFIG_ARDUHAL_ESP_LOG
-D CONFIG_ARDUHAL_LOG_COLORS=1
-D CONFIG_DISABLE_HAL_LOCKS=1 ; "feels" to be a bit more stable without locks
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-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
-D LV_USE_MEM_MONITOR=0
-D LV_USE_LOG=0
-D LV_BUILD_TEST=0
-D USE_LOG_DEBUG
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
-D RADIOLIB_SPI_PARANOID=0
-D MAX_NUM_NODES=250
-D MAX_THREADS=40
-D HAS_SCREEN=0
-D HAS_TFT=1
-D RAM_SIZE=1024
-D LGFX_DRIVER_TEMPLATE
-D LGFX_DRIVER=LGFX_GENERIC
-D LGFX_PANEL=ILI9341
-D LGFX_OFFSET_ROTATION=1
-D LGFX_TOUCH=XPT2046
-D LGFX_PIN_SCK=12
-D LGFX_PIN_MOSI=13
-D LGFX_PIN_MISO=11
-D LGFX_PIN_DC=16
-D LGFX_PIN_CS=10
-D LGFX_PIN_RST=-1
-D LGFX_PIN_BL=42
-D LGFX_TOUCH_INT=41
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D VIEW_320x240
-D USE_PACKET_API
-I lib/device-ui/generated/ui_320x240
-I variants/diy/mesh-tab
build_src_filter = ${esp32_base.build_src_filter}
+<../lib/device-ui/generated/ui_320x240>
+<../lib/device-ui/resources>
+<../lib/device-ui/locale>
+<../lib/device-ui/source>
lib_deps = ${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.16
earlephilhower/ESP8266Audio@^1.9.7
earlephilhower/ESP8266SAM@^1.0.1

View File

@ -0,0 +1,65 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include "soc/soc_caps.h"
#include <stdint.h>
#define USB_VID 0x303A
#define USB_PID 0x80D6
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 8;
static const uint8_t SCL = 9;
static const uint8_t SS = 5;
static const uint8_t MOSI = 35;
static const uint8_t MISO = 37;
static const uint8_t SDO = 35;
static const uint8_t SDI = 37;
static const uint8_t SCK = 36;
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t A9 = 10;
static const uint8_t A10 = 11;
static const uint8_t A11 = 12;
static const uint8_t A12 = 13;
static const uint8_t T1 = 1;
static const uint8_t T3 = 3;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T14 = 14;
static const uint8_t VBAT_SENSE = 2;
static const uint8_t VBUS_SENSE = 34;
// User LED
#define LED_BUILTIN 13
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t RGB_DATA = 40;
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API neopixelWrite()
#define RGB_BUILTIN (RGB_DATA + SOC_GPIO_PIN_COUNT)
#define RGB_BRIGHTNESS 64
static const uint8_t RGB_PWR = 39;
static const uint8_t LDO2 = 39;
static const uint8_t LED = 13;
#endif /* Pins_Arduino_h */

View File

@ -0,0 +1,233 @@
; Base for Mesh-Tab device (esp32-s3 N16R2 + ra-sh01 lora)
; https://github.com/valzzu/Mesh-Tab
[mesh_tab_base]
extends = esp32s3_base
board = mesh-tab
board_level = extra
board_upload.flash_size = 16MB
board_build.partitions = default_16MB.csv
upload_protocol = esptool
build_flags = ${esp32s3_base.build_flags}
-D MESH_TAB
-D CONFIG_ARDUHAL_ESP_LOG
-D CONFIG_ARDUHAL_LOG_COLORS=1
-D CONFIG_DISABLE_HAL_LOCKS=1
-D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1
-D MESHTASTIC_EXCLUDE_INPUTBROKER=1
-D MESHTASTIC_EXCLUDE_BLUETOOTH=1
-D MESHTASTIC_EXCLUDE_WEBSERVER=1
-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
-D LV_USE_MEM_MONITOR=0
-D LV_USE_LOG=0
-D LV_BUILD_TEST=0
-D USE_LOG_DEBUG
-D LOG_DEBUG_INC=\"DebugConfiguration.h\"
-D RADIOLIB_SPI_PARANOID=0
-D MAX_NUM_NODES=250
-D MAX_THREADS=40
-D HAS_SCREEN=0
-D HAS_TFT=1
-D USE_PIN_BUZZER
-D RAM_SIZE=1024
-D LGFX_DRIVER_TEMPLATE
-D LGFX_DRIVER=LGFX_GENERIC
-D LGFX_PIN_SCK=12
-D LGFX_PIN_MOSI=13
-D LGFX_PIN_MISO=11
-D LGFX_PIN_DC=16
-D LGFX_PIN_CS=10
-D LGFX_PIN_RST=-1
-D LGFX_PIN_BL=42
-D LGFX_TOUCH_INT=41
-D VIEW_320x240
-D USE_PACKET_API
-I lib/device-ui/generated/ui_320x240
-I variants/mesh-tab
build_src_filter = ${esp32_base.build_src_filter}
+<../lib/device-ui/generated/ui_320x240>
+<../lib/device-ui/resources>
+<../lib/device-ui/locale>
+<../lib/device-ui/source>
lib_deps = ${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.16
; 3.2" TN TFT ST7789 / XPT2046: https://vi.aliexpress.com/item/1005005933490544.html
[env:mesh-tab-3-2-TN-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ST7789
-D LGFX_INVERT_COLOR=false
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=3
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=60000000
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=4
; 3.2" IPS TFT ILI9341 / XPT2046: https://www.aliexpress.com/item/1005006258575617.html
[env:mesh-tab-3-2-IPS-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ILI9341
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=60000000 ; if image is distorted then lower to 40 MHz
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=4
; 3.5" IPS TFT ILI9488 / XPT2046: https://vi.aliexpress.com/item/1005006333922639.html
[env:mesh-tab-3-5-IPS-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=ILI9488
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=0
-D LGFX_TOUCH=XPT2046
-D SPI_FREQUENCY=40000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=0
; 3.5" TN TFT ILI9488 / XPT2046: https://vi.aliexpress.com/item/32985467436.html
[env:mesh-tab-3-5-TN-resistive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=HX8357B
-D SPI_FREQUENCY=60000000
-D LGFX_INVERT_COLOR=false
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=4
-D LGFX_TOUCH=XPT2046
-D LGFX_TOUCH_SPI_FREQ=2500000
-D LGFX_TOUCH_SPI_HOST=2
-D LGFX_TOUCH_CS=7
-D LGFX_TOUCH_CLK=12
-D LGFX_TOUCH_DO=11
-D LGFX_TOUCH_DIN=13
-D LGFX_TOUCH_X_MIN=300
-D LGFX_TOUCH_X_MAX=3900
-D LGFX_TOUCH_Y_MIN=400
-D LGFX_TOUCH_Y_MAX=3900
-D LGFX_TOUCH_ROTATION=2
; 3.2" IPS TFT ILI9341 / FT6236: https://vi.aliexpress.com/item/1005006624072350.html
[env:mesh-tab-3-2-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D LGFX_SCREEN_WIDTH=240
-D LGFX_SCREEN_HEIGHT=320
-D LGFX_PANEL=ILI9341
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=40000000 ; may go higher upto 60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=0
-D LGFX_TOUCH_I2C_FREQ=1000000
; 3.5" IPS TFT ILI9488 / FT6236: https://vi.aliexpress.com/item/1005006893699919.html
[env:mesh-tab-3-5-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=ILI9488
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=1
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=30000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=1
-D LGFX_TOUCH_I2C_FREQ=1000000
; 4.0" IPS TFT ILI9488 / FT6236: https://vi.aliexpress.com/item/1005007082906950.html
[env:mesh-tab-4-0-IPS-capacitive]
extends = mesh_tab_base
build_flags = ${mesh_tab_base.build_flags}
-D DISPLAY_SET_RESOLUTION
-D LGFX_SCREEN_WIDTH=320
-D LGFX_SCREEN_HEIGHT=480
-D LGFX_PANEL=HX8357B
-D LGFX_INVERT_COLOR=true
-D LGFX_RGB_ORDER=false
-D LGFX_DLEN_16BITS=false
-D LGFX_ROTATION=4
-D LGFX_TOUCH=FT5x06
-D SPI_FREQUENCY=30000000 ; may go higher upto 40/60/80 MHz
-D LGFX_TOUCH_I2C_PORT=0
-D LGFX_TOUCH_I2C_ADDR=0x38
-D LGFX_TOUCH_I2C_SDA=8
-D LGFX_TOUCH_I2C_SCL=9
-D LGFX_TOUCH_RST=7
-D LGFX_TOUCH_X_MIN=0
-D LGFX_TOUCH_X_MAX=319
-D LGFX_TOUCH_Y_MIN=0
-D LGFX_TOUCH_Y_MAX=479
-D LGFX_TOUCH_ROTATION=1
-D LGFX_TOUCH_I2C_FREQ=1000000

View File

@ -7,8 +7,8 @@
// Analog pins // Analog pins
#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
// ratio of voltage divider = 2.0 // ratio of voltage divider (100k, 220k)
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. #define ADC_MULTIPLIER 1.6 // 1.45 + 10% for correction of display undervoltage.
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL #define ADC_CHANNEL ADC1_GPIO4_CHANNEL
// LED // LED
@ -17,6 +17,9 @@
// Button // Button
#define BUTTON_PIN 0 #define BUTTON_PIN 0
// Button
#define PIN_BUZZER 5
// GPS // GPS
#define GPS_RX_PIN 18 #define GPS_RX_PIN 18
#define GPS_TX_PIN 17 #define GPS_TX_PIN 17
@ -28,20 +31,26 @@
#define SPI_CS 10 #define SPI_CS 10
#define SDCARD_CS 6 #define SDCARD_CS 6
// LORA MODULES
#define USE_SX1262
// LORA SPI // LORA SPI
#define LORA_SCK 36 #define LORA_SCK 36
#define LORA_MISO 37 #define LORA_MISO 37
#define LORA_MOSI 35 #define LORA_MOSI 35
#define LORA_CS 39 #define LORA_CS 39
// LORA MODULES
#define USE_SX1262
// LORA CONFIG // LORA CONFIG
#define LORA_DIO0 -1 // a No connect on the SX1262 module
#define LORA_RESET 14
#define LORA_DIO1 15 // SX1262 IRQ
#define LORA_DIO2 40 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262
#define SX126X_CS LORA_CS #define SX126X_CS LORA_CS
#define SX126X_DIO1 15 #define SX126X_DIO1 LORA_DIO1
#define SX126X_DIO2_AS_RF_SWITCH #define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_BUSY 40 #define SX126X_BUSY LORA_DIO2
#define SX126X_RESET 14 #define SX126X_RESET 14
#define SX126X_RXEN 47 #define SX126X_RXEN 47
#define SX126X_TXEN RADIOLIB_NC // Assuming that DIO2 is connected to TXEN pin #define SX126X_TXEN RADIOLIB_NC // Assuming that DIO2 is connected to TXEN pin