MCUXpresso SDK Documentation

host_hid_generic#

Overview#

This Host HID example only supports the HID generic device that runs the device HID generic example.
This application implements a simple HID interrupt in-and-out endpoint bi-directional communication. The application sends one test string to the device. The device receives and sends back the string. The application receives the string and prints it.

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_generic//.

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#

  1. Download the program to the target board.

  2. Power off the target board and power on again.

  3. Make sure to use a USB HUB or an adapter with OTG functionality firstly. Connect devices to the board.

For detailed instructions, see the appropriate board User’s Guide. this example could be tested with the “usb_device_hid_generic” example in pairs.

Run the example#

  1. Connect the board UART to the PC and open the COM port in a terminal tool.

  2. Plug in the HUB or HID generic device to the board. The attached information prints out in the terminal.

  3. The following string prints in the terminal.
    Test string: This is a USB host HID generic demo. It only supports pid=0x00a2 and vid=0x1fc9 HID device. The host sends this test string to the device. The device echoes the data to the host and the host prints the data.

The following figure is an example for attaching one HID generic device.


Attach HID generic device

Supported Boards#

FRDM-K22F
Getting Started
Hardware Settings
  • The Jumper settings:\n J22 1-2.

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.

  • The external +5V power only port shoud be connected with a power USB cable to provide USB VBUS.

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.

  • The external +5V power only port shoud be connected with a power USB cable to provide USB VBUS.

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.

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.

  • The external +5V power only port shoud be connected with a power USB cable to provide USB VBUS.

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.

MCX-N5XX-EVK
Getting Started
Hardware Settings
  • The Jumper settings:\n J21 1-2.

FRDM-K32L2A4S
Getting Started
Hardware Settings
  • The Jumper settings:\n J9 1-2, J16 1-2.

MCX-N9XX-EVK
Getting Started
Hardware Settings
  • The Jumper settings:\n J21 1-2.