Skip to content

Commit 6c32698

Browse files
committed
shields: cdc_acm: add support for zephyr,bt-c2h-uart property
Add support for chosen property "zephyr,bt-c2h-uart". Signed-off-by: Johann Fischer <[email protected]>
1 parent 105e3da commit 6c32698

File tree

4 files changed

+42
-10
lines changed

4 files changed

+42
-10
lines changed

boards/shields/cdc_acm/Kconfig.defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if SHIELD_CDC_ACM_CONSOLE || SHIELD_CDC_ACM_SHELL
4+
if SHIELD_CDC_ACM_CONSOLE || SHIELD_CDC_ACM_SHELL || SHIELD_CDC_ACM_BT_C2H
55

66
# TEST_LOGGING_DEFAULTS option sets all log levels to INF,
77
# including the USB_CDC_ACM_LOG_LEVEL and that can not work.
@@ -20,7 +20,7 @@ config USB_DEVICE_STACK
2020
config USB_DEVICE_INITIALIZE_AT_BOOT
2121
default y
2222

23-
endif #if SHIELD_CDC_ACM_CONSOLE || SHIELD_CDC_ACM_SHELL
23+
endif #if SHIELD_CDC_ACM_CONSOLE || SHIELD_CDC_ACM_SHELL || ...
2424

2525
if SHIELD_CDC_ACM_CONSOLE
2626

boards/shields/cdc_acm/Kconfig.shield

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ config SHIELD_CDC_ACM_CONSOLE
66

77
config SHIELD_CDC_ACM_SHELL
88
def_bool $(shields_list_contains,cdc_acm_shell)
9+
10+
config SHIELD_CDC_ACM_BT_C2H
11+
def_bool $(shields_list_contains,cdc_acm_bt_c2h)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2021 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,bt-c2h-uart = &bt_c2h_cdc_acm_uart0;
10+
};
11+
};
12+
13+
&zephyr_udc0 {
14+
bt_c2h_cdc_acm_uart0: bt_c2h_cdc_acm_uart0 {
15+
compatible = "zephyr,cdc-acm-uart";
16+
label = "BT_C2H_CDC_ACM_0";
17+
};
18+
};

boards/shields/cdc_acm/doc/index.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ these specific USB dongles.
2929
Current supported chosen properties
3030
===================================
3131

32-
+-----------------------+---------------------+
33-
| Chosen property | Shield Designation |
34-
| | |
35-
+=======================+=====================+
36-
| ``zephyr,console`` | ``cdc_acm_console`` |
37-
+-----------------------+---------------------+
38-
| ``zephyr,shell-uart`` | ``cdc_acm_shell`` |
39-
+-----------------------+---------------------+
32+
+------------------------+---------------------+
33+
| Chosen property | Shield Designation |
34+
| | |
35+
+========================+=====================+
36+
| ``zephyr,console`` | ``cdc_acm_console`` |
37+
+------------------------+---------------------+
38+
| ``zephyr,shell-uart`` | ``cdc_acm_shell`` |
39+
+------------------------+---------------------+
40+
| ``zephyr,bt-c2h-uart`` | ``cdc_acm_bt_c2h`` |
41+
+------------------------+---------------------+
4042

4143
Requirements
4244
************
@@ -62,3 +64,12 @@ Or ``-DSHIELD=cdc_acm_console``, for example:
6264
:board: nrf52840dongle_nrf52840
6365
:shield: cdc_acm_console
6466
:goals: build
67+
68+
With ``-DSHIELD=cdc_acm_bt_c2h``, :ref:`bluetooth-hci-uart-sample` can use
69+
CDC ACM UART as interface to the host:
70+
71+
.. zephyr-app-commands::
72+
:zephyr-app: samples/bluetooth/hci_uart
73+
:board: nrf52840dongle_nrf52840
74+
:shield: cdc_acm_bt_c2h
75+
:goals: build

0 commit comments

Comments
 (0)