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