dts: xtensa: espressif: esp32s3: add USB CDC support
Enable USB CDC with self stack support for esp32s3. Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
This commit is contained in:
parent
42051fc2d4
commit
ae6b398f51
3 changed files with 17 additions and 1 deletions
|
@ -106,6 +106,8 @@ Current Zephyr's ESP32-S3-DevKitM board supports the following features:
|
|||
+------------+------------+-------------------------------------+
|
||||
| GDMA | on-chip | dma |
|
||||
+------------+------------+-------------------------------------+
|
||||
| USB-CDC | on-chip | serial |
|
||||
+------------+------------+-------------------------------------+
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
|
|
@ -117,6 +117,10 @@
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_serial {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
status = "okay";
|
||||
partitions {
|
||||
|
|
|
@ -13,11 +13,21 @@
|
|||
#include <errno.h>
|
||||
#include <soc.h>
|
||||
#include <zephyr/drivers/uart.h>
|
||||
#if defined(CONFIG_SOC_ESP32C3)
|
||||
#include <zephyr/drivers/interrupt_controller/intc_esp32c3.h>
|
||||
#else
|
||||
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
|
||||
#endif
|
||||
#include <zephyr/drivers/clock_control.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <esp_attr.h>
|
||||
|
||||
#ifdef CONFIG_SOC_ESP32C3
|
||||
#define ISR_HANDLER isr_handler_t
|
||||
#else
|
||||
#define ISR_HANDLER intr_handler_t
|
||||
#endif
|
||||
|
||||
#define USBSERIAL_TIMEOUT_MAX_US 50000
|
||||
|
||||
static int s_usbserial_timeout;
|
||||
|
@ -90,7 +100,7 @@ static int serial_esp32_usb_init(const struct device *dev)
|
|||
int ret = clock_control_on(config->clock_dev, config->clock_subsys);
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
data->irq_line = esp_intr_alloc(config->irq_source, 0, (isr_handler_t)serial_esp32_usb_isr,
|
||||
data->irq_line = esp_intr_alloc(config->irq_source, 0, (ISR_HANDLER)serial_esp32_usb_isr,
|
||||
(void *)dev, NULL);
|
||||
#endif
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue