|
System.USB.IO.Synchronous | Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
|
|
|
|
|
Description |
|
|
Synopsis |
|
|
|
Documentation |
|
|
Handy type synonym for read transfers.
A ReadAction is a function which takes a Timeout and a Size which defines
how many bytes to read. The function returns an IO action which, when
executed, performs the actual read and returns the ByteString that was read
paired with an indication if the transfer timed out.
|
|
|
Handy type synonym for write transfers.
A WriteAction is a function which takes a Timeout and the ByteString to
write. The function returns an IO action which, when exectued, returns the
number of bytes that were actually written paired with an indication if the
transfer timed out.
|
|
|
A timeout in millseconds. A timeout defines how long a transfer should wait
before giving up due to no response being received. For no timeout, use value
0.
|
|
|
Number of bytes transferred.
|
|
Control transfers
|
|
|
Constructors | | Instances | |
|
|
|
Constructors | ToDevice | | ToInterface | | ToEndpoint | | ToOther | |
| Instances | |
|
|
|
:: DeviceHandle | A handle for the device to communicate with.
| -> RequestType | The type of request.
| -> Recipient | The recipient of the request.
| -> Word8 | Request.
| -> Word16 | Value.
| -> Word16 | Index.
| -> Timeout | Timeout (in milliseconds) that this function should
wait before giving up due to no response being
received. For no timeout, use value 0.
| -> IO () | | Perform a USB control request that does not transfer data.
The value and index values should be given in host-endian byte order.
Exceptions:
|
|
|
|
:: DeviceHandle | A handle for the device to communicate with.
| -> RequestType | The type of request.
| -> Recipient | The recipient of the request.
| -> Word8 | Request.
| -> Word16 | Value.
| -> Word16 | Index.
| -> ReadAction | | Perform a USB control read.
The value and index values should be given in host-endian byte order.
Exceptions:
|
|
|
|
:: DeviceHandle | A handle for the device to communicate with.
| -> RequestType | The type of request.
| -> Recipient | The recipient of the request.
| -> Word8 | Request.
| -> Word16 | Value.
| -> Word16 | Index.
| -> WriteAction | | Perform a USB control write.
The value and index values should be given in host-endian byte order.
Exceptions:
|
|
|
Standard Device Requests
|
|
|
See: USB 2.0 Spec. section 9.4.9
|
|
|
See: USB 2.0 Spec. section 9.4.1
|
|
|
See: USB 2.0 Spec. section 9.4.9
|
|
|
See: USB 2.0 Spec. section 9.4.9
TODO: What about vendor-specific test modes?
|
|
|
See: USB 2.0 Spec. table 9-7
| Constructors | Test_J | | Test_K | | Test_SE0_NAK | | Test_Packet | | Test_Force_Enable | |
| Instances | |
|
|
|
See: USB 2.0 Spec. section 9.4.4
|
|
|
See: USB 2.0 Spec. section 9.4.5
|
|
|
See: USB 2.0 Spec. section 9.4.5
|
|
|
See: USB 2.0 Spec. section 9.4.6
|
|
|
See: USB 2.0 Spec. section 9.4.11
|
|
Bulk transfers
|
|
|
:: DeviceHandle | A handle for the device to communicate
with.
| -> EndpointAddress | The address of a valid In and Bulk
endpoint to communicate with. Make sure the
endpoint belongs to the current alternate
setting of a claimed interface which belongs
to the device.
| -> ReadAction | | Perform a USB bulk read.
Exceptions:
|
|
|
|
:: DeviceHandle | A handle for the device to communicate
with.
| -> EndpointAddress | The address of a valid Out and Bulk
endpoint to communicate with. Make sure
the endpoint belongs to the current
alternate setting of a claimed interface
which belongs to the device.
| -> WriteAction | | Perform a USB bulk write.
Exceptions:
|
|
|
Interrupt transfers
|
|
|
:: DeviceHandle | A handle for the device to communicate
with.
| -> EndpointAddress | The address of a valid In and
Interrupt endpoint to communicate
with. Make sure the endpoint belongs to
the current alternate setting of a
claimed interface which belongs to the
device.
| -> ReadAction | | Perform a USB interrupt read.
Exceptions:
|
|
|
|
:: DeviceHandle | A handle for the device to
communicate with.
| -> EndpointAddress | The address of a valid Out and
Interrupt endpoint to communicate
with. Make sure the endpoint belongs
to the current alternate setting of a
claimed interface which belongs to
the device.
| -> WriteAction | | Perform a USB interrupt write.
Exceptions:
|
|
|
Produced by Haddock version 2.4.2 |