|
我使用官方gpio的程序发现,esp8266上电时IO口为高电平,经过下面的程序初始化后为低电平。之后再使用gpio_set_level方法设置电平,于是就必然有了电平的一个变化过程:高——低——设置的电平。有没有办法让io初始化后电平一直为高?不经历拉低的过程?我将o_conf.pull_up_en设置为1也没用
gpio_config_t io_conf;
//disable interrupt
io_conf.intr_type = GPIO_INTR_DISABLE;
//set as output mode
io_conf.mode = GPIO_MODE_OUTPUT;
//bit mask of the pins that you want to set,e.g.GPIO15/16
io_conf.pin_bit_mask = GPIO_OUTPUT_PIN_SEL;
//disable pull-down mode
io_conf.pull_down_en = 0;
//disable pull-up mode
io_conf.pull_up_en = 0;
//configure GPIO with the given settings
gpio_config(&io_conf);
|
|