CY68014 FX3 DataSheet研读
USB Socket
The address specified by the external host (or device) is used to index data from/into one of the many entities called 'Sockets' which logically present themselves, at the interface, as a chain of buffers. The buffer chains themselves can be constructed in one of a several possible ways depending on the application.
Certain peripherals may contain tens of sockets, each associated with different buffer chains. To achieve reasonably high bandwidth on DMA transfers over sockets while maintaining reasonable AHB bus width, Socket requests for buffer reads/ writes are not directly time multiplexed; rather the sockets are grouped into threads, the requests of which are time multiplexed. Only one socket in a group can actively execute at any instant of time. The thread handling the socket group needs to be reconfigured every time a different socket in the group needs to execute. The thread-socket relations are handled by the thread controller. The DMA adapter block converts read/write queries on the threads to AHB requests and launches them on to the AHB. A single thread controller and DMA adapter block may be shared by more than one peripheral.
A socket of a peripheral can be configured to either write to or read from buffers, not both. As a convention, sockets used to write into system buffers are called 'Producers' and the direction of data flow in this case is referred to as 'Ingress'. Conversely, sockets used to read out system buffers are called 'Consumers' and the direction of data flow in this case is referred to as 'Egress'. Every socket has a set of registers, which indicate the status of the socket such as number of bytes transferred over the socket, current sub buffer being filled or emptied, location of the current buffer in memory, and no buffer available.
The EZ-USB FX3 FIFOs are associated with sockets. Sockets on the GPIF II side are similar to endpoints on the USB interface.
Stream
Another notable feature of USB 3.0 is the stream protocol available for bulk transfers. Normal bulk (OUT) transfers transfer a single stream of data to an endpoint in the device. Typically, each stream of data is sourced from a buffer (FIFO) in the transmitter to another buffer (FIFO) in the receiver. The stream protocol allows the transmitter to associate a stream ID (1-65536) with the current stream transfer/request. The receiver of the stream or request sources or sinks the data to/from the appropriate FIFO. This multiplexing of the streams achieves mimicking a pipe which can dynamically shift its ends. Streams make it possible to realize an out-of-order execution model required for command queuing. The concept of streams enable more powerful mass storage protocols. A typical communication link consists of a command OUT pipe, an IN and OUT pipe (with multiple data streams), and a status pipe. The host can queue commands, that is, issue a new command without waiting for completion of a prior one, tagging each command with a Stream ID.
Bulk streams are defined in the USB 3.0 specification as a mechanism to enhance the functionality of Bulk endpoints, by supporting multiple data streams on a single endpoint. When the FX3 is in USB 3.0 mode, the bulk endpoints support streams and burst type of data transfers. All active streams are actually mapped to USB sockets. Additional sockets that are not in use can be mapped to the stream enabled endpoints.
GPIO
There are eight complex IO pin groups, the elements of which are chosen in a modulo 8 fashion(complex IO group 0 – GPIO 0, 8, 16., complex IO group 1- GPIO 1,9,17., and so on). Each group can have different complex IO functions (like PWM, one shot and so on). However, only one pin from a group can use the complex IO functions. The rest of the pins in the group are either used as block IO or simple GPIO.
Pins belonging to the same block share the same group setting (say alpha) for drive strengths. Pins of a block overridden as GPIO share the same group setting (say beta) for their drive strength. FX3 provides software controlled pull up (50 kΏ) or pull down (10 kΏ) resistors internally on all digital I/O pins.
Any I/O can be configured as a simple GPIO, but only eight of the I/Os can be used as complex GPIOs. Only one of the I/Os with same result for (GPIO number % 8) can be chosen as complex GPIO.
Pins [30-32] are used as PMODE [0-2] inputs during boot. After boot, these are available as GPIOs.
io_cfg.gpioSimpleEn[0] = 0;
io_cfg.gpioSimpleEn[1] = 0x00002000; /* GPIO 45 */
io_cfg.gpioComplexEn[0] = 0;
io_cfg.gpioComplexEn[1] = 0;
Endpoint Configuration
When configured as a USB device, the FX3 has 32 endpoints. Endpoint 0 is the control endpoint in both IN and OUT directions, and the other 30 endpoints are fully configurable. The endpoints are mapped to USB sockets in the corresponding directions. The mapping is normally one-to-one and fixed – endpoint 1 is mapped to socket 1 and so on. The only exception is when one or more USB 3.0 bulk endpoints are enabled for bulk streams. In this case, it is possible to map additional sockets that are not in use to the stream enabled endpoints.Endpoint descriptors are formed by the application and passed to the USB driver which then completes the endpoint configuration. An API is provided to pass the configuration to the USB driver,this API must be invoked for each endpoint.
浙公网安备 33010602011771号