File tree Expand file tree Collapse file tree 6 files changed +25
-17
lines changed
Expand file tree Collapse file tree 6 files changed +25
-17
lines changed Original file line number Diff line number Diff line change 11#include " ThinknodeM5Board.h"
22
3+ PCA9557 expander (0x18 , &Wire1);
34
45void ThinknodeM5Board::begin () {
5- pinMode (PIN_VEXT_EN, OUTPUT);
6- digitalWrite (PIN_VEXT_EN, !PIN_VEXT_EN_ACTIVE); // force power cycle
7- delay (20 ); // allow power rail to discharge
8- digitalWrite (PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // turn backlight back on
9- delay (120 ); // give display time to bias on cold boot
6+ // Start expander
7+ Wire1.begin (48 , 47 );
8+ expander.pinMode (EXP_PIN_POWER, OUTPUT); // eink
9+ expander.pinMode (EXP_PIN_BACKLIGHT, OUTPUT); // peripherals
10+ expander.pinMode (EXP_PIN_LED, OUTPUT); // peripherals
11+ expander.digitalWrite (EXP_PIN_POWER, HIGH);
12+ expander.digitalWrite (EXP_PIN_BACKLIGHT, LOW);
13+ expander.digitalWrite (EXP_PIN_LED, LOW);
14+
1015 ESP32Board::begin ();
11- // pinMode(PIN_STATUS_LED, OUTPUT); // init power led
1216 }
1317
1418 void ThinknodeM5Board::enterDeepSleep (uint32_t secs, int pin_wake_btn) {
Original file line number Diff line number Diff line change 44#include < helpers/RefCountedDigitalPin.h>
55#include < helpers/ESP32Board.h>
66#include < driver/rtc_io.h>
7+ #include < PCA9557.h>
8+
9+ extern PCA9557 expander;
710
811class ThinknodeM5Board : public ESP32Board {
912
@@ -15,4 +18,10 @@ class ThinknodeM5Board : public ESP32Board {
1518 uint16_t getBattMilliVolts () override ;
1619 const char * getManufacturerName () const override ;
1720
21+ void onBeforeTransmit () override {
22+ expander.digitalWrite (EXP_PIN_LED, HIGH); // turn TX LED on
23+ }
24+ void onAfterTransmit () override {
25+ expander.digitalWrite (EXP_PIN_LED, LOW); // turn TX LED off
26+ }
1827};
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ build_flags = ${esp32_base.build_flags}
66 -D THINKNODE_M5
77 -D GPS_RX =19
88 -D GPS_TX =20
9- -D PIN_VEXT_EN =46
109 -D PIN_BUZZER =9
11- -D PIN_VEXT_EN_ACTIVE =HIGH
1210 -D PIN_BOARD_SCL =1
1311 -D PIN_BOARD_SDA =2
12+ -D P_LORA_EN =46
1413 -D P_LORA_DIO_1 =4
1514 -D P_LORA_NSS =17
1615 -D P_LORA_RESET =6 ; RADIOLIB_NC
@@ -19,6 +18,7 @@ build_flags = ${esp32_base.build_flags}
1918 -D P_LORA_MISO =7
2019 -D P_LORA_MOSI =15
2120 -D PIN_USER_BTN =21
21+ -D EXP_PIN_LED =1
2222# -D PIN_STATUS_LED=1 ; leds are on PCA !!!
2323# -D LED_STATE_ON=HIGH
2424# -D PIN_LED=3
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ WRAPPER_CLASS radio_driver(radio, board);
1515ESP32RTCClock fallback_clock;
1616AutoDiscoverRTCClock rtc_clock (fallback_clock);
1717SensorManager sensors;
18- PCA9557 expander (0x18 , &Wire1);
1918
2019#ifdef DISPLAY_CLASS
2120 DISPLAY_CLASS display;
@@ -27,11 +26,8 @@ bool radio_init() {
2726 rtc_clock.begin (Wire);
2827// pinMode(21, INPUT);
2928// pinMode(48, OUTPUT);
30- Wire1.begin (48 , 47 );
31- expander.pinMode (4 , OUTPUT); // eink
32- expander.pinMode (5 , OUTPUT); // peripherals
33- expander.digitalWrite (4 , HIGH);
34- expander.digitalWrite (5 , HIGH);
29+ pinMode (P_LORA_EN, OUTPUT);
30+ digitalWrite (P_LORA_EN, HIGH);
3531 #if defined(P_LORA_SCLK)
3632 spi.begin (P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
3733 return radio.std_init (&spi);
Original file line number Diff line number Diff line change 1212 #include <helpers/ui/GxEPDDisplay.h>
1313 #include <helpers/ui/MomentaryButton.h>
1414#endif
15- #include <Wire.h>
16- #include <PCA9557.h>
1715
1816extern ThinknodeM5Board board ;
1917extern WRAPPER_CLASS radio_driver ;
Original file line number Diff line number Diff line change 1818#define PIN_DISPLAY_DC (40)
1919#define PIN_DISPLAY_RST (41)
2020#define PIN_DISPLAY_BUSY (42)
21- //#define DISP_BACKLIGHT (5)
21+ #define EXP_PIN_BACKLIGHT (5)
22+ #define EXP_PIN_POWER (4)
You can’t perform that action at this time.
0 commit comments