refactor: Move the DT based CDC ACM setup.

This commit is contained in:
Peter Johanson 2021-11-05 04:23:50 +00:00 committed by Pete Johanson
parent 2c5d5fde51
commit c5ab8a9444
15 changed files with 72 additions and 11 deletions

View file

@ -477,15 +477,6 @@ config ZMK_LOG_LEVEL
config USB_CDC_ACM_RINGBUF_SIZE config USB_CDC_ACM_RINGBUF_SIZE
default 1024 default 1024
config USB_CDC_ACM_DEVICE_NAME
default "CDC_ACM"
config USB_CDC_ACM_DEVICE_COUNT
default 1
config UART_CONSOLE_ON_DEV_NAME
default "CDC_ACM_0"
config LOG_BUFFER_SIZE config LOG_BUFFER_SIZE
default 8192 default 8192

View file

@ -14,6 +14,7 @@
chosen { chosen {
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan; zmk,kscan = &kscan;
/* TODO: Enable once the GPIO bitbanging driver supports STM32 /* TODO: Enable once the GPIO bitbanging driver supports STM32
zmk,underglow = &led_strip; zmk,underglow = &led_strip;
@ -82,6 +83,10 @@
&usb { &usb {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&rtc { &rtc {

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -73,6 +74,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
}; };
@ -84,6 +85,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
chosen { chosen {
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
}; };
@ -67,6 +68,10 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(
&usb { &usb {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {

View file

@ -17,6 +17,7 @@
chosen { chosen {
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan; zmk,kscan = &kscan;
zmk,matrix_transform = &transform; zmk,matrix_transform = &transform;
/* TODO: Enable once we support the IC for underglow /* TODO: Enable once we support the IC for underglow
@ -118,6 +119,10 @@
&rtc { &rtc {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -72,6 +73,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
zmk,underglow = &led_strip; zmk,underglow = &led_strip;
@ -128,6 +129,10 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {

View file

@ -15,6 +15,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -56,13 +57,17 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {
/* /*
* For more information, see: * For more information, see:
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html * http: //docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
*/ */
partitions { partitions {
compatible = "fixed-partitions"; compatible = "fixed-partitions";

View file

@ -15,6 +15,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -54,6 +55,10 @@
&usbd { &usbd {
compatible = "nordic,nrf-usbd"; compatible = "nordic,nrf-usbd";
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -59,6 +60,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -59,6 +60,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
}; };
leds { leds {
@ -71,6 +72,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };

View file

@ -15,8 +15,9 @@
chosen { chosen {
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &layout_grid_transform; zmk,matrix_transform = &layout_grid_transform;
}; };
kscan0: kscan { kscan0: kscan {
@ -83,6 +84,10 @@ layout_2x2u_transform:
&usb { &usb {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {

View file

@ -16,6 +16,7 @@
zephyr,code-partition = &code_partition; zephyr,code-partition = &code_partition;
zephyr,sram = &sram0; zephyr,sram = &sram0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0; zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
}; };
@ -95,6 +96,10 @@
&usbd { &usbd {
status = "okay"; status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
}; };
&flash0 { &flash0 {