thinknode_m5: add pca9557 expander
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
#include "ThinknodeM5Board.h"
|
#include "ThinknodeM5Board.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ThinknodeM5Board::begin() {
|
void ThinknodeM5Board::begin() {
|
||||||
pinMode(PIN_VEXT_EN, OUTPUT);
|
pinMode(PIN_VEXT_EN, OUTPUT);
|
||||||
digitalWrite(PIN_VEXT_EN, !PIN_VEXT_EN_ACTIVE); // force power cycle
|
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
|
digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // turn backlight back on
|
||||||
delay(120); // give display time to bias on cold boot
|
delay(120); // give display time to bias on cold boot
|
||||||
ESP32Board::begin();
|
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) {
|
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_MISO=7
|
||||||
-D P_LORA_MOSI=15
|
-D P_LORA_MOSI=15
|
||||||
-D PIN_USER_BTN=21
|
-D PIN_USER_BTN=21
|
||||||
-D PIN_STATUS_LED=1
|
# -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
|
||||||
-D DISPLAY_ROTATION=4
|
-D DISPLAY_ROTATION=4
|
||||||
-D DISPLAY_CLASS=GxEPDDisplay
|
-D DISPLAY_CLASS=GxEPDDisplay
|
||||||
-D EINK_DISPLAY_MODEL=GxEPD2_154_D67
|
-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}
|
lib_deps = ${esp32_base.lib_deps}
|
||||||
zinggjm/GxEPD2 @ 1.6.2
|
zinggjm/GxEPD2 @ 1.6.2
|
||||||
bakercp/CRC32 @ ^2.0.0
|
bakercp/CRC32 @ ^2.0.0
|
||||||
|
maxpromer/PCA9557-arduino
|
||||||
|
|
||||||
[env:ThinkNode_M5_Repeater]
|
[env:ThinkNode_M5_Repeater]
|
||||||
extends = ThinkNode_M5
|
extends = ThinkNode_M5
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ 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;
|
||||||
@@ -26,6 +27,11 @@ 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);
|
||||||
|
expander.pinMode(4, OUTPUT); // eink
|
||||||
|
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,11 +12,14 @@
|
|||||||
#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;
|
||||||
extern AutoDiscoverRTCClock rtc_clock;
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
extern SensorManager sensors;
|
extern SensorManager sensors;
|
||||||
|
extern PCA9557 expander;
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
extern DISPLAY_CLASS display;
|
extern DISPLAY_CLASS display;
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
#define PIN_VEXT_EN_ACTIVE HIGH
|
#define PIN_VEXT_EN_ACTIVE HIGH
|
||||||
#define PIN_VEXT_EN 46
|
#define PIN_VEXT_EN 46
|
||||||
#define PIN_USER_BTN 21
|
#define PIN_USER_BTN 21
|
||||||
#define PIN_LED 3
|
//#define PIN_LED 3
|
||||||
#define PIN_STATUS_LED 1
|
//#define PIN_STATUS_LED 1
|
||||||
#define PIN_PWRBTN 14
|
#define PIN_PWRBTN 14
|
||||||
|
|
||||||
#define PIN_DISPLAY_MISO (-1)
|
#define PIN_DISPLAY_MISO (-1)
|
||||||
@@ -18,4 +18,4 @@
|
|||||||
#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 DISP_BACKLIGHT (5)
|
||||||
Reference in New Issue
Block a user