@@ -41,6 +41,15 @@ typedef enum {
41
41
RTCIO_WAKEUP_HIGH_LEVEL = 0x5 , /*!< GPIO interrupt type : input high level trigger */
42
42
} rtcio_ll_wake_type_t ;
43
43
44
+ typedef enum {
45
+ RTCIO_INTR_DISABLE = 0 , /*!< Disable GPIO interrupt */
46
+ RTCIO_INTR_POSEDGE = 1 , /*!< GPIO interrupt type : rising edge */
47
+ RTCIO_INTR_NEGEDGE = 2 , /*!< GPIO interrupt type : falling edge */
48
+ RTCIO_INTR_ANYEDGE = 3 , /*!< GPIO interrupt type : both rising and falling edge */
49
+ RTCIO_INTR_LOW_LEVEL = 4 , /*!< GPIO interrupt type : input low level trigger */
50
+ RTCIO_INTR_HIGH_LEVEL = 5 , /*!< GPIO interrupt type : input high level trigger */
51
+ } rtcio_ll_intr_type_t ;
52
+
44
53
typedef enum {
45
54
RTCIO_OUTPUT_NORMAL = 0 , /*!< RTCIO output mode is normal. */
46
55
RTCIO_OUTPUT_OD = 0x1 , /*!< RTCIO output mode is open-drain. */
@@ -299,6 +308,24 @@ static inline void rtcio_ll_wakeup_disable(int rtcio_num)
299
308
LP_IO .pin [rtcio_num ].int_type = RTCIO_WAKEUP_DISABLE ;
300
309
}
301
310
311
+ /**
312
+ * Enable interrupt function and set interrupt type
313
+ *
314
+ * @param rtcio_num The index of rtcio. 0 ~ MAX(rtcio).
315
+ * @param type Interrupt type on high level or low level.
316
+ */
317
+
318
+ static inline void rtcio_ll_intr_enable (int rtcio_num , rtcio_ll_intr_type_t type )
319
+ {
320
+ LP_IO .pin [rtcio_num ].int_type = type ;
321
+
322
+ /* Work around for HW issue,
323
+ need to also enable this clk, so that LP_IO.status.status_interrupt can get updated,
324
+ and trigger the interrupt on the LP Core
325
+ */
326
+ LP_IO .date .clk_en = 1 ;
327
+ }
328
+
302
329
/**
303
330
* Enable rtc io output in deep sleep.
304
331
*
0 commit comments