Wixel SDK
|
Go to the source code of this file.
Data Structures | |
struct | HID_KEYBOARD_OUT_REPORT |
struct | HID_KEYBOARD_IN_REPORT |
struct | HID_MOUSE_IN_REPORT |
struct | HID_JOYSTICK_IN_REPORT |
Typedefs | |
typedef struct HID_KEYBOARD_OUT_REPORT | HID_KEYBOARD_OUT_REPORT |
typedef struct HID_KEYBOARD_IN_REPORT | HID_KEYBOARD_IN_REPORT |
typedef struct HID_MOUSE_IN_REPORT | HID_MOUSE_IN_REPORT |
typedef struct HID_JOYSTICK_IN_REPORT | HID_JOYSTICK_IN_REPORT |
Functions | |
void | usbHidService (void) |
uint8 | usbHidKeyCodeFromAsciiChar (char asciiChar) |
The usb_hid.lib
library implements a composite USB device containing a keyboard interface and a mouse interface using the Human Interface Device (HID) class.
You can find the specification of the USB HID device class in HID1_11.pdf, available for download from USB Implementers Forum at this url: http://www.usb.org/developers/hidpage
A complete list of Usage tags used in HID reports, which define the format of the input and output data used by this library, can be found in Hut1_12.pdf on the same page.
(A listing of all class specification documents is at http://www.usb.org/devclass_docs)
Definition in file usb_hid.h.
uint8 usbHidKeyCodeFromAsciiChar | ( | char | asciiChar | ) |
Converts an ASCII-encoded character into the corresponding HID Key Code, suitable for the keyCodes array in HID_KEYBOARD_IN_REPORT. Note that many pairs of ASCII characters map to the same key code because they are on the same key. For example, both '4' and '$' map to 0x21 (KEY_4). To send a dollar sign to the computer, you must set the shift bit of the modifiers byte in the HID_KEYBOARD_IN_REPORT.
void usbHidService | ( | void | ) |
HID_JOYSTICK_IN_REPORT XDATA usbHidJoystickInput |
Contains input data sent in HID reports from the device's joystick interface to the host. You can use this variable to send joystick position and button data to the USB host. After writing data to this variable, set usbHidJoystickInputUpdated to 1 to tell the HID library to send that data to the computer.
BIT usbHidJoystickInputUpdated |
After writing data to usbHidJoystickInput, set this bit to 1 to trigger an HID report to be sent from the joystick interface to the host. This bit is cleared by the library once the report is sent.
HID_KEYBOARD_IN_REPORT XDATA usbHidKeyboardInput |
Contains input data to be sent from the keyboard interface to the host. You can use this variable to send key presses to the computer. After writing data to this struct, set usbHidKeyboardInputUpdated to 1 to tell the HID library to send that data to the computer. See HID_KEYBOARD_IN_REPORT for details.
BIT usbHidKeyboardInputUpdated |
After writing data to usbHidKeyboardInput, set this bit to 1 to trigger an HID report to be sent from the keyboard interface to the host. This bit is cleared by the library once the report is sent.
HID_KEYBOARD_OUT_REPORT XDATA usbHidKeyboardOutput |
Contains output data received by the keyboard interface from the host. If the Wixel is connected to a Windows machine, you can use this variable to determine whether the Caps Lock, Num Lock, or Scroll Lock options are active. This might not work on Linux or Mac OS computers. See HID_KEYBOARD_OUT_REPORT for details.
HID_MOUSE_IN_REPORT XDATA usbHidMouseInput |
Contains input data to be sent from the mouse interface to the host. You can use this variable to send X, Y and mouse wheel position changes to the computer and report the state of the mouse buttons. After writing data to this variable, set usbHidMouseInputUpdated to 1 to tell the HID library to send that data to the computer. See HID_MOUSE_IN_REPORT for details.
BIT usbHidMouseInputUpdated |
After writing data to usbHidMouseInput, set this bit to 1 to trigger an HID report to be sent from the mouse interface to the host. This bit is cleared by the library once the report is sent.