mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
thinknode_m5: add pca9557 expander
This commit is contained in:
parent
d0f6def4f9
commit
24edd3cf20
5 changed files with 17 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#include "ThinknodeM5Board.h"
|
||||
|
||||
|
||||
|
||||
void ThinknodeM5Board::begin() {
|
||||
pinMode(PIN_VEXT_EN, OUTPUT);
|
||||
digitalWrite(PIN_VEXT_EN, !PIN_VEXT_EN_ACTIVE); // force power cycle
|
||||
|
|
@ -9,7 +8,7 @@ void ThinknodeM5Board::begin() {
|
|||
digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // turn backlight back on
|
||||
delay(120); // give display time to bias on cold boot
|
||||
ESP32Board::begin();
|
||||
pinMode(PIN_STATUS_LED, OUTPUT); // init power led
|
||||
// pinMode(PIN_STATUS_LED, OUTPUT); // init power led
|
||||
}
|
||||
|
||||
void ThinknodeM5Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ build_flags = ${esp32_base.build_flags}
|
|||
-D P_LORA_MISO=7
|
||||
-D P_LORA_MOSI=15
|
||||
-D PIN_USER_BTN=21
|
||||
-D PIN_STATUS_LED=1
|
||||
-D LED_STATE_ON=HIGH
|
||||
-D PIN_LED=3
|
||||
# -D PIN_STATUS_LED=1 ; leds are on PCA !!!
|
||||
# -D LED_STATE_ON=HIGH
|
||||
# -D PIN_LED=3
|
||||
-D DISPLAY_ROTATION=4
|
||||
-D DISPLAY_CLASS=GxEPDDisplay
|
||||
-D EINK_DISPLAY_MODEL=GxEPD2_154_D67
|
||||
|
|
@ -45,6 +45,7 @@ build_src_filter = ${esp32_base.build_src_filter}
|
|||
lib_deps = ${esp32_base.lib_deps}
|
||||
zinggjm/GxEPD2 @ 1.6.2
|
||||
bakercp/CRC32 @ ^2.0.0
|
||||
maxpromer/PCA9557-arduino
|
||||
|
||||
[env:ThinkNode_M5_Repeater]
|
||||
extends = ThinkNode_M5
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ 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;
|
||||
|
|
@ -26,6 +27,11 @@ 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);
|
||||
#if defined(P_LORA_SCLK)
|
||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||
return radio.std_init(&spi);
|
||||
|
|
|
|||
|
|
@ -12,11 +12,14 @@
|
|||
#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;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern SensorManager sensors;
|
||||
extern PCA9557 expander;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
#define PIN_VEXT_EN_ACTIVE HIGH
|
||||
#define PIN_VEXT_EN 46
|
||||
#define PIN_USER_BTN 21
|
||||
#define PIN_LED 3
|
||||
#define PIN_STATUS_LED 1
|
||||
//#define PIN_LED 3
|
||||
//#define PIN_STATUS_LED 1
|
||||
#define PIN_PWRBTN 14
|
||||
|
||||
#define PIN_DISPLAY_MISO (-1)
|
||||
|
|
@ -18,4 +18,4 @@
|
|||
#define PIN_DISPLAY_DC (40)
|
||||
#define PIN_DISPLAY_RST (41)
|
||||
#define PIN_DISPLAY_BUSY (42)
|
||||
#define DISP_BACKLIGHT (5)
|
||||
//#define DISP_BACKLIGHT (5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue