MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / powerOn

Function powerOn

Devices/lilygo-thmi/Source/Init.cpp:10–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#define TAG "thmi"
9
10static bool powerOn() {
11 gpio_config_t power_signal_config = {
12 .pin_bit_mask = (1ULL << THMI_POWERON_GPIO) | (1ULL << THMI_POWEREN_GPIO),
13 .mode = GPIO_MODE_OUTPUT,
14 .pull_up_en = GPIO_PULLUP_DISABLE,
15 .pull_down_en = GPIO_PULLDOWN_DISABLE,
16 .intr_type = GPIO_INTR_DISABLE,
17 };
18
19 if (gpio_config(&power_signal_config) != ESP_OK) {
20 return false;
21 }
22
23 if (gpio_set_level(THMI_POWERON_GPIO, 1) != ESP_OK) {
24 return false;
25 }
26
27 if (gpio_set_level(THMI_POWEREN_GPIO, 1) != ESP_OK) {
28 return false;
29 }
30
31 return true;
32}
33
34bool initBoot() {
35 ESP_LOGI(TAG, "Powering on the board...");

Callers 2

initBootFunction · 0.70
Bq25896Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected