STM32F7 17 Digital camera interface (DCMI)

Started by tha, December 02, 2022, 09:11:38 AM

Previous topic - Next topic

tha

17.5 Data format description

17.5.1 Data formats

สามประเภทของ data ถูกรองรับ:
•   8/10/12/14-bit progressive video: อย่างใดอย่างหนึ่ง monochrome หรือ raw Bayer format
•   YCbCr 4:2:2 progressive video
•   RGB565 progressive video. A pixel ที่โค้ดใน 16 bits (5 bits สำหรับ blue, 5 bits สำหรับ red, 6 bits สำหรับ green) ใช้
     two clock cycles ในการถูกส่งถ่าย.

Compressed data: JPEG

สำหรับ B&W, YCbCr or RGB data, the maximum input size คือ 2048 × 2048 pixels. ไม่จำกัดใน JPEG compressed mode.

สำหรับ monochrome, RGB & YCbCr, the frame buffer จะถูกเก็บใน raster mode. 32-bit words ถูกใช้. เฉพาะ the little endian format ถูกรองรับ.


tha

17.5.2 Monochrome format

ลักษณะเฉพาะ:
•   Raster format
•   8 bits ต่อ pixel

Table 110 แสดงวิธีที่ the data ถูกเก็บ.


tha

17.5.3 RGB format

ลักษณะเฉพาะ:
•   Raster format
•   RGB
•   Interleaved: one buffer: R, G & B interleaved: BRGBRGBRG, etc.
•   ปรับให้เหมาะสมสำหรับ display output

The RGB planar format เข้ากันได้กับ standard OS frame buffer display formats. เฉพาะ 16 BPP (bits ต่อ pixel): RGB565 (2 pixels ต่อ 32-bit word) ถูกรองรับ. The 24 BPP (palletized format) และ grayscale formats ไม่ถูกรองรับ. Pixels จะถูกเก็บใน a raster scan order, นั่นคือจากบนลงล่างสำหรับ pixel rows, และจากซ้ายไปขวาภายใน a pixel row. Pixel components คือ R (red), G (green) and B (blue). ส่วนประกอบทั้งหมดมีความละเอียดเชิงพื้นที่เดียวกัน (4:4:4 format). A frame ถูกจัดเก็บไว้ใน a single part, โดยมี the components สอดแทรกบน a pixel basis.

Table 111 แสดงวิธีที่ the data ถูกเก็บ



tha

17.5.4 YCbCr format

ลักษณะเฉพาะ:
•   Raster format
•   YCbCr 4:2:2
•   Interleaved: one Buffer: Y, Cb & Cr interleaved: CbYCrYCbYCr, etc.

Pixel components คือ Y (ความสว่างหรือ "luma"), Cb and Cr (chrominance or "chroma" blue and red). แต่ละส่วนประกอบถูกเข้ารหัสใน 8 bits. Luma and chroma จะถูกเก็บไว้ด้วยกัน (interleaved) ดังถูกแสดงใน Table 112.


tha

17.5.5 YCbCr format - Y only

ลักษณะเฉพาะ:
•   Raster format
•   YCbCr 4:2:2
•   The buffer บรรจุเฉพาะ Y information - monochrome image

Pixel components คือ Y (ความสว่างหรือ "luma"), Cb and Cr (chrominance or "chroma" blue and red). ในโหมดนี้ , the chroma information จะถูกทำตกหายไป. เฉพาะ Luma component ของแต่ละ pixel , ถูกเข้ารหัสใน 8 bits, ถูกเก็บดังถูกแสดงใน Table 113.

The result คือ a monochrome image มีความละเอียดเดียวกันกับ the original YCbCr data.


tha

17.5.6 Half resolution image extraction

นี่เป็นการปรับเปลี่ยนของ the previous reception modes, ซึ่งใช้ได้กับ monochrome, RGB หรือ Y extraction modes.

โหมดนี้อนุญาตให้เฉพาะเก็บ a half resolution image. มันถูกเลือกผ่านทาง OELS และ LSM control bits.

tha

17.6 DCMI interrupts

Five interrupts ถูกสร้าง. ทุก interrupts สามารถบังได้โดย software. The global interrupt (IT_DCMI) เป็นการ OR ของทุก the individual interrupts. Table 114 ให้รายการของทุก interrupts.


tha

17.7 DCMI register description

ทุก DCMI registers ต้องถูกเข้าถึงเป็น 32-bit words, มิฉะนั้น a bus error จะเกิดขึ้น.

17.7.1 DCMI control register (DCMI_CR)

Address offset: 0x00
Reset value: 0x0000 0000



Bits 31:21 Reserved, must be kept at reset value.

Bit 20 OELS: Odd/Even Line Select (Line Select Start)
     บิตนี้ทำงานร่วมกับ LSM field (LSM = 1)
     0: Interface จับ line แรกหลังจาก the frame start, line ที่สองถูกทำตกหาย
     1: Interface จับ line ที่สองจาก the frame start, line แรกถูกทำตกหาย

Bit 19 LSM: Line Select mode
     0: Interface จับทุก lines ที่รับ
     1: Interface จับหนึ่ง line ออกจากสอง.

Bit 18 OEBS: Odd/Even Byte Select (Byte Select Start)
     บิตนี้ทำงานร่วมกับ BSM field (BSM <> 00)
     0: Interface จับ first data (byte หรือ double byte) จาก the frame/line start, line ที่สองถูกทำตกหาย
     1: Interface จับ second data (byte หรือ double byte) จาก the frame/line start, line แรกถูกทำตกหาย

Bits 17:16 BSM[1:0]: Byte Select mode
     00: Interface จับทุก received data
     01: Interface จับทุกๆ byte จาก the received data
     10: Interface จับหนึ่ง byte ออกจากสี่
     11: Interface จับสอง byte ออกจากสี่
Note: โหมดนี้ทำงานเฉพาะสำหรับ EDM[1:0]=00. สำหรับทุกค่าอื่นของ EDM, bit field นี้ต้องถูกโปรแกรมเป็น the reset value.

Bit 15 Reserved, must be kept at reset value.

Bit 14 ENABLE: DCMI enable
     0: DCMI ถูกปิดใช้งาน
     1: DCMI ถูกเปิดใช้งาน
  Note: The DCMI configuration registers ควรถูกโปรแกรมอย่างถูกต้องก่อนการเปิดใช้งานบิตนี้

Bits 13:12 Reserved, must be kept at reset value.

Bits 11:10 EDM[1:0]: Extended data mode
     00: Interface จับ 8-bit data บนทุกๆ pixel clock
     01: Interface จับ 10-bit data บนทุกๆ pixel clock
     10: Interface จับ 12-bit data บนทุกๆ pixel clock
     11: Interface จับ 14-bit data บนทุกๆ pixel clock

Bits 9:8 FCRC[1:0]: Frame capture rate control
     บิตเหล่านี้กำหนดความถี่ของ frame capture. พวกเขามีความหมายเฉพาะใน Continuous grab mode. พวกเขาจะถูกเพิกเฉยใน
     snapshot mode.
     00: ทุก frames ถูกจับ
     01: ทุกๆ frame ที่สลับถูกจับ (50% bandwidth reduction)
     10: หนึ่ง frame ใน 4 frames ถูกจับ (75% bandwidth reduction)
     11: reserved