Files
iot_skeleton/esp32/main/gpio_init.cpp
2026-04-22 20:11:55 +03:00

20 lines
457 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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В
}