host_hid_mouse
Overview
This Host HID example is a simple demonstration program based on the MCUXpresso SDK.
The application supports the mouse device. It prints the mouse operation when the mouse device is attached.
System Requirement
Hardware requirements
Mini/micro USB cable
USB A to micro AB cable
Hardware (Tower module/base board, and so on) for a specific device
Personal Computer (PC)
Software requirements
The project path is:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_host_hid_mouse/ / .
The
is Bare Metal or FreeRTOS OS.
Getting Started
Hardware Settings
Set the hardware jumpers (Tower system/base module) to default settings.
Prepare the example
Download the program to the target board.
Power off the target board and power on again.
Connect devices to the board.
For detailed instructions, see the appropriate board User’s Guide. Host hid example doesn’t support HID report descriptor analysis, this example assume that the device data are sent by specific order.
For more detail, please refer to the code. For the device list we tested,
please refer to chapter “Peripheral devices tested with the USB Host stack” in “SDK Release Notes xxxx(board name)”.
Run the example
Connect the board UART to the PC and open the COM port in a terminal tool.
Make sure to use a USB HUB or an adapter with OTG functionality firstly, then plug in the mouse device to the board. The attached information prints out in the terminal.
The mouse operation information prints in the terminal when you operate the mouse.
The application prints the mouse operation information in one line. Each line contains the following sequential string: “Left Click”, “Middle Click”, “Right Click”, “Right”/”Left” movement, “UP”/”Down” movement and “Wheel Down”/”Wheel Up” movement. White space replaces the above string if the mouse doesn’t have the corresponding operation.
For example, when the mouse moves right and up,
" Right UP "
prints in the terminal.
The following figure is an example to attach one mouse device.
Supported Boards
MIMXRT1170-EVKB
EVK-MIMXRT1064
MIMXRT1060-EVKB
EVK-MIMXRT1010
MIMXRT1040-EVK
FRDM-MCXN947
MIMXRT1024-EVK
LPCXpresso55S36
MIMXRT1060-EVKC
MIMXRT1160-EVK
MIMXRT1180-EVK
EVK-MIMXRT1020
MIMXRT700-EVK
IMX95LPD5EVK-19
EVKB-IMXRT1050
RD-RW612-BGA
EVK-MIMXRT1015
FRDM-MCXN236
FRDM-RW612