Component: USB HID (Comms: USB)
Author | Matrix Ltd |
Version | 1.3 (Release) |
Category | Comms: USB |
Contents
USB HID component
Component to create and communicate using a standard HID type USB class. Compatible with simulation and USB enabled microcontroller devices PIC/dsPIC/AVR. Note that AVR is currently in Beta and may have problems with custom descriptors.
Examples
No additional examples
Downloadable macro reference
ReceiveByte
Receives a byte from the USB.
Parameters
- BYTE Idx
Return value
SetSerialNumber
Allows the device serial number to be edited.
Parameters
- <- STRING SerialNumber
- This parameter may be returned back to the caller
Return value
- This call does not return a value
SendData
Sends the contents of the transmit buffer to the USB.
Parameters
- This macro has no parameters
Return value
CheckRx
Checks for any incoming data.
Returns the number of data bytes received since the last check.
Parameters
- This macro has no parameters
Return value
UpdateData
Allows a byte of the transmit buffer to be assigned.
Parameters
- BYTE idx
- BYTE value
Return value
- This call does not return a value
ReceiveString
Receives a string of bytes from the USB
Parameters
- BYTE NumBytes
Return value
SendDataDirect
Sends data directly to the USB
Parameters
- <- STRING Data
- This parameter may be returned back to the caller
Return value
Initialise
Starts up the USB connection and waits for the device driver to be correctly installed on the PC.
Parameters
- This macro has no parameters
Return value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Vendor ID
This property is of type Signed integer and can be referenced with the variable name vendor_ID.
USB vendor identifier tied to the manufacturer of the USB device
Product ID
This property is of type Signed integer and can be referenced with the variable name product_ID.
USB product identifier
Device Name
This property is of type Line of text and can be referenced with the variable name dev_name.
Name used to identify the device
Manufacturer
This property is of type Line of text and can be referenced with the variable name dev_manufacturer.
Manufacturer of the device
Major Version
This property is of type Signed integer and can be referenced with the variable name major_version.
Firmware major version
Minor Version
This property is of type Signed integer and can be referenced with the variable name minor_version.
Device firmware minor version
Enumeration Timeout
This property is of type True or false and can be referenced with the variable name enumeration_tout.
Specifies if the initialise routine is allowed to timeout instead of waiting forever for success
Maximum Current (mA)
This property is of type Signed integer and can be referenced with the variable name max_current.
Maximum current the host should source to the device - max 500mA
Country Code
This property is of type Fixed list of ints and can be referenced with the variable name cntry_code.
Specific country code - if required
Descriptor Select
This property is of type Fixed list of ints and can be referenced with the variable name descriptor_Select.
Built in descriptor selection
HID Descriptor
This property is of type Multiple lines of text and can be referenced with the variable name HID_descriptor.
Contents of the HID descriptor
Subclass
This property is of type Fixed list of ints and can be referenced with the variable name subclass.
USB Subclass - Normally only mice and keyboards are boot devices
Interface
This property is of type Fixed list of ints and can be referenced with the variable name interface.
Standard HID interface type
Transmit Packet Size
This property is of type Signed integer and can be referenced with the variable name tx_packet_size.
Number of bytes to send to the PC
Transmit Period (ms)
This property is of type Signed integer and can be referenced with the variable name tx_period.
Delay between transmit packets
Receive Packet Size
This property is of type Signed integer and can be referenced with the variable name rx_packet_size.
Number of bytes to receive from the PC
Receive Period (ms)
This property is of type Signed integer and can be referenced with the variable name rx_period.
Delay between receive packets
Label
This property is of type Line of text and can be referenced with the variable name label.
Simulation label used to indicate the USB HID component on the panel.