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

hujinpeng20088
Posts: 2
Joined: Thu Oct 13, 2022 10:44 am

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

Postby hujinpeng20088 » Thu Oct 13, 2022 11:02 pm

测试代码放在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);
}

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

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

Postby ESP_morris » Fri Oct 14, 2022 10:19 am

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

hujinpeng20088
Posts: 2
Joined: Thu Oct 13, 2022 10:44 am

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

Postby hujinpeng20088 » Sun Oct 16, 2022 3:21 am

谢谢,好的,我试试,因为测试35脚刚好能用,以为是gpio引脚号

Who is online

Users browsing this forum: No registered users and 93 guests