I am doing some development wok on the Pico RP2040 but am finding the GPIOs a bit unpredictable to deal with. When you set GPIO pins as output with gpio_set_dir_out_masked, it will set outputs for bit value of 1, but what does it do with zero bits? Will they be ignored or will they be set as inputs?
I am trying to understand whether I need set both gpio_set_dir_out_masked and gpio_set_dir_in_masked to set inputs and outputs seperately, or whether just using one of them will suffice? Also, when switching from inputs to outputs, do pullups or pulldowns need to be disabled explicitly or do they get reset automatically? Or does one have to use gpio_init_mask first?
I am finding that after using gpio_init_mask to initialize pins for GPIO, if I fist set them as inputs with pullups (gpio_set_dir_in_masked, gpio_pull_up) and then switching them to outputs (gpio_set_dir_in_masked) they don't seem to work as outputs.
I am trying to understand whether I need set both gpio_set_dir_out_masked and gpio_set_dir_in_masked to set inputs and outputs seperately, or whether just using one of them will suffice? Also, when switching from inputs to outputs, do pullups or pulldowns need to be disabled explicitly or do they get reset automatically? Or does one have to use gpio_init_mask first?
I am finding that after using gpio_init_mask to initialize pins for GPIO, if I fist set them as inputs with pullups (gpio_set_dir_in_masked, gpio_pull_up) and then switching them to outputs (gpio_set_dir_in_masked) they don't seem to work as outputs.
Statistics: Posted by FruityNutPi — Wed Oct 23, 2024 12:20 pm