|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -33,62 +33,23 @@ extern "C" { |
33 | 33 |
|
34 | 34 | #define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0) |
35 | 35 |
|
36 | | -typedef enum { |
37 | | - GPIO_PIN_INTR_DISABLE = 0, |
38 | | - GPIO_PIN_INTR_POSEDGE = 1, |
39 | | - GPIO_PIN_INTR_NEGEDGE = 2, |
40 | | - GPIO_PIN_INTR_ANYEDGE = 3, |
41 | | - GPIO_PIN_INTR_LOLEVEL = 4, |
42 | | - GPIO_PIN_INTR_HILEVEL = 5 |
43 | | -} GPIO_INT_TYPE; |
44 | | - |
45 | | - |
46 | | -/** |
47 | | - * @brief Change GPIO(0-28) pin output by setting, clearing, or disabling pins, GPIO0<->BIT(0). |
48 | | - * There is no particular ordering guaranteed; so if the order of writes is significant, |
49 | | - * calling code should divide a single call into multiple calls. |
50 | | - * |
51 | | - * @param uint32_t set_mask : the gpios that need high level. |
52 | | - * |
53 | | - * @param uint32_t clear_mask : the gpios that need low level. |
54 | | - * |
55 | | - * @param uint32_t enable_mask : the gpios that need be changed. |
56 | | - * |
57 | | - * @param uint32_t disable_mask : the gpios that need disable output. |
58 | | - * |
59 | | - * @return None |
60 | | - */ |
61 | | -void gpio_output_set(uint32_t set_mask, uint32_t clear_mask, uint32_t enable_mask, uint32_t disable_mask); |
62 | 36 |
|
63 | 37 | /** |
64 | | - * @brief Sample the value of GPIO input pins(0-28) and returns a bitmask. |
65 | | - * @param None |
| 38 | + * @brief Set GPIO output level |
66 | 39 | * |
67 | | - * @return uint32_t : bitmask for GPIO input pins, BIT(0) for GPIO0. |
| 40 | + * @param gpio_num GPIO number |
| 41 | + * @param level Output level, 0:low; 1:high |
68 | 42 | */ |
69 | | -uint32_t gpio_input_get(void); |
| 43 | +void gpio_set_output_level(uint32_t gpio_num, uint32_t level); |
70 | 44 |
|
71 | 45 | /** |
72 | | - * @brief Set GPIO to wakeup. |
73 | | - * Please do not call this function in SDK. |
74 | | - * |
75 | | - * @param uint32_t i: gpio number. |
| 46 | + * @brief Get GPIO input level |
76 | 47 | * |
77 | | - * @param GPIO_INT_TYPE intr_state : only GPIO_PIN_INTR_LOLEVEL\GPIO_PIN_INTR_HILEVEL can be used |
| 48 | + * @param gpio_num GPIO number |
78 | 49 | * |
79 | | - * @return None |
80 | | - */ |
81 | | -void gpio_pin_wakeup_enable(uint32_t i, GPIO_INT_TYPE intr_state); |
82 | | - |
83 | | -/** |
84 | | - * @brief disable GPIOs to wakeup. |
85 | | - * Please do not call this function in SDK. |
86 | | - * |
87 | | - * @param None |
88 | | - * |
89 | | - * @return None |
| 50 | + * @return 0:the GPIO_input level is low; 1:the GPIO input level is high |
90 | 51 | */ |
91 | | -void gpio_pin_wakeup_disable(void); |
| 52 | +uint32_t gpio_get_input_level(uint32_t gpio_num); |
92 | 53 |
|
93 | 54 | /** |
94 | 55 | * @brief set gpio input to a signal, one gpio can input to several signals. |
|
0 commit comments