Need some help/clarification.....please ESPIDF people.
I have a condition where after filling the required parameters to a gpio_config_t variable, specifically stating that I want a PULLUP on an Output pin, AND AND, having an external pull up resistor 1K (for good measure in case the pin does not have a pull-up), when the call is made to the gpio_config(&io_conf) the pin goes immediately LOW. No gpio_set_level() call yet.
Code: Select all
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_rom_gpio.h"
void wait(char *title)
{
printf("%s Ready\n",title);
vTaskDelay(4000 / portTICK_PERIOD_MS);
printf("Done\n");
}
void app_main(void)
{
//zero-initialize the config structure.
// wait("Start");
// esp_rom_gpio_pad_select_gpio((gpio_num_t)14);
// wait("PadSelect");
// gpio_reset_pin((gpio_num_t)32);
// wait("ResetPIN");
// gpio_set_pull_mode((gpio_num_t)14,GPIO_PULLUP_ONLY);
// wait("SetPULLUP");
// gpio_set_direction((gpio_num_t)14, GPIO_MODE_OUTPUT);
// wait("SetDirection");
gpio_config_t io_conf = {};
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL<<32) ;
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 1;
wait("gpioConfig");
gpio_config(&io_conf);
while(true)
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
So I though the gpio_config() had something wrong....
Did a rom gpio programming (commented section) and put a "stepper x seconds" to see WHEN the pin goes LOW, it happens when you set the Direction.
WHY???? I need it to be HIGH on configuration (actually to do NOTHING).
Any help would be appreciated. CANNOT have that pin go LOW without my control a BOMB goes off even if 2 ms low time.
The solution would be to add Hardware, NPN transistor switch and activate on HIGH, but that is soooo lame...
RSN