COOLSTF.com DVB-SPI Interface -- USB Specification
Updated July 3, 2006
Introduction
The COOLSTF.com DVB-SPI Interface allow communications between USB 2.0 equipped computer and LVDS-based DVB-SPI interfaces. This document describes the USB endpoint protocol between the computer and interface. If you don't understand USB endpoints you have some reading to do - we suggest you look through the documentation on the USB Developer's Forums - www.usb.org.
Endpoints
The interface has five USB endpoints:
| EP0 IN/OUT | USB Setup - handled by OS |
| EP1 IN | Responses to EP1 OUT commands |
| EP1 OUT | Various commands - any responses send |
| EP2 IN | Bulk data returned from the tuner |
Endpoint 1
This endpoint has a maximum packet length of 64 bytes. If the OUT command has return data, that data is written to endpoint 1 IN which is then armed. The caller must perform a transfer on endpoint 1 IN to retrieve this data before the next OUT on endpoint 1 - failure to do so will result in the loss or corruption of data.
Command ID the first byte sent to the interface - any parameters required by the command immediately follow. Do not send any command-bytes other than those documented - some additional commands are used for firmware upgrading and are not publically available at this time. Sending one of these private commands might result in the firmware being erased from the EEPROM and this will render the interface unusable.
All values are decimal unless prefixed with 0x to indicate hexadecimal.
| Command ID | Function | Description |
| 7 | DMA Control | Enables and disables transfers on EP2 |
| 8 | Get Configuration | Returns configration information |
|
|
Set Transfer Mode | Selects between async (up to 60 Mbps) and sync (above 55 Mbps) |
Command 7 - DMA Control
out_buffer[0] = 7 out_buffer[1] = 0 (disable) or 1 (enable)
Sets up the FIFO inside the FX2 for transfers over endpoint 2 in bulk mode. This command should be given followed immediately by the transfer loop. Once that loop terminates, the DMA should be disabled.
Command 8 - Get Configration
out_buffer[0] = 8 in_buffer[0] = model in_buffer[1] = configuration
This command is used to get configuration information from the FX2. The first byte is the model number:
0x03 COOLSTf.com DVB-SPI interface
The second byte is a bit-field with the following bits currently defined:
0 USB connection speed: 0 on USB 1.1 or 1 if on USB 2.0. USB 1.1 is not supported.
Coomand 15 - Select transfer mode
Selects between async and synchronous transfers on the USB micro-controller.
out_buffer[0] = 15
out_buffer[1] = flag
The second byte (flag) is defined as follows:
0 Async mode - up to 60 Mbps 1 Sync mode - above 55 Mbps
Endpoint 2
This IN endpoint returns the MPEG data from the tuner. 512 bytes are transferred at a time. You should use a high priority thread and a tight loop with overlapped I/O to read data from the interface.