Skip to content

Commit 54d2f29

Browse files
committed
Merging
1 parent 7cc2a52 commit 54d2f29

File tree

6 files changed

+59
-46
lines changed

6 files changed

+59
-46
lines changed

.github/workflows/compile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
- name: ArduinoJson
4848
- name: Time
4949
sketch-paths: |
50-
${{ matrix.additional-sketch-paths }}
50+
${{ matrix.additional-sketch-paths }}

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Wake_Up_On_Touchpads/Inkplate_Wake_Up_On_Touchpads.ino

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
// Time ESP32 will go to sleep (in seconds)
2525
#define TIME_TO_SLEEP 30
2626

27+
// bitmask for GPIO_34 which is connected to MCP INTB
28+
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)
29+
2730
// Initiate Inkplate object
2831
Inkplate display(INKPLATE_1BIT);
2932

30-
byte touchPadPin = 10;
31-
3233
// Store int in rtc data, to remain persistent during deep sleep
3334
RTC_DATA_ATTR int bootCount = 0;
3435

@@ -38,21 +39,18 @@ void setup()
3839
display.begin();
3940

4041
// Setup mcp interrupts
41-
display.pinModeInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, INPUT);
4242
display.setIntOutputInternal(MCP23017_INT_ADDR, display.mcpRegsInt, 1, false, false, HIGH);
43-
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, RISING);
43+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD1, RISING);
44+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD2, RISING);
45+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD3, RISING);
4446

4547
++bootCount;
4648

4749
// Our function declared below
4850
displayInfo();
4951

50-
// Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34
51-
// Gpio 34 is where the mcp interrupt is connected, check
52-
// https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf
53-
// for more detail
52+
// Go to sleep for TIME_TO_SLEEP seconds
5453
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
55-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1);
5654

5755
// Enable wakup from deep sleep on gpio 36
5856
esp_sleep_enable_ext1_wakeup((1ULL << 36), ESP_EXT1_WAKEUP_ALL_LOW);

examples/Inkplate5/Advanced_Inkplate_Features/Inkplate_Wake_Up_On_Touchpads/Inkplate_Wake_Up_On_Touchpads.ino

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
// Time ESP32 will go to sleep (in seconds)
2525
#define TIME_TO_SLEEP 30
2626

27+
// bitmask for GPIO_34 which is connected to MCP INTB
28+
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)
29+
2730
// Initiate Inkplate object
2831
Inkplate display(INKPLATE_1BIT);
2932

30-
byte touchPadPin = 10;
31-
3233
// Store int in rtc data, to remain persistent during deep sleep
3334
RTC_DATA_ATTR int bootCount = 0;
3435

@@ -38,21 +39,18 @@ void setup()
3839
display.begin();
3940

4041
// Setup mcp interrupts
41-
display.pinModeInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, INPUT);
4242
display.setIntOutputInternal(MCP23017_INT_ADDR, display.mcpRegsInt, 1, false, false, HIGH);
43-
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, RISING);
43+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD1, RISING);
44+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD2, RISING);
45+
display.setIntPinInternal(MCP23017_INT_ADDR, display.mcpRegsInt, PAD3, RISING);
4446

4547
++bootCount;
4648

4749
// Our function declared below
4850
displayInfo();
4951

50-
// Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34
51-
// Gpio 34 is where the mcp interrupt is connected, check
52-
// https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf
53-
// for more detail
52+
// Go to sleep for TIME_TO_SLEEP seconds
5453
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
55-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1);
5654

5755
// GPIO 36 is where the wake up button is connected
5856
esp_sleep_enable_ext1_wakeup((1ULL << 36), ESP_EXT1_WAKEUP_ALL_LOW);

examples/Inkplate6/Advanced_Inkplate_Features/Inkplate_Wake_Up_On_Touchpads/Inkplate_Wake_Up_On_Touchpads.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
// Time ESP32 will go to sleep (in seconds)
2525
#define TIME_TO_SLEEP 30
2626

27+
// bitmask for GPIO_34 which is connected to MCP INTB
28+
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)
29+
2730
// Initiate Inkplate object
2831
Inkplate display(INKPLATE_1BIT);
2932

30-
byte touchPadPin = PAD1;
31-
3233
// Store int in rtc data, to remain persistent during deep sleep
3334
RTC_DATA_ATTR int bootCount = 0;
3435

@@ -47,12 +48,11 @@ void setup()
4748
// Our function declared below
4849
displayInfo();
4950

50-
// Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34
51-
// Gpio 34 is where the mcp interrupt is connected, check
52-
// https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf
53-
// for more detail
51+
// Go to sleep for TIME_TO_SLEEP seconds
5452
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
55-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1);
53+
54+
// enable wake from MCP port expander on gpio 34
55+
esp_sleep_enable_ext1_wakeup(TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);
5656

5757
// Go to sleep
5858
esp_deep_sleep_start();

