mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
esp32c3: Fix GPIO Output on pins 18 and 19 USB/JTAG
This commit is contained in:
committed by
Xiang Xiao
parent
5dfb2713f6
commit
b8c33e585e
@@ -38,9 +38,17 @@
|
|||||||
#include "esp32c3_irq.h"
|
#include "esp32c3_irq.h"
|
||||||
#include "hardware/esp32c3_iomux.h"
|
#include "hardware/esp32c3_iomux.h"
|
||||||
#include "hardware/esp32c3_gpio.h"
|
#include "hardware/esp32c3_gpio.h"
|
||||||
|
#include "hardware/esp32c3_usb_serial_jtag.h"
|
||||||
|
|
||||||
#include "esp32c3_gpio.h"
|
#include "esp32c3_gpio.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define USB_JTAG_DM 18
|
||||||
|
#define USB_JTAG_DP 19
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -128,6 +136,18 @@ int esp32c3_configgpio(int pin, gpio_pinattr_t attr)
|
|||||||
func = 0;
|
func = 0;
|
||||||
cntrl = 0;
|
cntrl = 0;
|
||||||
|
|
||||||
|
/* If pin 18 or 19 then disable the USB/JTAG function and pull-up */
|
||||||
|
|
||||||
|
if ((pin == USB_JTAG_DM) || (pin == USB_JTAG_DP))
|
||||||
|
{
|
||||||
|
uint32_t regval;
|
||||||
|
|
||||||
|
regval = getreg32(USB_SERIAL_JTAG_CONF0_REG);
|
||||||
|
regval &= ~(USB_SERIAL_JTAG_USB_PAD_ENABLE |
|
||||||
|
USB_SERIAL_JTAG_DP_PULLUP);
|
||||||
|
putreg32(regval, USB_SERIAL_JTAG_CONF0_REG);
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle input pins */
|
/* Handle input pins */
|
||||||
|
|
||||||
if ((attr & INPUT) != 0)
|
if ((attr & INPUT) != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user