keyboard2mouse#
Overview#
This example implements the host and the device, where the one controller works as a host and the other controller works as a device.
The host supports the keyboard device and device works as a mouse when connecting to the PC.
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_keyboard2mouse/ / .
The
is Bare Metal or FreeRTOS OS.
Getting Started#
Hardware Settings#
First, 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 and connect a USB cable between the PC and the USB device port of 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.
Plug in a hub or a keyboard device to the full-speed only port. The attached information prints out in the terminal.
Plug in the device high-speed port into the PC. An HID-compliant mouse is enumerated in the Device Manager.
Press <w, s, a, d> in the keyboard, which causes the mouse to move.
Press ‘w’, the mouse move up.
Press ‘s’, the mouse move down.
Press ‘a’, the mouse move left.
Press ‘d’, the mouse move right.
Supported Boards#
LPCXpresso55S69
Getting Started
Hardware Settings
The Jumper settings:\n J6 1-2 and J7 open for high speed mode, J6 2-3 and J7 shunt for full speed mode.
EVK-MIMXRT1064
Getting Started
Hardware Settings
The OTG1 is used for device, the OTG2 is used for host.
MIMXRT1060-EVKC
Getting Started
Hardware Settings
The OTG1 is used for device, the OTG2 is used for host.
EVKB-IMXRT1050
Getting Started
Hardware Settings
The OTG1 is used for device, the OTG2 is used for host.
LPCXpresso55S28
Getting Started
Hardware Settings
The Jumper settings:\n J6 1-2 and J7 open for high speed mode, J6 2-3 and J7 shunt for full speed mode.
LPCXpresso54S018
Getting Started
Hardware Settings
The Jumper settings:\n J9 1-2 high speed mode,2-3 full speed mode; J10 open high speed, shunt full speed; J11 2-3, J12 2-3, J13 2-3 , need provide external power through J1.
LPCXpresso55S16
Getting Started
Hardware Settings
The Jumper settings:\n JP20 1-2, JP21 1-2 and JP22 1-2 for chip power. JP2 1-2 and JS2 shunt for full speed mode, JP2 2-3 and JS2 open for high speed mode.
LPCXpresso54S018M
Getting Started
Hardware Settings
The Jumper settings:\n J9 1-2 high speed mode,2-3 full speed mode; J10 open high speed, shunt full speed; J11 2-3, J12 2-3, J13 2-3 , need provide external power through J1.
LPCXpresso54628
Getting Started
Hardware Settings
The Jumper settings:\n J9 1-2 high speed mode,2-3 full speed mode; J10 open high speed, shunt full speed; J11 2-3, J12 2-3, J13 2-3 , need provide external power through J1.
MIMXRT1060-EVKB
Getting Started
Hardware Settings
The OTG1 is used for device, the OTG2 is used for host.