Human Interface Devices EPICS Support What are Human









![Descriptor File One definition per line Parameter_Name [Indicies] -> Parameter_Type Example X_AXIS_VALUE [0, 1] Descriptor File One definition per line Parameter_Name [Indicies] -> Parameter_Type Example X_AXIS_VALUE [0, 1]](https://slidetodoc.com/presentation_image_h2/7fa525ce4abd26511a7f6a4dcaaecf5d/image-10.jpg)





- Slides: 15
Human Interface Devices EPICS Support
What are Human Interface Devices? Mice Keyboards Presentation Remotes Joysticks Game Controllers Barcode Scanners Card Readers Variety of other devices
Human Interface Devices Set of interfaces to communicate with a given device Generally, one interface per capability (Mouse + Keyboard = 2 interfaces) Interfaces are described by a USB descriptor You can find this information with the ‘lsusb’ command
HID EPICS Support https: //github. com/keenanlang/epics-usb
HID EPICS Support Based on asyn. Port. Driver from asyn EPICS module from Mark Rivers https: //github. com/epics-modules/asyn Descriptor file → asyn parameters Handles communications with the device in the background. Updates parameters as data changes.
Current Uses APS Open House Demonstration Beamline Motor Control with Wireless Controller
HID Driver Every device will send data over their interfaces on a periodic basis Just a set of raw bytes Descriptor file defines how to interpret that data into asyn parameters Compares new data to old data and only updates changed data
Descriptor File One definition per line Parameter_Name [Indicies] -> Parameter_Type Example X_AXIS_VALUE [0, 1] -> UInt 16
Descriptor File Optionally, there are bit shifts and bit masks available for data that doesn’t align to specific bytes. Name [Index] >> Shift -> Type /0 x. Mask TEN_BIT_DATA [0, 1] -> UInt 16 /0 x 03 FF OFFSET_DATA [1, 2] >> 2 -> UInt 16 /0 x 03 FF
Type Name Definition Asyn Type Int 8 8 -bit Integer asyn. Int 32 UInt 8 Unsigned 8 -bit Integer asyn. Int 32 Int 16 16 -bit Integer asyn. Int 32 UInt 16 Unsigned 16 -bit Integer asyn. Int 32 32 -bit Integer asyn. Int 32 Int 8 Array of 8 -bit Integers asyn. Int 8 Array Int 16 Array of 16 -bit Integers asyn. Int 16 Array Int 32 Array of 32 -bit Integers asyn. Int 32 Array Float 64 64 -bit Floating Point asyn. Float 64 Float 32 Array 32 -Bit Float Array asyn. Float 32 Array Float 64 Array 64 -Bit Float Array asyn. Float 64 Array UInt 32 Digital 32 -bit Bitmask UInt 32 Digital Boolean Single-bit True/False asyn. Int 32 String Character Array asyn. Octet
Driver Functions usb. Create. Driver (port. Name, definition. File) Loads the definitions file to create the driver usb. Connect. Device (port. Name, interface, vendor. ID, product. ID, serial) Connects the driver to a given device, serial is optional, interface=0 connects to the first available interface usb. Show. IO (port. Name, on_off) Displays the bytes the device sends every period
Driver Functions usb. Set. Frequency (port. Name, poll. Freq) Sets the polling frequency of the device for devices that have a constant connection. Many devices will only send information when an event happens. For those, leave this at 0. 0 usb. Set. Timeout (port. Name, timeout) Sets the number of seconds before the device is considered to have timed out. Useful for devices that only send out event data. Usb. Set. Delay (port. Name, delay) Sets the amount of time between attempting to reconnect to a disconnected device.
Example