mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 12:53:29 +00:00
esp_rom: extract common GPIO apis into esp_rom_gpio.h
This commit is contained in:
@@ -15,9 +15,11 @@
|
||||
#include "tinyusb.h"
|
||||
#include "hal/usb_hal.h"
|
||||
#include "soc/usb_periph.h"
|
||||
#include "soc/gpio_periph.h"
|
||||
#include "hal/gpio_ll.h"
|
||||
#include "esp_rom_gpio.h"
|
||||
#include "driver/periph_ctrl.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp32s2/rom/gpio.h"
|
||||
|
||||
static void configure_pins(usb_hal_context_t *usb)
|
||||
{
|
||||
@@ -25,16 +27,16 @@ static void configure_pins(usb_hal_context_t *usb)
|
||||
* Introduce additional parameters in usb_hal_context_t when adding support
|
||||
* for USB Host.
|
||||
*/
|
||||
for (const usb_iopin_dsc_t* iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
|
||||
for (const usb_iopin_dsc_t *iopin = usb_periph_iopins; iopin->pin != -1; ++iopin) {
|
||||
if ((usb->use_external_phy) || (iopin->ext_phy_only == 0)) {
|
||||
gpio_pad_select_gpio(iopin->pin);
|
||||
esp_rom_gpio_pad_select_gpio(iopin->pin);
|
||||
if (iopin->is_output) {
|
||||
gpio_matrix_out(iopin->pin, iopin->func, false, false);
|
||||
esp_rom_gpio_connect_out_signal(iopin->pin, iopin->func, false, false);
|
||||
} else {
|
||||
gpio_matrix_in(iopin->pin, iopin->func, false);
|
||||
gpio_pad_input_enable(iopin->pin);
|
||||
esp_rom_gpio_connect_in_signal(iopin->pin, iopin->func, false);
|
||||
gpio_ll_input_enable(&GPIO, iopin->pin);
|
||||
}
|
||||
gpio_pad_unhold(iopin->pin);
|
||||
esp_rom_gpio_pad_unhold(iopin->pin);
|
||||
}
|
||||
}
|
||||
if (!usb->use_external_phy) {
|
||||
|
Reference in New Issue
Block a user