Page 1 of 1

ESP32S3 GPIO36配置成Dedicated 写入值后没有输出信号

Posted: Thu Oct 13, 2022 11:02 pm
by hujinpeng20088
测试代码放在main文件中的:
const int lcd_data_gpios[] = {36};
gpio_config_t io_conf = {
.mode = GPIO_MODE_OUTPUT,
};
for (int i = 0; i < sizeof(lcd_data_gpios) / sizeof(lcd_data_gpios[0]); i++) {
io_conf.pin_bit_mask = 1ULL << lcd_data_gpios;
gpio_config(&io_conf);
}
// Create bundleA, output only
dedic_gpio_bundle_config_t lcd_bundle_config = {
.gpio_array = lcd_data_gpios,
.array_size = sizeof(lcd_data_gpios) / sizeof(lcd_data_gpios[0]),
.flags = {
.out_en = 1,
},
};
ESP_ERROR_CHECK(dedic_gpio_new_bundle(&lcd_bundle_config, &lcd_bundle));
while(1)
{
dedic_gpio_bundle_write(lcd_bundle,36,0);
dedic_gpio_bundle_write(lcd_bundle,36,1);
vTaskDelay(1);
}

Re: ESP32S3 GPIO36配置成Dedicated 写入值后没有输出信号

Posted: Fri Oct 14, 2022 10:19 am
by ESP_morris
看这个write函数的第二个参数:mask – [in] Mask of the GPIOs to be written in the given bundle, 指的是你要操作的gpio在这个bundle中的位置,不是实际的gpio号了。你应该试试传0x01

Re: ESP32S3 GPIO36配置成Dedicated 写入值后没有输出信号

Posted: Sun Oct 16, 2022 3:21 am
by hujinpeng20088
谢谢,好的,我试试,因为测试35脚刚好能用,以为是gpio引脚号