R01UH0823EJ0100 Rev.1.00
Page 941 of 1823
Jul 31, 2019
RX23W Group
32. USB 2.0 Host/Function Module (USBc)
32.3.5.3
FIFO Port Functions
shows the settings for the FIFO port functions of the USB. In write access, writing data until the maximum
packet size is reached automatically enables transmission of the data. To enable transmission before the maximum packet
size is reached, the BVAL bit in the port control register should be set to end writing. To send a zero-length packet, the
BCLR bit in the register should be used to clear the buffer and then the BVAL bit set in order to end writing.
In reading, reception of new packets is automatically enabled when all data has been read. Data cannot be read when a
zero-length packet has been received (the DTLN[8:0] flags = 0), so the BCLR bit in the register should be used to clear
the buffer. The length of the receive data can be confirmed using the DTLN[8:0] flags in the port control register.
(1) FIFO Port Selection
shows the pipes that can be selected with the various FIFO ports. The pipe to be accessed should be
selected using the CURPIPE[3:0] bits in the port select register. After the pipe is selected, whether the written value can
be correctly read from the CURPIPE[3:0] bits should be checked. (If the previous pipe number is read, it indicates that
the pipe modification is being executed by the USB controller.) Then, the FRDY flag in a port control register = 1 is
checked.
In addition, the bus width to be accessed should be selected using the MBW bit in the port select register. The buffer
memory access direction conforms to the PIPECFG.DIR bit. Only for the DCP, the ISEL bit in the port select register
determines the direction.
(2) REW Bit
It is possible to temporarily stop access to the pipe currently being accessed, access a different pipe, and then continue
processing for the current pipe again. The REW bit in the port select register is used for this processing.
If a pipe is selected through the CURPIPE[3:0] bits in the port select register with the REW bit set to 1, the pointer used
for reading from and writing to the buffer memory is reset, and reading or writing can be carried out from the first byte.
If a pipe is selected with 0 set for the REW bit, data can be read and written in continuation from the previous selection,
without the pointer being reset.
To access the FIFO port, the FRDY flag in the port control register = 1 should be checked after selecting a pipe.
Table 32.19
FIFO Port Function Settings
Register Name
Bit Name
Description
CFIFOSEL,
DnFIFOSEL
(n = 0, 1)
RCNT
Selects DTLN read mode.
REW
Buffer memory rewind (re-read, rewrite).
DCLRM
Automatically clears receive data for a specified pipe after the data has been read (only for DnFIFO).
DREQE
Enables DMA/DTC transfers (only for DnFIFO).
MBW
FIFO port access bit width.
BIGEND
Selects FIFO port endian.
ISEL
FIFO port access direction (only for DCP).
CURPIPE
Selects the current pipe.
CFIFOCTR,
DnFIFOCTR
(n = 0, 1)
BVAL
Ends writing to the buffer memory.
BCLR
Clears the buffer memory on the CPU side.
DTLN
Checks the length of receive data.
Table 32.20
FIFO Port Access Categorized by Pipe
Pipe
Access Method
Port that can be Used
DCP
CPU access
CFIFO port register
PIPE1 to PIPE9
CPU access
CFIFO port register
D0FIFO/D1FIFO port register
DMAC/DTC access
D0FIFO/D1FIFO port register