I could not find anywhere how to define GRIO's 32-39 using macros. This is how I thought it could be done:
Code: Select all
REG_WRITE(GPIO_IN1_REG, BIT34);
Code: Select all
#define GPIO_SEL_34 ((uint64_t)(((uint64_t)1)<<34))
Thanks!
Adam
Code: Select all
REG_WRITE(GPIO_IN1_REG, BIT34);
Code: Select all
#define GPIO_SEL_34 ((uint64_t)(((uint64_t)1)<<34))
Hi ESP_igrr, thank you for the reply.ESP_igrr wrote: ↑Wed May 20, 2020 9:39 amHi insanoff,
The bits of GPIO_IN_REG map to GPIOs 0-31, and the bits of GPIO_IN1_REG map to GPIOs 32 and up. So to access GPIO32, you need to read bit 0 of GPIO_IN1_REG. Same applies to other GPIO-related registers (output, output enable, etc).
GPIO_SEL_34 macro in gpio.h is useful mainly for the pin_bit_mask member of gpio_config_t structure — it is a 64 bit bit mask which can be used for all GPIOs. If you are not using the GPIO driver and controlling GPIOs directly instead, you don't need to use GPIO_SEL_xx macros.
Users browsing this forum: MicroController and 88 guests