|
|
  |
HID и VCP на одном контроллере можно сделать? |
|
|
|
Dec 1 2016, 10:06
|

Профессионал
    
Группа: Свой
Сообщений: 1 032
Регистрация: 13-03-08
Из: Маськва
Пользователь №: 35 877

|
Я именно такую штуку делал. На libopencm3. Главное - погуглить usb composite device, понять, как создать нужный дескриптор, и склеить два примера. Ну или "готовое" можно взять: Цитата(STM32_USB-Host-Device_Lib_V2.2.0) The examples provide a composite device. A composite device is one that has multiple interfaces controlled independently of each other. Using composite device, multiple functions are combined into a single device. In this Example the independent interfaces are : HID and VCP (CDC).
The implementation of the composite CDC-HID device is done by creating a wrapping class (see folder hid_cdc_wrapper ) that makes calls to the separate CDC and HID class layer handlers (files usb_cdc_core.c and usb_hid_core.c files).
To test the demo, you can run HID mouse example and in same time you can do a USB to USART communication by opening a serial terminal window (like hyperterminal) and selecting the STM32 virtual comport (you need to follow same steps as the CDC virtual comport example). Кавычки у слова "готовое" - не спроста. Шаг в сторону, и сразу всё ломается.
--------------------
Тут обсуждается творческий порыв, а не соответствие каким-либо стандартам ©
|
|
|
|
|
  |
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0
|
|
|