-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(USBDevice): move USB device support as a built-in library
It could propbaly be splitted in 3 libraries: - USBDevice: base support - USBDCDC - USBDHID Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
- Loading branch information
Showing
38 changed files
with
130 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,7 @@ build_sketch(TARGET "{{tgtname or "@binary_name_here@"}}" | |
# SD | ||
# Wire | ||
# SPI | ||
# USBDevice | ||
# VirtIO | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...> | ||
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
add_library(USBDevice INTERFACE) | ||
add_library(USBDevice_usage INTERFACE) | ||
|
||
target_include_directories(USBDevice_usage INTERFACE | ||
src | ||
) | ||
|
||
|
||
target_link_libraries(USBDevice_usage INTERFACE | ||
base_config | ||
) | ||
|
||
target_link_libraries(USBDevice INTERFACE USBDevice_usage) | ||
|
||
|
||
|
||
add_library(USBDevice_bin OBJECT EXCLUDE_FROM_ALL | ||
src/cdc/cdc_queue.c | ||
src/cdc/usbd_cdc.c | ||
src/cdc/usbd_cdc_if.c | ||
src/hid/usbd_hid_composite.c | ||
src/hid/usbd_hid_composite_if.c | ||
src/usb_device_core.c | ||
src/usb_device_ctlreq.c | ||
src/usb_device_ioreq.c | ||
src/usbd_conf.c | ||
src/usbd_desc.c | ||
src/usbd_ep_conf.c | ||
src/usbd_if.c | ||
src/USBSerial.cpp | ||
) | ||
target_link_libraries(USBDevice_bin PUBLIC USBDevice_usage) | ||
|
||
target_link_libraries(USBDevice INTERFACE | ||
USBDevice_bin | ||
$<TARGET_OBJECTS:USBDevice_bin> | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
void setup() { | ||
// put your setup code here, to run once: | ||
|
||
} | ||
|
||
void loop() { | ||
// put your main code here, to run repeatedly: | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
####################################### | ||
# Syntax Coloring Map For USBDevice | ||
####################################### | ||
|
||
####################################### | ||
# Datatypes (KEYWORD1) | ||
####################################### | ||
USBSerial KEYWORD1 | ||
|
||
####################################### | ||
# Methods and Functions (KEYWORD2) | ||
####################################### | ||
SerialUSB KEYWORD2 | ||
begin KEYWORD2 | ||
available KEYWORD2 | ||
availableForWrite KEYWORD2 | ||
peek KEYWORD2 | ||
read KEYWORD2 | ||
readBytes KEYWORD2 | ||
readBytesUntil | ||
write KEYWORD2 | ||
flush KEYWORD2 | ||
baud KEYWORD2 | ||
stopbits KEYWORD2 | ||
paritytype KEYWORD2 | ||
numbits KEYWORD2 | ||
dtr KEYWORD2 | ||
dtr KEYWORD2 | ||
rts KEYWORD2 | ||
|
||
####################################### | ||
# Constants (LITERAL1) | ||
####################################### | ||
USBD_VID LITERAL1 | ||
USBD_PID LITERAL1 | ||
USBD_MANUFACTURER_STRING LITERAL1 | ||
ONE_STOP_BIT LITERAL1 | ||
ONE_AND_HALF_STOP_BIT LITERAL1 | ||
TWO_STOP_BITS LITERAL1 | ||
NO_PARITY LITERAL1 | ||
ODD_PARITY LITERAL1 | ||
EVEN_PARITY LITERAL1 | ||
MARK_PARITY LITERAL1 | ||
SPACE_PARITY LITERAL1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name=USBDevice | ||
version=1.0.0 | ||
author=Frederic Pillon | ||
maintainer=stm32duino | ||
sentence=Enables USB device support (CDC or HID). | ||
paragraph= | ||
category=Communication | ||
url=https://github.com/stm32duino/Arduino_Core_STM32 | ||
architectures=stm32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#ifndef __USBD_H__ | ||
#define __USBD_H__ | ||
|
||
#endif /* __USBD_H__ */ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters