ESP32S3 GPIO36配置成Dedicated 写入值后没有输出信号
Posted: 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);
}
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);
}
Code: Select all