]> git.tnoah.ca Git - lora-radio.git/commitdiff
Seeed ESP32S3 - Enable user button, tied to yellow LED on
authorKevin Brosius <cobra@compuserve.com>
Sun, 23 Feb 2025 21:57:36 +0000 (16:57 -0500)
committerKevin Brosius <cobra@compuserve.com>
Sun, 23 Feb 2025 21:57:36 +0000 (16:57 -0500)
ESP32S3 board.  Can be shared, but configure as button
input only for now.  Top LED for TX indication.

Boards.h
Utilities.h

index 8ba926c67ba48c447f114518a5c40c8eb1a495de..112d2c9c6efa9b8c4bfd3374fc02e12c27b40cf7 100644 (file)
--- a/Boards.h
+++ b/Boards.h
 
 // test build - KJB
 #define BOARD_MODEL BOARD_SEEED_XIAO_ESP32S3
+//#define BOARD_MODEL BOARD_HELTEC32_V3
 
   #define HAS_DISPLAY false
   #define HAS_BLUETOOTH false
       #define HAS_SD false
       #define HAS_EEPROM true
 
-      #define HAS_INPUT false
+      #define HAS_INPUT true
       #define HAS_SLEEP false
       
 //      #define PMU_IRQ 40
 //      #define I2C_SCL 41
 //      #define I2C_SDA 42
 
-      const int pin_btn_usr1 = 0;
+      // Wio-SX1262 button pulls down GPIO21
+      // THis is shared with the Yellow LED
+      // on the ESP32S3 (also active Low)
+      const int pin_btn_usr1 = 21;
 
       const int pin_cs = 41; //16;
       const int pin_reset = 42; //14;
 
 //      const int IMU_CS = 34;
 
-      // HAS LED/tx on board - 47
+      // HAS LED/tx on Wio board - 48 Hi/ON
+      // LED 21 on ESP board - Lo/ON/Yellow
+      // shared with button input.
       #if HAS_NP == false
         #if defined(EXTERNAL_LEDS)
           const int pin_led_rx = -1;
index a9154e47ec200eb7283c97b457be20a249038520..7ec1941c86e8f46118446eb26e1d1e88b2a779e9 100644 (file)
@@ -286,10 +286,14 @@ uint8_t boot_vector = 0x00;
                void led_id_on()  { }
                void led_id_off() { }
   #elif BOARD_MODEL == BOARD_SEEED_XIAO_ESP32S3
-               void led_rx_on()  { digitalWrite(pin_led_rx, LED_ON); }
-               void led_rx_off() { digitalWrite(pin_led_rx, LED_OFF); }
-               void led_tx_on()  { }
-               void led_tx_off() { }
+    // tx pin is active high, rx pin is active low....
+    // but shared with LED, choose button for now
+//             void led_rx_on()  { pinMode(pin_led_rx, OUTPUT); digitalWrite(pin_led_rx, LOW); }
+//             void led_rx_off() { digitalWrite(pin_led_rx, HIGH); pinMode(pin_led_rx, INPUT);  }
+               void led_rx_on()  { }
+               void led_rx_off() { }
+               void led_tx_on()  { digitalWrite(pin_led_tx, LED_ON); }
+               void led_tx_off() { digitalWrite(pin_led_tx, LED_OFF); }
                void led_id_on()  { }
                void led_id_off() { }
        #elif BOARD_MODEL == BOARD_HUZZAH32