mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-05-02 03:45:15 +00:00
thinknode_m5: tx_led
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
#include "ThinknodeM5Board.h"
|
||||
|
||||
PCA9557 expander (0x18, &Wire1);
|
||||
|
||||
void ThinknodeM5Board::begin() {
|
||||
pinMode(PIN_VEXT_EN, OUTPUT);
|
||||
digitalWrite(PIN_VEXT_EN, !PIN_VEXT_EN_ACTIVE); // force power cycle
|
||||
delay(20); // allow power rail to discharge
|
||||
digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // turn backlight back on
|
||||
delay(120); // give display time to bias on cold boot
|
||||
// Start expander
|
||||
Wire1.begin(48, 47);
|
||||
expander.pinMode(EXP_PIN_POWER, OUTPUT); // eink
|
||||
expander.pinMode(EXP_PIN_BACKLIGHT, OUTPUT); // peripherals
|
||||
expander.pinMode(EXP_PIN_LED, OUTPUT); // peripherals
|
||||
expander.digitalWrite(EXP_PIN_POWER, HIGH);
|
||||
expander.digitalWrite(EXP_PIN_BACKLIGHT, LOW);
|
||||
expander.digitalWrite(EXP_PIN_LED, LOW);
|
||||
|
||||
ESP32Board::begin();
|
||||
// pinMode(PIN_STATUS_LED, OUTPUT); // init power led
|
||||
}
|
||||
|
||||
void ThinknodeM5Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) {
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <helpers/RefCountedDigitalPin.h>
|
||||
#include <helpers/ESP32Board.h>
|
||||
#include <driver/rtc_io.h>
|
||||
#include <PCA9557.h>
|
||||
|
||||
extern PCA9557 expander;
|
||||
|
||||
class ThinknodeM5Board : public ESP32Board {
|
||||
|
||||
@@ -15,4 +18,10 @@ public:
|
||||
uint16_t getBattMilliVolts() override;
|
||||
const char* getManufacturerName() const override ;
|
||||
|
||||
void onBeforeTransmit() override {
|
||||
expander.digitalWrite(EXP_PIN_LED, HIGH); // turn TX LED on
|
||||
}
|
||||
void onAfterTransmit() override {
|
||||
expander.digitalWrite(EXP_PIN_LED, LOW); // turn TX LED off
|
||||
}
|
||||
};
|
||||
@@ -6,11 +6,10 @@ build_flags = ${esp32_base.build_flags}
|
||||
-D THINKNODE_M5
|
||||
-D GPS_RX=19
|
||||
-D GPS_TX=20
|
||||
-D PIN_VEXT_EN=46
|
||||
-D PIN_BUZZER=9
|
||||
-D PIN_VEXT_EN_ACTIVE=HIGH
|
||||
-D PIN_BOARD_SCL=1
|
||||
-D PIN_BOARD_SDA=2
|
||||
-D P_LORA_EN=46
|
||||
-D P_LORA_DIO_1=4
|
||||
-D P_LORA_NSS=17
|
||||
-D P_LORA_RESET=6 ; RADIOLIB_NC
|
||||
@@ -19,6 +18,7 @@ build_flags = ${esp32_base.build_flags}
|
||||
-D P_LORA_MISO=7
|
||||
-D P_LORA_MOSI=15
|
||||
-D PIN_USER_BTN=21
|
||||
-D EXP_PIN_LED=1
|
||||
# -D PIN_STATUS_LED=1 ; leds are on PCA !!!
|
||||
# -D LED_STATE_ON=HIGH
|
||||
# -D PIN_LED=3
|
||||
|
||||
@@ -15,7 +15,6 @@ WRAPPER_CLASS radio_driver(radio, board);
|
||||
ESP32RTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
SensorManager sensors;
|
||||
PCA9557 expander (0x18, &Wire1);
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
@@ -27,11 +26,8 @@ bool radio_init() {
|
||||
rtc_clock.begin(Wire);
|
||||
// pinMode(21, INPUT);
|
||||
// pinMode(48, OUTPUT);
|
||||
Wire1.begin(48, 47);
|
||||
expander.pinMode(4, OUTPUT); // eink
|
||||
expander.pinMode(5, OUTPUT); // peripherals
|
||||
expander.digitalWrite(4, HIGH);
|
||||
expander.digitalWrite(5, HIGH);
|
||||
pinMode(P_LORA_EN, OUTPUT);
|
||||
digitalWrite(P_LORA_EN, HIGH);
|
||||
#if defined(P_LORA_SCLK)
|
||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||
return radio.std_init(&spi);
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <helpers/ui/GxEPDDisplay.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
#include <Wire.h>
|
||||
#include <PCA9557.h>
|
||||
|
||||
extern ThinknodeM5Board board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
|
||||
@@ -18,4 +18,5 @@
|
||||
#define PIN_DISPLAY_DC (40)
|
||||
#define PIN_DISPLAY_RST (41)
|
||||
#define PIN_DISPLAY_BUSY (42)
|
||||
//#define DISP_BACKLIGHT (5)
|
||||
#define EXP_PIN_BACKLIGHT (5)
|
||||
#define EXP_PIN_POWER (4)
|
||||
Reference in New Issue
Block a user