User`s manual

RSK+ RX62N Applications
R20UT0255EG0100 Page 16 of 16
August 26, 2010
Program the RSK with the HID application and run the code. Connect a USB cable between the PC and the RSK. The first time the device
is connected to a specific USB port windows will detect the new device and automatically load the intrinsic HID class driver.
When windows has completed the enumeration process you need to make a connection from the application to the target. Click the
“Connect” button and you will be asked to confirm the VID and PID of the device you wish to connect with. If you have not altered the
firmware on the RSK to use your own VID and PID then the defaults will be correct. When a connection is successfully made information
about the device will be displayed and the rest of the buttons will be enabled.
The “Toggle LED” button enables a LED on the RSK to be toggled on and off.
The “Read ADC” button will command the RSK to read its ADC and return the value back to the host where it will be displayed.
The “Set LCD” button allows the text of the LCD on the RSK to be changed.
To demonstrate that the RSK can also instigate communications you can press a switch on the RSK and this will be indicated back to the
host resulting in a message being displayed on the dialog.
This demonstrates that Input and Output HID reports are being sent successfully between the RSK and the PC. The format of the reports
is as follows:
Input Report:
Byte 1
Bit 0 = LED status.
Bit 1 = ADC value valid indicator.
Bit 2 = Switch pressed indicator.
Byte 2-5 = 32 bit, little endian ADC Value.
Output Report:
Byte 1
Bit 0 = LED toggle request.
Bit 1 = ADC read request.
Bit 2 = LCD set request.
Byte 2-17 = 16 ASCII Characters for LCD.
An input report is sent whenever a switch on the RSK is pressed or when the host requests a report.
An output report is sent whenever a user clicks on one of the dialog buttons.
The HID application functionality specific to USB consists of the following files:-
Target:
usb_hid_app.c
usb_hid_app.h
Host Application:
\PC\RSK_HID\...