Przeglądaj źródła

Driver: gpio and rtcio dirver update

fuzhibo 6 lat temu
rodzic
commit
bf79e9d70a

+ 0 - 8
components/driver/include/driver/gpio.h

@@ -317,14 +317,6 @@ typedef enum {
     GPIO_NUM_27 = 27,   /*!< GPIO27, input and output */
     GPIO_NUM_28 = 28,   /*!< GPIO28, input and output */
     GPIO_NUM_32 = 32,   /*!< GPIO32, input and output */
-    GPIO_NUM_33 = 33,   /*!< GPIO33, input and output */
-    GPIO_NUM_34 = 34,   /*!< GPIO34, input and output */
-    GPIO_NUM_35 = 35,   /*!< GPIO35, input and output */
-    GPIO_NUM_36 = 36,   /*!< GPIO36, input and output */
-    GPIO_NUM_37 = 37,   /*!< GPIO37, input and output */
-    GPIO_NUM_38 = 38,   /*!< GPIO38, input and output */
-    GPIO_NUM_39 = 39,   /*!< GPIO39, input and output */
-    GPIO_NUM_40 = 40,   /*!< GPIO40, input and output */
     GPIO_NUM_41 = 41,   /*!< GPIO41, input and output */
     GPIO_NUM_42 = 42,   /*!< GPIO42, input and output */
     GPIO_NUM_43 = 43,   /*!< GPIO43, input and output */

+ 42 - 0
components/driver/rtc_module.c

@@ -166,6 +166,48 @@ static rtc_gpio_info_t* rtc_gpio[RTC_GPIO_NUMBER] = {
 };
 #endif
 
+#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,