Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
---|---|
Safe Haskell | Trustworthy |
This module provides functions for performing standard device requests. The functions are primarily used for testing USB devices.
To avoid name clashes with functions from System.USB
it is advised to use
an explicit import list or a qualified import.
- setHalt :: DeviceHandle -> EndpointAddress -> Timeout -> IO ()
- setConfig :: DeviceHandle -> Maybe ConfigValue -> Timeout -> IO ()
- getConfig :: DeviceHandle -> Timeout -> IO (Maybe ConfigValue)
- clearRemoteWakeup :: DeviceHandle -> Timeout -> IO ()
- setRemoteWakeup :: DeviceHandle -> Timeout -> IO ()
- setStandardTestMode :: DeviceHandle -> TestMode -> Timeout -> IO ()
- data TestMode
- = Test_J
- | Test_K
- | Test_SE0_NAK
- | Test_Packet
- | Test_Force_Enable
- getInterfaceAltSetting :: DeviceHandle -> InterfaceNumber -> Timeout -> IO InterfaceAltSetting
- getDeviceStatus :: DeviceHandle -> Timeout -> IO DeviceStatus
- getEndpointStatus :: DeviceHandle -> EndpointAddress -> Timeout -> IO Bool
- setDeviceAddress :: DeviceHandle -> Word16 -> Timeout -> IO ()
- synchFrame :: DeviceHandle -> EndpointAddress -> Timeout -> IO FrameNumber
- type FrameNumber = Word16
Documentation
setHalt :: DeviceHandle -> EndpointAddress -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.9
setConfig :: DeviceHandle -> Maybe ConfigValue -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.7
This function is for testing purposes only!
You should normally use System.USB.DeviceHandling.
because
that function notifies the underlying operating system about the changed
configuration.
setConfig
getConfig :: DeviceHandle -> Timeout -> IO (Maybe ConfigValue)Source
See: USB 2.0 Spec. section 9.4.2
This function is for testing purposes only!
You should normally use System.USB.DeviceHandling.
because
that functon may exploit operating system caches (no I/O involved).
getConfig
clearRemoteWakeup :: DeviceHandle -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.1
setRemoteWakeup :: DeviceHandle -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.9
setStandardTestMode :: DeviceHandle -> TestMode -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.9 TODO: What about vendor-specific test modes?
See: USB 2.0 Spec. table 9-7
getInterfaceAltSetting :: DeviceHandle -> InterfaceNumber -> Timeout -> IO InterfaceAltSettingSource
See: USB 2.0 Spec. section 9.4.4
getDeviceStatus :: DeviceHandle -> Timeout -> IO DeviceStatusSource
See: USB 2.0 Spec. section 9.4.5
getEndpointStatus :: DeviceHandle -> EndpointAddress -> Timeout -> IO BoolSource
See: USB 2.0 Spec. section 9.4.5
setDeviceAddress :: DeviceHandle -> Word16 -> Timeout -> IO ()Source
See: USB 2.0 Spec. section 9.4.6
synchFrame :: DeviceHandle -> EndpointAddress -> Timeout -> IO FrameNumberSource
This request is used to set and then report an endpoint's synchronization frame.
When an endpoint supports isochronous transfers, the endpoint may also require per-frame transfers to vary in size according to a specific pattern. The host and the endpoint must agree on which frame the repeating pattern begins. The number of the frame in which the pattern began is returned to the host.
If a high-speed device supports the Synch Frame request, it must internally synchronize itself to the zeroth microframe and have a time notion of classic frame. Only the frame number is used to synchronize and reported by the device endpoint (i.e., no microframe number). The endpoint must synchronize to the zeroth microframe.
This value is only used for isochronous data transfers using implicit pattern synchronization. If the specified endpoint does not support this request, then the device will respond with a Request Error.
See: USB 2.0 Spec. section 9.4.11
type FrameNumber = Word16Source