modify directional registers.
Posted: Sat Jun 22, 2024 2:29 pm
I want to to modify a register to get the same results as
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT);
I was trying GPIO.enable_w1tc = ((uint32_t)1 << 1); but its not working.
code
// configure GPIO
gpio_config_t io_conf;
const int bundleA_gpios[] = {0,1,2};
for (int i = 0; i < sizeof(bundleA_gpios) / sizeof(bundleA_gpios[0]); i++)
{
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL<<i);
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
gpio_config(&io_conf);
}
// 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,
},
};
(dedic_gpio_new_bundle(&bundleA_config, &bundleA));
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT);
//GPIO.enable_w1tc = ((uint32_t)1 << 1);
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT);
I was trying GPIO.enable_w1tc = ((uint32_t)1 << 1); but its not working.
code
// configure GPIO
gpio_config_t io_conf;
const int bundleA_gpios[] = {0,1,2};
for (int i = 0; i < sizeof(bundleA_gpios) / sizeof(bundleA_gpios[0]); i++)
{
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL<<i);
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
gpio_config(&io_conf);
}
// 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,
},
};
(dedic_gpio_new_bundle(&bundleA_config, &bundleA));
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT);
//GPIO.enable_w1tc = ((uint32_t)1 << 1);