HB, OTA etc
This commit is contained in:
20
esp32/main/gpio_init.cpp
Normal file
20
esp32/main/gpio_init.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "gpio_init.h"
|
||||
#include "hal/gpio_types.h"
|
||||
#include "driver/gpio.h"
|
||||
|
||||
#define PIN_OUT GPIO_NUM_22
|
||||
|
||||
void init_gpio()
|
||||
{
|
||||
gpio_config_t io_conf = {
|
||||
.pin_bit_mask = (1ULL << PIN_OUT),
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pull_up_en = GPIO_PULLUP_DISABLE,
|
||||
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
||||
.intr_type = GPIO_INTR_DISABLE
|
||||
};
|
||||
|
||||
gpio_config(&io_conf);
|
||||
|
||||
gpio_set_level(PIN_OUT, 1); // HIGH ≈ 3.3В
|
||||
}
|
||||
Reference in New Issue
Block a user