![ARTERY AT32F435 Series Reference Manual Download Page 651](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592651.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 651
Rev 2.03
27.6.4 Grayscale image binarization conversion
The grayscale image binarization conversion unit is used to convert the luminance into one-bit format.
To enable this feature, set EFDM=1, and program the EFDF bit based on the output format of CMOS
video camera. Refer to Section 27.7.3 for more information. The MIBE bit is set in the DVP_ACTRL
register to enable grayscale image binarization conversion feature.
The MIBTHD bit in the DVP_BTH register is used to program the grayscale image binarization threshold.
The value above the threshold is deemed to 1, while the value below the threshold is deemed to 0. This
feature becomes invalid if the luminance format of an image data cannot be fetched directly.
27.7 Data formats
27.7.1 Common CMOS video camera output formats
The CMOS video camera offers various image output formats. This section only gives a brief account of
common data formats.
RGB565 format
In this format, one half-word data pixel (16 bit) is output every two pixel clocks. Each half-word data
contains three types of pixel components: R (red), Green (G) and Blue (B), which are encoded in 5-bit,
6-bit and 5-bit format respectively. The first pixel clock outputs the lower part of R and G components,
the second pixel clock outputs the upper part of G component, and B component. Or the first pixel clock
outputs the lower part of B and G components, and the second pixel clock outputs the upper part of G
component, and R component. Figure 27-14 gives an example of DVP data capture and packing in
RGB565 format.
Figure 27-14 RGB565-format data capture and packing
D0
15
1110
5 4
0
31
2726
2120
16
R0
G0
RGB565 (RGB)
B0
R1
G1
B1
7
3 2
0
7
5 4
0
R[4:0]
G[2:0]
B[4:0]
G[5:3]
D1
D0
15
1110
5 4
0
31
2726
2120
16
B0
G0
RGB565 (BGR)
R0
B1
G1
R1
7
3 2
0
7
5 4
0
B[4:0]
G[2:0]
R[4:0]
G[5:3]
D1
RGB555 format
In this format, one half-word data pixel (16 bit) is output every two pixel clocks. Each half-word data
contains three types of pixel components: R (red), Green (G) and Blue (B), which are encoded in 5-bit
format. The first pixel clock outputs the lower part of R and G components, the second pixel clock outputs
the upper part of G component, and B component. Or the first pixel clock outputs the lower part of B and
G components, and the second pixel clock outputs the upper part of G component, and R component.
As the valid data has a total of 15 bits, the upper part of the second pixel clock are not actually used.
Typically, the CMOS video camera directly outputs a low level. Figure 27-15 gives an example of DVP
data capture and packing in RGB555 format.