lay groundwork for a possible future architecture (#1571)

* lay groundwork for a possible future architecture

* switch from feature opt-out to feature opt-in

* lay groundwork for a possible future architecture

* switch from feature opt-out to feature opt-in

* fix USE_RTC in variant.h for rak4631_epaper and t-echo

* ensure Screen.h is not included without configuration.h

Co-authored-by: Peter Lawrence <12226419+majbthrd@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
majbthrd
2022-07-31 07:11:47 -05:00
committed by GitHub
parent fd27a814b7
commit ade32b1827
53 changed files with 405 additions and 330 deletions

99
src/esp32/architecture.h Normal file
View File

@@ -0,0 +1,99 @@
#pragma once
#define ARCH_ESP32
//
// defaults for ESP32 architecture
//
#ifndef HAS_WIFI
#define HAS_WIFI 1
#endif
#ifndef HAS_SCREEN
#define HAS_SCREEN 1
#endif
#ifndef HAS_WIRE
#define HAS_WIRE 1
#endif
#ifndef HAS_GPS
#define HAS_GPS 1
#endif
#ifndef HAS_BUTTON
#define HAS_BUTTON 1
#endif
#ifndef HAS_TELEMETRY
#define HAS_TELEMETRY 1
#endif
#ifndef HAS_RADIO
#define HAS_RADIO 1
#endif
#ifndef HAS_RTC
#define HAS_RTC 1
#endif
//
// set HW_VENDOR
//
// This string must exactly match the case used in release file names or the android updater won't work
#if defined(TBEAM_V10)
#define HW_VENDOR HardwareModel_TBEAM
#elif defined(TBEAM_V07)
#define HW_VENDOR HardwareModel_TBEAM0p7
#elif defined(DIY_V1)
#define HW_VENDOR HardwareModel_DIY_V1
#elif defined(RAK_11200)
#define HW_VENDOR HardwareModel_RAK11200
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
#ifdef HELTEC_V2_0
#define HW_VENDOR HardwareModel_HELTEC_V2_0
#endif
#ifdef HELTEC_V2_1
#define HW_VENDOR HardwareModel_HELTEC_V2_1
#endif
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32)
#define HW_VENDOR HardwareModel_HELTEC_V1
#elif defined(TLORA_V1)
#define HW_VENDOR HardwareModel_TLORA_V1
#elif defined(TLORA_V2)
#define HW_VENDOR HardwareModel_TLORA_V2
#elif defined(TLORA_V1_3)
#define HW_VENDOR HardwareModel_TLORA_V1_1p3
#elif defined(TLORA_V2_1_16)
#define HW_VENDOR HardwareModel_TLORA_V2_1_1p6
#elif defined(GENIEBLOCKS)
#define HW_VENDOR HardwareModel_GENIEBLOCKS
#elif defined(PRIVATE_HW)
#define HW_VENDOR HardwareModel_PRIVATE_HW
#elif defined(NANO_G1)
#define HW_VENDOR HardwareModel_NANO_G1
#elif defined(M5STACK)
#define HW_VENDOR HardwareModel_M5STACK
#endif
//
// Standard definitions for ESP32 targets
//
#define GPS_SERIAL_NUM 1
#define GPS_RX_PIN 34
#ifdef USE_JTAG
#define GPS_TX_PIN -1
#else
#define GPS_TX_PIN 12
#endif
// -----------------------------------------------------------------------------
// LoRa SPI
// -----------------------------------------------------------------------------
// NRF52 boards will define this in variant.h
#ifndef RF95_SCK
#define RF95_SCK 5
#define RF95_MISO 19
#define RF95_MOSI 27
#define RF95_NSS 18
#endif
#define SERIAL0_RX_GPIO 3 // Always GPIO3 on ESP32