From fcbce8b44515a3d6b3c9f3a820a5fb61ce988379 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Fri, 5 Apr 2024 20:28:52 +0000 Subject: [PATCH] feat(studio): Add `studio-rpc-usb-uart` snippet. * Add an easy snippet for enabling USB UART added to the `zephyr_udc0` standard node. --- app/snippets/studio-rpc-usb-uart/snippet.yml | 7 +++++++ .../studio-rpc-usb-uart.conf | 9 +++++++++ .../studio-rpc-usb-uart.overlay | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 app/snippets/studio-rpc-usb-uart/snippet.yml create mode 100644 app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.conf create mode 100644 app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.overlay diff --git a/app/snippets/studio-rpc-usb-uart/snippet.yml b/app/snippets/studio-rpc-usb-uart/snippet.yml new file mode 100644 index 00000000..e0e334de --- /dev/null +++ b/app/snippets/studio-rpc-usb-uart/snippet.yml @@ -0,0 +1,7 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +name: studio-rpc-usb-uart +append: + EXTRA_DTC_OVERLAY_FILE: studio-rpc-usb-uart.overlay + EXTRA_CONF_FILE: studio-rpc-usb-uart.conf diff --git a/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.conf b/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.conf new file mode 100644 index 00000000..84f25e09 --- /dev/null +++ b/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.conf @@ -0,0 +1,9 @@ +# Copyright (c) 2024 The ZMK Contributors +# SPDX-License-Identifier: MIT + +CONFIG_ZMK_USB=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_CDC_ACM=y +CONFIG_SERIAL=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_UART_LINE_CTRL=y diff --git a/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.overlay b/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.overlay new file mode 100644 index 00000000..82da5a10 --- /dev/null +++ b/app/snippets/studio-rpc-usb-uart/studio-rpc-usb-uart.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +/ { + chosen { + zmk,studio-rpc-uart = &snippet_studio_rpc_usb_uart; + }; +}; + +&zephyr_udc0 { + snippet_studio_rpc_usb_uart: snippet_studio_rpc_usb_uart { + compatible = "zephyr,cdc-acm-uart"; + }; +}; +