please help me to understand what i am doing wrong.
I can't manipulate the status of the pullups and pull down during the wake up stub on rtc gpio 25,26,27
Here is the code:
- //esp32 is in deepsleep with pullups and pull down disabled
- //wake up is triggered and the wake up sub is executed. here is some code from my wake up stub:
- //Set the pins as input ,pull ups enabled, to be digital read
- PIN_FUNC_SELECT(GPIO_PIN_REG_27, PIN_FUNC_GPIO);
- PIN_FUNC_SELECT(GPIO_PIN_REG_26, PIN_FUNC_GPIO);
- PIN_FUNC_SELECT(GPIO_PIN_REG_25, PIN_FUNC_GPIO);
- PIN_INPUT_ENABLE(GPIO_PIN_REG_27);
- PIN_INPUT_ENABLE(GPIO_PIN_REG_26);
- PIN_INPUT_ENABLE(GPIO_PIN_REG_25);
- REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT27);
- REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT26);
- REG_WRITE(GPIO_ENABLE_W1TC_REG, BIT25);
- REG_CLR_BIT(GPIO_PIN_REG_27, FUN_PD);
- REG_SET_BIT(GPIO_PIN_REG_27, FUN_PU);
- REG_CLR_BIT(GPIO_PIN_REG_26, FUN_PD);
- REG_SET_BIT(GPIO_PIN_REG_26, FUN_PU);
- REG_CLR_BIT(GPIO_PIN_REG_25, FUN_PD);
- REG_SET_BIT(GPIO_PIN_REG_25, FUN_PU);
- //read and store the value of each pin (code is omitted)
- //deacitvate all pullups ad pulldown
- REG_CLR_BIT(GPIO_PIN_REG_27, FUN_PD);
- REG_CLR_BIT(GPIO_PIN_REG_27, FUN_PU);
- REG_CLR_BIT(GPIO_PIN_REG_26, FUN_PD);
- REG_CLR_BIT(GPIO_PIN_REG_26, FUN_PU);
- REG_CLR_BIT(GPIO_PIN_REG_25, FUN_PD);
- REG_CLR_BIT(GPIO_PIN_REG_25, FUN_PU);
- // go back to sleep within the wakeup stub