I accomplish this without problems using the ULP examples and enabling the RTC_GPIO_OUT_REG register. Just like the code below:
- // Enable RTC GPIO 12, which is equivalent to GPIO2
- WRITE_RTC_REG(RTC_GPIO_OUT, REG, RTC_GPIO_OUT_DATA_S+12, 1, 1)
- .set gpio_num, 12 // Create a constant with constains the value 12
- .bss
- // Create a variable gpio_var and add the value 12 from the main code as showed in the ULP Example
- .global gpio_var
- gpio_var: .long 0
- // This instruction using a constant works! Because I am passing the value and not the address
- WRITE_RTC_REG(RTC_GPIO_OUT, REG, RTC_GPIO_OUT_DATA_S+gpio_num, 1, 1)
- // This instruction cause an compilation error, probably because I a, passing the address instead the value
- WRITE_RTC_REG(RTC_GPIO_OUT, REG, RTC_GPIO_OUT_DATA_S+gpio_var, 1, 1)
Thanks,
Victor