examples/Inkplate6COLOR/Advanced_Inkplate_Features/Inkplate_Wake_Up_On_Touchpads/Inkplate_Wake_Up_On_Touchpads.ino

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
// Time ESP32 will go to sleep (in seconds)
2525
#define TIME_TO_SLEEP 30
2626

27+
// bitmask for GPIO_34 which is connected to MCP INTB
28+
#define TOUCHPAD_WAKE_MASK (int64_t(1)<<GPIO_NUM_34)
29+
2730
// Initiate Inkplate object
2831
Inkplate display;
2932

30-
byte touchPadPin = PAD1;
31-
3233
// Store int in rtc data, to remain persistent during deep sleep
3334
RTC_DATA_ATTR int bootCount = 0;
3435

@@ -38,24 +39,24 @@ void setup()
3839
display.begin();
3940

4041
// Setup mcp interrupts
41-
display.pinModeInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, INPUT);
4242
display.setIntOutput(1, false, false, HIGH);
43-
display.setIntPin(touchPadPin, RISING);
43+
display.setIntPin(PAD1, RISING);
44+
display.setIntPin(PAD2, RISING);
45+
display.setIntPin(PAD3, RISING);
4446

4547
++bootCount;
4648

4749
// Our function declared below
4850
displayInfo();
4951

50-
// Go to sleep for TIME_TO_SLEEP seconds, but also enable wake up from gpio 34
51-
// Gpio 34 is where the mcp interrupt is connected, check
52-
// https://github.com/e-radionicacom/Inkplate-6-hardware/blob/master/Schematics%2C%20Gerber%2C%20BOM/Inkplate6%20Schematics.pdf
53-
// for more detail
52+
// Go to sleep for TIME_TO_SLEEP seconds
5453
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
55-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 1);
5654

57-
// Enable wakup from deep sleep on gpio 36
58-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, 0);
55+
// Enable wakeup from deep sleep on gpio 36 (wake button)
56+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
57+
58+
// enable wake from MCP port expander on gpio 34
59+
esp_sleep_enable_ext1_wakeup(TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);
5960

6061
// Go to sleep
6162
esp_deep_sleep_start();

examples/Inkplate6PLUS/Advanced_Inkplate_Features/Inkplate_Wake_up_on_touchscreen/Inkplate_Wake_up_on_touchscreen.ino

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
// Time ESP32 will go to sleep (in seconds)
2626
#define TIME_TO_SLEEP 30
2727

28+
// bitmask for GPIO_34 which is connected to MCP INTB
29+
#define TOUCHPAD_WAKE_MASK (int64_t(1) << GPIO_NUM_34)
30+
2831
// Initiate Inkplate object
2932
Inkplate display(INKPLATE_1BIT);
3033

31-
byte touchPadPin = PAD1;
32-
3334
// Store int in rtc data, to remain persistent during deep sleep
3435
RTC_DATA_ATTR int bootCount = 0;
3536

@@ -39,9 +40,23 @@ void setup()
3940
display.begin();
4041

4142
// Setup mcp interrupts
42-
display.pinModeInternal(MCP23017_INT_ADDR, display.mcpRegsInt, touchPadPin, INPUT);
4343
display.setIntOutput(1, false, false, HIGH);
44-
display.setIntPin(touchPadPin, RISING);
44+
display.setIntPin(PAD1, RISING);
45+
display.setIntPin(PAD2, RISING);
46+
display.setIntPin(PAD3, RISING);
47+
48+
49+
// Init touchscreen and power it on after init (send false as argument to put it in deep sleep right after init)
50+
if (display.tsInit(true))
51+
{
52+
Serial.println("Touchscreen init ok");
53+
}
54+
else
55+
{
56+
Serial.println("Touchscreen init fail");
57+
while (true)
58+
;
59+
}
4560

4661
// Init touchscreen and power it on after init (send false as argument to put it in deep sleep right after init)
4762
if (display.tsInit(true))
@@ -60,13 +75,14 @@ void setup()
6075
// Our function declared below
6176
displayInfo();
6277

63-
// Go to sleep for TIME_TO_SLEEP seconds.
78+
// Go to sleep for TIME_TO_SLEEP seconds
6479
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
6580

66-
// Enable wake up from deep sleep on gpio 36 (wake up button and Touch INT pin), check
67-
// https://github.com/e-radionicacom/Inkplate-6PLUS-Hardware/blob/main/Schematics%2C%20Gerber%2C%20BOM/v1.0/Inkplate%206PLUS%20Schematics%20v1.0.pdf
68-
// for more detail
69-
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, 0);
81+
// Enable wakeup from deep sleep on gpio 36 (wake button)
82+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
83+
84+
// enable wake from MCP port expander on gpio 34
85+
esp_sleep_enable_ext1_wakeup(TOUCHPAD_WAKE_MASK, ESP_EXT1_WAKEUP_ANY_HIGH);
7086

7187
// Go to sleep
7288
esp_deep_sleep_start();

0 commit comments

Comments
 (0)