From 83e00cf64329569c16907423ee6b48c05fc4054b Mon Sep 17 00:00:00 2001 From: fuzhibo Date: Thu, 13 Jun 2019 15:37:58 +0800 Subject: [PATCH] Driver: gpio and rtcio dirver update --- components/driver/gpio.c | 1 - components/driver/rtc_module.c | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/components/driver/gpio.c b/components/driver/gpio.c index 22095cd3b..d8d5c2694 100644 --- a/components/driver/gpio.c +++ b/components/driver/gpio.c @@ -628,7 +628,6 @@ esp_err_t gpio_force_unhold_all() SET_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_CLR_DG_PAD_AUTOHOLD); return ESP_OK; } - #endif void gpio_iomux_in(uint32_t gpio, uint32_t signal_idx) diff --git a/components/driver/rtc_module.c b/components/driver/rtc_module.c index 5994f21ef..929440c63 100644 --- a/components/driver/rtc_module.c +++ b/components/driver/rtc_module.c @@ -122,6 +122,48 @@ static touch_pad_filter_t *s_touch_pad_filter = NULL; static uint16_t s_touch_pad_init_bit = 0x0000; static filter_cb_t s_filter_cb = NULL; +#if CONFIG_IDF_TARGET_ESP32S2BETA +typedef volatile struct { + uint32_t reserved0: 13; + uint32_t fun_ie: 1; /*input enable in work mode*/ + uint32_t slp_oe: 1; /*output enable in sleep mode*/ + uint32_t slp_ie: 1; /*input enable in sleep mode*/ + uint32_t slp_sel: 1; /*1: enable sleep mode during sleep 0: no sleep mode*/ + uint32_t fun_sel: 2; /*function sel*/ + uint32_t mux_sel: 1; /*1: use RTC GPIO 0: use digital GPIO*/ + uint32_t reserved20: 7; + uint32_t rue: 1; /*RUE*/ + uint32_t rde: 1; /*RDE*/ + uint32_t drv: 2; /*DRV*/ + uint32_t reserved31: 1; +} rtc_gpio_info_t; + +static rtc_gpio_info_t* rtc_gpio[RTC_GPIO_NUMBER] = { + &RTCIO.touch_pad[0].val, + &RTCIO.touch_pad[1].val, + &RTCIO.touch_pad[2].val, + &RTCIO.touch_pad[3].val, + &RTCIO.touch_pad[4].val, + &RTCIO.touch_pad[5].val, + &RTCIO.touch_pad[6].val, + &RTCIO.touch_pad[7].val, + &RTCIO.touch_pad[8].val, + &RTCIO.touch_pad[9].val, + &RTCIO.touch_pad[10].val, + &RTCIO.touch_pad[11].val, + &RTCIO.touch_pad[12].val, + &RTCIO.touch_pad[13].val, + &RTCIO.touch_pad[14].val, + &RTCIO.xtal_32p_pad.val, + &RTCIO.xtal_32n_pad.val, + &RTCIO.pad_dac[0].val, + &RTCIO.pad_dac[1].val, + &RTCIO.rtc_pad19.val, + &RTCIO.rtc_pad20.val, + &RTCIO.rtc_pad21.val +}; +#endif + typedef enum { ADC_CTRL_RTC = 0, ADC_CTRL_ULP = 1,