From b1f6ff1280f45a27eb365ced0c6b966a354c3079 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Sat, 5 Aug 2023 17:10:00 +0200 Subject: [PATCH] Update variant.h --- variants/m5stack_coreink/variant.h | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/variants/m5stack_coreink/variant.h b/variants/m5stack_coreink/variant.h index 3abf16be7..703fce624 100644 --- a/variants/m5stack_coreink/variant.h +++ b/variants/m5stack_coreink/variant.h @@ -39,7 +39,9 @@ #undef RF95_MOSI #undef RF95_NSS #define USE_RF95 +//#define USE_SX1280 +#ifdef USE_RF95 #define RF95_SCK 18 #define RF95_MISO 34 #define RF95_MOSI 23 @@ -48,6 +50,22 @@ #define LORA_RESET 26 #define LORA_DIO1 RADIOLIB_NC #define LORA_DIO2 RADIOLIB_NC +#endif + +#ifdef USE_SX1280 +#define RF95_SCK 18 +#define RF95_MISO 34 +#define RF95_MOSI 23 +#define RF95_NSS 14 +#define LORA_RESET 26 +#define LORA_DIO1 25 +#define LORA_DIO2 13 +#define SX128X_CS RF95_NSS +#define SX128X_DIO1 LORA_DIO1 +#define SX128X_BUSY LORA_DIO2 +#define SX128X_RESET LORA_RESET +#define SX128X_MAX_POWER 13 // 10 +#endif #define USE_EINK // https://docs.m5stack.com/en/core/coreink @@ -59,3 +77,18 @@ #define PIN_EINK_RES -1 // Connected but not needed #define PIN_EINK_SCLK 18 // EPD_SCLK #define PIN_EINK_MOSI 23 // EPD_MOSI + +#define BATTERY_PIN 35 +#define ADC_CHANNEL ADC1_GPIO35_CHANNEL +// https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/schematic/Core/m5paper/M5_PAPER_SCH.pdf +// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58 +// VBAT +// | +// R83 (3K) +// + +// R86 (11K) +// | +// GND +// https://github.com/m5stack/M5Core-Ink/blob/master/examples/Basics/FactoryTest/FactoryTest.ino#L58 +#define ADC_MULTIPLIER 5 // Just a guess for now... more detailed getBatVoltage above + // https://embeddedexplorer.com/esp32-adc-esp-idf-tutorial/