Add CircutMess Chatter 2 (#3125)

* Add Chatter 2 default_envs

* Add Chatter 2 to varients

* Add Chatter 2 specific code to esp32 platform code

* Parameterize TFT_INVERT for Chatter 2 and specify setRotation to 1

* Fix formatting to make Trunk happy

* Remove commented out #define USE_LCC68

* Fix formatting again

* Add chatter2 to the CI matrix

---------

Co-authored-by: code8buster <20384924+code8buster@users.noreply.github.com>
pull/3133/head^2
Ken McGuire 2024-01-26 07:40:16 -07:00 zatwierdzone przez GitHub
rodzic d6fa190025
commit ac9c5f81b9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
7 zmienionych plików z 146 dodań i 6 usunięć

Wyświetl plik

@ -79,6 +79,7 @@ jobs:
- board: m5stack-core - board: m5stack-core
- board: m5stack-coreink - board: m5stack-coreink
- board: nano-g1-explorer - board: nano-g1-explorer
- board: chatter2
uses: ./.github/workflows/build_esp32.yml uses: ./.github/workflows/build_esp32.yml
with: with:
board: ${{ matrix.board }} board: ${{ matrix.board }}

Wyświetl plik

@ -10,6 +10,7 @@ default_envs = tbeam
;default_envs = heltec-v2_0 ;default_envs = heltec-v2_0
;default_envs = heltec-v2_1 ;default_envs = heltec-v2_1
;default_envs = heltec-wireless-tracker ;default_envs = heltec-wireless-tracker
;default_envs = chatter2
;default_envs = tlora-v1 ;default_envs = tlora-v1
;default_envs = tlora_v1_3 ;default_envs = tlora_v1_3
;default_envs = tlora-v2 ;default_envs = tlora-v2

Wyświetl plik

@ -19,6 +19,10 @@
#define TFT_BL ST7735_BACKLIGHT_EN #define TFT_BL ST7735_BACKLIGHT_EN
#endif #endif
#ifndef TFT_INVERT
#define TFT_INVERT true
#endif
class LGFX : public lgfx::LGFX_Device class LGFX : public lgfx::LGFX_Device
{ {
lgfx::Panel_ST7735S _panel_instance; lgfx::Panel_ST7735S _panel_instance;
@ -68,7 +72,7 @@ class LGFX : public lgfx::LGFX_Device
cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout cfg.dummy_read_pixel = 8; // Number of bits for dummy read before pixel readout
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
cfg.readable = true; // Set to true if data can be read cfg.readable = true; // Set to true if data can be read
cfg.invert = true; // Set to true if the light/darkness of the panel is reversed cfg.invert = TFT_INVERT; // Set to true if the light/darkness of the panel is reversed
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
cfg.dlen_16bit = cfg.dlen_16bit =
false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI
@ -598,7 +602,7 @@ bool TFTDisplay::connect()
tft->setRotation(1); tft->setRotation(1);
tft->setSwapBytes(true); tft->setSwapBytes(true);
// tft->fillScreen(TFT_BLACK); // tft->fillScreen(TFT_BLACK);
#elif defined(T_DECK) || defined(PICOMPUTER_S3) #elif defined(T_DECK) || defined(PICOMPUTER_S3) || defined(CHATTER_2)
tft->setRotation(1); // T-Deck has the TFT in landscape tft->setRotation(1); // T-Deck has the TFT in landscape
#elif defined(T_WATCH_S3) #elif defined(T_WATCH_S3)
tft->setRotation(2); // T-Watch S3 left-handed orientation tft->setRotation(2); // T-Watch S3 left-handed orientation

Wyświetl plik

@ -125,6 +125,8 @@
#define HW_VENDOR meshtastic_HardwareModel_SENSELORA_S3 #define HW_VENDOR meshtastic_HardwareModel_SENSELORA_S3
#elif defined(HELTEC_HT62) #elif defined(HELTEC_HT62)
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_HT62 #define HW_VENDOR meshtastic_HardwareModel_HELTEC_HT62
#elif defined(CHATTER_2)
#define HW_VENDOR meshtastic_HardwareModel_CHATTER_2
#endif #endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

Wyświetl plik

@ -175,7 +175,8 @@ void cpuDeepSleep(uint32_t msecToWake)
some current will flow through these external and internal resistors, increasing deep some current will flow through these external and internal resistors, increasing deep
sleep current above the minimal possible value. sleep current above the minimal possible value.
Note: we don't isolate pins that are used for the LORA, LED, i2c, spi or the wake button Note: we don't isolate pins that are used for the LORA, LED, i2c, or ST7735 Display for the Chatter2, spi or the wake
button(s), maybe we should not include any other GPIOs...
*/ */
#if SOC_RTCIO_HOLD_SUPPORTED #if SOC_RTCIO_HOLD_SUPPORTED
static const uint8_t rtcGpios[] = {/* 0, */ 2, static const uint8_t rtcGpios[] = {/* 0, */ 2,
@ -184,9 +185,9 @@ void cpuDeepSleep(uint32_t msecToWake)
13, 13,
/* 14, */ /* 15, */ /* 14, */ /* 15, */
#endif #endif
/* 25, */ 26, /* 27, */ /* 25, */ /* 26, */ /* 27, */
32, 33, 34, 35, /* 32, */ /* 33, */ 34, 35,
36, 37 /* 36, */ 37
/* 38, 39 */}; /* 38, 39 */};
for (int i = 0; i < sizeof(rtcGpios); i++) for (int i = 0; i < sizeof(rtcGpios); i++)

Wyświetl plik

@ -0,0 +1,13 @@
; CircuitMess Chatter 2 based on ESP32-WROOM-32 (38 pins) devkit & DeeamLNK DL-LLCC68 or Heltec HT RA62 SX1262/SX1268 module
[env:chatter2]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
build_flags =
${esp32_base.build_flags}
-D CHATTER_2
-I variants/chatter2
lib_deps =
${esp32_base.lib_deps}
lovyan03/LovyanGFX@^1.1.8

Wyświetl plik

@ -0,0 +1,118 @@
//////////////////////////////////////////////////////////////////////////////////
// //
// Have custom connections or functionality? Configure them in this section //
// //
//////////////////////////////////////////////////////////////////////////////////
// Debugging
// #define GPS_DEBUG
// #define GPS_EXTRAVERBOSE
// Lora
#define USE_LLCC68 // Original Chatter2 with LLCC68 module
#define USE_SX1262 // Added for when Lora module is swapped for HT-RA62
#define SX126X_CS 14 // module's NSS pin
#define LORA_SCK 16 // module's SCK pin
#define LORA_MOSI 5 // module's MOSI pin
#define LORA_MISO 17 // module's MISO pin
#define SX126X_RESET RADIOLIB_NC // module's NRST pin
#define SX126X_BUSY 4 // module's BUSY pin works for both LLCC68 and RA-62 with cut & jumper
#define SX126X_DIO1 18 // module's DIO1 pin
#define SX126X_DIO2_AS_RF_SWITCH // module's DIO2 pin
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // module's DIO pin
#define SX126X_TXEN RADIOLIB_NC
#define SX126X_RXEN RADIOLIB_NC
// Status
// #define LED_PIN 1
// External notification
// FIXME: Check if EXT_NOTIFY_OUT actualy has any effect and removes the need for setting the external notication pin in the
// app/preferences
// #define EXT_NOTIFY_OUT 2 // The GPIO pin that acts as the external notification output (here we connect an LED to it)
// Buzzer
#define PIN_BUZZER 19
// Buttons
#define BUTTON_PIN 36 // Use the WAKE button as the user button
// I2C
// #define I2C_SCL 27
// #define I2C_SDA 26
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice
// Display
#define HAS_SCREEN 1 // Assume no screen present by default to prevent crash...
// ST7735S TFT LCD
#define ST7735S 1 // there are different (sub-)versions of ST7735
#define ST7735_CS -1
#define ST7735_RS 33 // DC
#define ST7735_SDA 26 // MOSI
#define ST7735_SCK 27
#define ST7735_RESET 15
#define ST7735_MISO -1
#define ST7735_BUSY -1
#define ST7735_BL 32
#define ST7735_SPI_HOST HSPI_HOST // SPI2_HOST for S3, auto may work too
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 16000000
#define TFT_HEIGHT 160
#define TFT_WIDTH 128
#define TFT_OFFSET_X 0
#define TFT_OFFSET_Y 0
#define TFT_INVERT false
#define SCREEN_ROTATE
#define SCREEN_TRANSITION_FRAMERATE 5 // fps
#define DISPLAY_FORCE_SMALL_FONTS
// Battery
#define BATTERY_PIN 34 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO34_CHANNEL
#define ADC_ATTENUATION \
ADC_ATTEN_DB_2_5 // 2_5-> 100mv-1250mv, 11-> 150mv-3100mv for ESP32
// ESP32-S2/C3/S3 are different
// lower dB for lower voltage rnage
#define ADC_MULTIPLIER \
5.0 // VBATT---10k--pin34---2.5K---GND
// Chatter2 uses 3 AAA cells
#define BAT_FULLVOLT 4800 // with the 5.0 divider, input to BATTERY_PIN is 900mv
#define BAT_EMPTYVOLT 3300
#undef EXT_PWR_DETECT
// GPS
// FIXME: unsure what to define HAS_GPS as if GPS isn't always present
#define HAS_GPS 1 // Don't need to set this to 0 to prevent a crash as it doesn't crash if GPS not found, will probe by default
// #define PIN_GPS_EN 15
// #define GPS_EN_ACTIVE 1
#undef GPS_TX_PIN
#undef GPS_RX_PIN
#define GPS_TX_PIN 13
#define GPS_RX_PIN 2
/////////////////////////////////////////////////////////////////////////////////
// //
// You should have no need to modify the code below, nor in pins_arduino.h //
// //
/////////////////////////////////////////////////////////////////////////////////
#define LORA_CS SX126X_CS // FIXME: for some reason both are used in /src
// Many of the below values would only be used if USE_RF95 was defined, but it's not as we aren't actually using an RF95, just
// that the 4 pins above are named like it If they aren't used they don't need to be defined and doing so cause confusion to those
// adapting this file LORA_RESET value is never used in src (as we are not using RF95), so no need to define LORA_DIO0 is not used
// in src (as we are not using RF95) as SX1262 does not have it per SX1262 datasheet, so no need to define
// FIXME: confirm that the linked lines below are actually only called when using the SX126x or SX128x and no other modules
// then use SX126X_DIO1 and SX128X_DIO1 respectively for that purpose, removing the need for RF95-style LORA_* definitions when
// the RF95 isn't used
#define LORA_DIO1 \
SX126X_DIO1 // The old name is used in
// https://github.com/meshtastic/firmware/blob/7eff5e7bcb2084499b723c5e3846c15ee089e36d/src/sleep.cpp#L298, so
// must also define the old name
// LORA_DIO2 value is never used in src (as we are not using RF95), so no need to define, and if DIO2_AS_RF_SWITCH is set then it
// cannot serve any extra function even if requested to LORA_DIO3 value is never used in src (as we are not using RF95), so no
// need to define, and DIO3_AS_TCXO_AT_1V8 is set so it cannot serve any extra function even if requested to (from 13.3.2.1
// DioxMask in SX1262 datasheet: Note that if DIO2 or DIO3 are used to control the RF Switch or the TCXO, the IRQ will not be
// generated even if it is mapped to the pins.)