mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 13:45:46 +00:00
gpio: Disable USB JTAG when setting pins 18 and 19 as GPIOs on ESP32C3
When `DIS_USB_JTAG` eFuse is NOT burned (`False`), it is not possible to set pins 18 and 19 as GPIOs. This commit solves this by manually disabling USB JTAG when using pins 18 or 19. The functions shall use `gpio_hal_iomux_func_sel` instead of `PIN_FUNC_SELELECT`.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "driver/spi_slave.h"
|
||||
#include "esp_log.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "hal/gpio_hal.h"
|
||||
|
||||
int test_freq_default[]=TEST_FREQ_DEFAULT();
|
||||
|
||||
@@ -202,13 +203,13 @@ void master_free_device_bus(spi_device_handle_t spi)
|
||||
|
||||
void spitest_gpio_output_sel(uint32_t gpio_num, int func, uint32_t signal_idx)
|
||||
{
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio_num], func);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_num], func);
|
||||
GPIO.func_out_sel_cfg[gpio_num].func_sel = signal_idx;
|
||||
}
|
||||
|
||||
void spitest_gpio_input_sel(uint32_t gpio_num, int func, uint32_t signal_idx)
|
||||
{
|
||||
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[gpio_num], func);
|
||||
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[gpio_num], func);
|
||||
GPIO.func_in_sel_cfg[signal_idx].func_sel = gpio_num;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user