Presentation is loading. Please wait.

Presentation is loading. Please wait.

Human Interface Devices

Similar presentations


Presentation on theme: "Human Interface Devices"— Presentation transcript:

1 Human Interface Devices
EPICS Support

2 What are Human Interface Devices?
Mice Keyboards Presentation Remotes Joysticks Game Controllers Barcode Scanners Card Readers Variety of other devices

3 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

4

5

6 https://github.com/keenanlang/epics-usb
HID EPICS Support

7 HID EPICS Support Based on asynPortDriver from asyn EPICS module from Mark Rivers Descriptor file → asyn parameters Handles communications with the device in the background. Updates parameters as data changes.

8 Current Uses APS Open House Demonstration
Beamline Motor Control with Wireless Controller

9 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

10 Descriptor File One definition per line Example
Parameter_Name [Indicies] -> Parameter_Type Example X_AXIS_VALUE [0,1] -> UInt16

11 Descriptor File Optionally, there are bit shifts and bit masks available for data that doesn’t align to specific bytes. Name [Index] >> Shift -> Type /0xMask TEN_BIT_DATA [0,1] -> UInt16 /0x03FF OFFSET_DATA [1,2] >> 2 -> UInt16 /0x03FF

12 Single-bit True/False
Type Name Definition Asyn Type Int8 8-bit Integer asynInt32 UInt8 Unsigned 8-bit Integer Int16 16-bit Integer UInt16 Unsigned 16-bit Integer Int32 32-bit Integer Int8Array Array of 8-bit Integers asynInt8Array Int16Array Array of 16-bit Integers asynInt16Array Int32Array Array of 32-bit Integers asynInt32Array Float64 64-bit Floating Point asynFloat64 Float32Array 32-Bit Float Array asynFloat32Array Float64Array 64-Bit Float Array asynFloat64Array UInt32Digital 32-bit Bitmask Boolean Single-bit True/False String Character Array asynOctet

13 Driver Functions usbCreateDriver (portName, definitionFile)
Loads the definitions file to create the driver usbConnectDevice (portName, interface, vendorID, productID, serial) Connects the driver to a given device, serial is optional, interface=0 connects to the first available interface usbShowIO (portName, on_off) Displays the bytes the device sends every period

14 Driver Functions usbSetFrequency (portName, pollFreq)
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 usbSetTimeout (portName, timeout) Sets the number of seconds before the device is considered to have timed out. Useful for devices that only send out event data. UsbSetDelay (portName, delay) Sets the amount of time between attempting to reconnect to a disconnected device.

15 Example


Download ppt "Human Interface Devices"

Similar presentations


Ads by Google