|
30 | 30 | #define RTC_IO_TOUCH_PAD2_REG (DR_REG_RTCIO_BASE + 0x9c) |
31 | 31 | #define RTC_IO_TOUCH_PAD2_MUX_SEL_M (BIT(19)) |
32 | 32 | #define RTC_GPIO_OUT_REG (DR_REG_RTCIO_BASE + 0x0) |
33 | | -#define RTC_GPIO_ENABLE_W1TS_REG (DR_REG_RTCIO_BASE + 0x10) |
34 | | -#define RTC_GPIO_ENABLE_W1TC_REG (DR_REG_RTCIO_BASE + 0x14) |
35 | | -#define RTC_GPIO_ENABLE_W1TS_S 14 |
36 | | -#define RTC_GPIO_ENABLE_W1TC_S 14 |
| 33 | +#define RTC_GPIO_ENABLE_REG (DR_REG_RTCIO_BASE + 0xc) |
| 34 | +#define RTC_GPIO_ENABLE_S 14 |
37 | 35 | #define RTC_GPIO_OUT_DATA_S 14 |
38 | 36 |
|
39 | 37 | # constants from: |
|
62 | 60 | # connect GPIO to ULP (0: GPIO connected to digital GPIO module, 1: GPIO connected to analog RTC module) |
63 | 61 | WRITE_RTC_REG(RTC_IO_TOUCH_PAD2_REG, RTC_IO_TOUCH_PAD2_MUX_SEL_M, 1, 1); |
64 | 62 |
|
65 | | - # GPIO shall be output, not input |
66 | | - WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 1); |
| 63 | + # GPIO shall be output, not input (this also enables a pull-down by default) |
| 64 | + WRITE_RTC_REG(RTC_GPIO_ENABLE_REG, RTC_GPIO_ENABLE_S + gpio, 1, 1) |
67 | 65 |
|
68 | 66 | # store that we're done with initialisation |
69 | 67 | move r0, magic |
|
83 | 81 |
|
84 | 82 | on: |
85 | 83 | # turn on led (set GPIO) |
86 | | - WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TS_REG, RTC_GPIO_ENABLE_W1TS_S + gpio, 1, 1) |
| 84 | + WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 1) |
87 | 85 | jump exit |
88 | 86 |
|
89 | 87 | off: |
90 | 88 | # turn off led (clear GPIO) |
91 | | - WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TC_REG, RTC_GPIO_ENABLE_W1TC_S + gpio, 1, 1) |
| 89 | + WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 0) |
92 | 90 | jump exit |
93 | 91 |
|
94 | 92 | exit: |
|
0 commit comments