#include <base.h>
Definition at line 12 of file base.h.
◆ begin()
int8_t PaperdinkDeviceBaseClass::begin |
( |
| ) |
|
Definition at line 4 of file base.cpp.
5{
8 pinMode(
SD_EN, OUTPUT);
11
16
17 return 0;
18}
◆ connect_wifi() [1/2]
int8_t PaperdinkDeviceBaseClass::connect_wifi |
( |
const char * | ssid, |
|
|
const char * | password ) |
Definition at line 128 of file base.cpp.
129{
131}
int8_t connect_wifi(const char *ssid, const char *password, uint8_t attempts)
◆ connect_wifi() [2/2]
int8_t PaperdinkDeviceBaseClass::connect_wifi |
( |
const char * | ssid, |
|
|
const char * | password, |
|
|
uint8_t | attempts ) |
Definition at line 113 of file base.cpp.
114{
115 WiFi.begin(ssid, password);
116
117 while (WiFi.status() != WL_CONNECTED) {
118 delay(500);
119 Serial.print(".");
120 if (!attempts--)
121 return -1;
122 }
123 Serial.println("Connected");
124
125 return 0;
126}
◆ deep_sleep_button_wakeup()
int8_t PaperdinkDeviceBaseClass::deep_sleep_button_wakeup |
( |
uint8_t | gpio_num | ) |
|
Definition at line 86 of file base.cpp.
87{
88
90
91 esp_sleep_enable_ext0_wakeup((gpio_num_t)gpio_num, 0);
92 Serial.printf("Button wakeup on pin %d", gpio_num);
93
94 esp_deep_sleep_start();
95
96 return 0;
97}
int8_t disable_everything()
◆ deep_sleep_timer_button_wakeup()
int8_t PaperdinkDeviceBaseClass::deep_sleep_timer_button_wakeup |
( |
uint64_t | sleep_time_us, |
|
|
uint8_t | gpio_num ) |
Definition at line 99 of file base.cpp.
100{
101
103
104 esp_sleep_enable_timer_wakeup(sleep_time_us);
105 esp_sleep_enable_ext0_wakeup((gpio_num_t)gpio_num, 0);
106 Serial.printf("Timer wakeup after %lld us or button on pin %d", sleep_time_us, gpio_num);
107
108 esp_deep_sleep_start();
109
110 return 0;
111}
◆ deep_sleep_timer_wakeup()
int8_t PaperdinkDeviceBaseClass::deep_sleep_timer_wakeup |
( |
uint64_t | sleep_time_us | ) |
|
Definition at line 72 of file base.cpp.
73{
74
76
77 esp_sleep_enable_timer_wakeup(sleep_time_us);
78 Serial.printf("Timer wakeup after %lld microseconds...", sleep_time_us);
79
80
81 esp_deep_sleep_start();
82
83 return 0;
84}
◆ disable_display()
int8_t PaperdinkDeviceBaseClass::disable_display |
( |
| ) |
|
|
virtual |
◆ disable_everything()
int8_t PaperdinkDeviceBaseClass::disable_everything |
( |
| ) |
|
Definition at line 62 of file base.cpp.
63{
66
68
69 return 0;
70}
virtual int8_t disable_display()
◆ disable_sd()
int8_t PaperdinkDeviceBaseClass::disable_sd |
( |
| ) |
|
Definition at line 54 of file base.cpp.
55{
56
57 digitalWrite(
SD_EN, HIGH);
58
59 return 0;
60}
◆ enable_display()
int8_t PaperdinkDeviceBaseClass::enable_display |
( |
| ) |
|
|
virtual |
◆ enable_sd()
int8_t PaperdinkDeviceBaseClass::enable_sd |
( |
| ) |
|
Definition at line 42 of file base.cpp.
43{
44
45 digitalWrite(
SD_EN, LOW);
46 if (!SD.begin(
SD_CS)) {
47 Serial.println("SD failed!");
48 return -1;
49 }
50
51 return 0;
52}
◆ color
◆ has_color
uint8_t PaperdinkDeviceBaseClass::has_color = false |
The documentation for this class was generated from the following files: