You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineGPIO_IS_VALID_GPIO(gpio_num) ((gpio_num < GPIO_PIN_COUNT && GPIO_PIN_MUX_REG[gpio_num] != 0)) //to decide whether it is a valid GPIO number
118
118
#defineGPIO_IS_VALID_OUTPUT_GPIO(gpio_num) ((GPIO_IS_VALID_GPIO(gpio_num)) && (gpio_num < 34)) //to decide whether it can be a valid GPIO number of output mode
119
119
120
+
/**
121
+
* @brief Pullup/pulldown information for a single GPIO pad
122
+
*/
123
+
typedefstruct {
124
+
uint32_treg; /*!< Register to modify to enable or disable pullups or pulldowns */
125
+
uint32_tpu; /*!< Bit to set or clear in the above register to enable or disable the pullup, respectively */
126
+
uint32_tpd; /*!< Bit to set or clear in the above register to enable or disable the pulldown, respectively */
127
+
} gpio_pu_pd_desc_t;
128
+
129
+
130
+
/**
131
+
* Per-GPIO pullup/pulldown information
132
+
* On the ESP32, some GPIOs need their pullups and pulldowns enabled and disabled in the RTC
133
+
* peripheral instead of in the GPIO peripheral. This array documents for every GPIO what bit
134
+
* to set or clear.
135
+
*
136
+
* This array is non-static, so if you need a very quick way of toggling the pull-up/downs, you can just
137
+
* do e.g. REG_SET_BIT(gpio_pu_pd_desc[gpio_num].reg, gpio_pu_pd_desc[gpio_num].pu); inline.
138
+
*
139
+
* ToDo: Functions using the contents of this array will do a read/modify/write on GPIO as well as RTC
140
+
* registers. We may need to look into muxes/locks for other code that accesses these RTC registers when we
* @param gpio_num GPIO number. If you want to get level of pin GPIO16, gpio_num should be GPIO_NUM_16 (16);
302
+
* @param gpio_num GPIO number. If you want to get the logic level of e.g. pin GPIO16, gpio_num should be GPIO_NUM_16 (16);
274
303
*
275
304
* @return
276
305
* - 0 the GPIO input level is 0
@@ -284,7 +313,7 @@ int gpio_get_level(gpio_num_t gpio_num);
284
313
*
285
314
* Configure GPIO direction,such as output_only,input_only,output_and_input
286
315
*
287
-
* @param gpio_num Configure GPIO pins number, it should be GPIO number. If you want to set direction of GPIO16, gpio_num should be GPIO_NUM_16 (16);
316
+
* @param gpio_num Configure GPIO pins number, it should be GPIO number. If you want to set direction of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16);
0 commit comments