Code: Select all
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/dedic_gpio.html#dedicated-gpio
const int bundleA_gpios[] = {OLED_D0,OLED_D1,OLED_D2,OLED_D3,OLED_D4,OLED_D5,OLED_D6,OLED_D7};
gpio_config_t io_conf = {
.mode = GPIO_MODE_OUTPUT,
};
// Create bundleA, output only
dedic_gpio_bundle_handle_t bundleA = NULL;
dedic_gpio_bundle_config_t bundleA_config = {
.gpio_array = bundleA_gpios,
.array_size = sizeof(bundleA_gpios) / sizeof(bundleA_gpios[0]),
.flags = {
.out_en = 1,
},
};
I see there is another option for .mode = GPIO_MODE_INPUT_OUTPUT, So that is confusing me because there is not the same for .flags. The options there are:
unsigned int in_en: 1; /*!< Enable input */
unsigned int in_invert: 1; /*!< Invert input signal */
unsigned int out_en: 1; /*!< Enable output */
unsigned int out_invert: 1; /*!< Invert output signal */
Just guessing here, when I want to write I use the above and dedic_gpio_new_bundle(&bundleA_config, &bundleA));
When I want to read, I first delete it by using dedic_gpio_del_bundle(dedic_gpio_bundle_handle_t bundle);
then create a new bundle with the above but with input settings, then dedic_gpio_new_bundle(...);