GD32W51x User Manual
898
The DCI capture frequency is defined by FR[1:0] bits in continuous mode. For example, if
FR[1:0]=00, DCI captures each frame, and if FR[1:0]=01, DCI only captures every alternate
frame.
In continuous mode, software may clear the CAP bit any time when DCI is capturing data, but
DCI doesn’t stop capture immediately. It always stops after a complete frame ends. Software
should read back the CAP bit to know whether the DCI stops effectively.
25.5.4.
Window function
DCI supports window function which is able to cut a part of image from the captured frame.
Window function is enabled by setting WDEN bit in DCI_CTL register and this function is
disabled in JPEG mode.
DCI continuously counts and calculates pixels’ horizontal and vertical position during
capturing, and compares the position and the values in crop window registers (DCI_CWSPOS
and DCI_CWSZ), and then discards those pixels outside the crop window and only pushes
pixels inside the window into the pixel FIFO.
If a frame ends when the vertical lines size defined in DCI_CWSZ is not reached yet, the end
of frame flag will be triggered and DCI stops the capture.
25.5.5.
Pixel formats, data padding and DMA
DCI supports various pixel digital encoding formats including YCbCr422/RGB565. However,
DCI only receives these pixel data, pads these pixels into a word and push into a pixel FIFO.
DCI doesn’t perform any pixel format conversion or data processing and doesn’t care about
the detail of pixel format.
DCI uses a 32-bits width data buffer to transfer between DCI interface and pixel FIFO. These
are two padding method in this module: byte padding and half-word padding, depending on
the data width of DCI interface. Data width is configured by DCIF[1:0] in DCI_CTL register.
The data width is fixed to 8 in JPEG mode and embedded synchronization mode.
The DMA interface sends DMA request when FIFO is not empty.
Byte padding mode
Byte padding mode is used if data width of DCI interface is 8. In byte padding mode four bytes
are filled into the 32-bits width data buffer. In Non-JPEG mode, the DCI pushes the 32-bits
buffer’s data into the pixel FIFO when the buffer is full or meets the end of a line. In JPEG
mode, the DCI pushes the 32-bits buffer’s data into the pixel FIFO when the buffer is full or
meets the end of a frame.
Table 25-2. Memory
view in byte padding mode
D3[7:0]
D2[7:0]
D1[7:0]
D0[7:0]