.. _tinyusb_host_cdc_msc_hid: TINYUSB HOST CDC MSC HID ======================== Overview -------- This example project shows USB CDC MSC HID HOST Board Setting ------------- - Connect a USB port on PC to the PWR DEBUG port on the development board with a USB Type-C cable - Connect a USB port on the development board USB0 to cdc, hid or msc device with a USB Type-C convert Type-A cable Running the example ------------------- - Download the program to the development board to run, and use the serial port debugging assistant to view the output log Connected with a keyboard ~~~~~~~~~~~~~~~~~~~~~~~~~ - When the USB port0 of the development board is connected with a keyboard, the serial port debugging assistant will display the following data: .. code-block:: text TinyUSB Host CDC MSC HID Example HID device address = 1, instance = 0 is mounted HID Interface Protocol = Keyboard HID device address = 1, instance = 1 is mounted HID Interface Protocol = None HID has 2 reports - When the keyboard is pressed, the data sent by the keyboard will be displayed, for example, input "hpmicro": .. code-block:: console hpmicro Connected with a mouse ~~~~~~~~~~~~~~~~~~~~~~ - When the USB port0 of the development board is connected with a mouse, the serial port debugging assistant will display the following data: .. code-block:: text TinyUSB Host CDC MSC HID Example HID device address = 1, instance = 0 is mounted HID Interface Protocol = Mouse - When moving or clicking the mouse, the data sent by the mouse will be displayed: .. code-block:: console (-25 -68 0) (-18 -44 0) (-12 -27 0) (-7 -16 0) (-1 -1 0) (1 -2 0) (5 -5 0) Connected with a U disk ~~~~~~~~~~~~~~~~~~~~~~~~ - When the USB port0 of the development board is connected with a U disk, the serial port debugging assistant will display the U disk information data: .. code-block:: text TinyUSB Host CDC MSC HID Example A MassStorage device is mounted A device with address 1 is mounted IS917 innostor rev 1.00 Disk Size: 7500 MB Block Count = 15360000, Block Size: 512 Connected with a CDC-ACM device ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - When the USB port0 of the development board is connected with a CDC-ACM device, the serial port debugging assistant will display the following data: .. code-block:: text TinyUSB Host CDC MSC HID Example CDC Interface is mounted: address = 1, itf_num = 0 Baudrate: 115200, Stop Bits : 0 Parity : 0, Data Width: 8 - When you type any characters in the console, the CDC device will forward them to the Host, and the Host's console will echo them back.