STM32F7 17 Digital camera interface (DCMI)

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

Previous topic - Next topic

tha

10-bit data

เมื่อ EDM[1:0] ใน DCMI_CR ถูกโปรแกรมเป็น "01", the camera interface ตรวจจับ 10-bit data ที่ input DCMI_D[0..9] ของมันและเก็บพวกมันเป็น the 10 least significant bits ของ a 16-bit word. The remaining most significant bits ใน the DCMI_DR register (bits 11 ถึง 15) จะถูกเคลียร์เป็นศูนย์. ดังนั้น, ในกรณีนี้, a 32-bit data word ถูกสร้างขึ้นทุกๆ two pixel clock cycles. 

The first captured data ถูกวางใน the LSB position ใน the 32-bit word และ the 2nd captured data ถูกวางใน the MSB position ใน the 32-bit word ดังแสดงใน Table 107.


tha

12-bit data

เมื่อ EDM[1:0] ใน DCMI_CR ถูกโปรแกรมเป็น "10", the camera interface ตรวจจับ the 12-bit data ที่ input DCMI_D[0..11] ของมันและเก็บพวกมันเป็น the 12 least significant bits ของ a 16-bit word. The remaining most significant bits จะถูกเคลียร์เป็นศูนย์. ดังนั้น, ในกรณีนี้ a 32-bit data word ถูกสร้างขึ้นทุกๆ two pixel clock cycles.

The first captured data ถูกวางใน the LSB position ใน the 32-bit word และ the 2nd captured data ถูกวางใน the MSB position ใน the 32-bit word ดังแสดงใน Table 108.


tha

14-bit data

เมื่อ EDM[1:0] ใน DCMI_CR ถูกโปรแกรมเป็น "11", the camera interface ตรวจจับ the 14-bit data ที่ input DCMI_D[0..13] ของมันและเก็บพวกมันเป็น the 14 least significant bits ของ a 16-bit word. The remaining most significant bits จะถูกเคลียร์เป็นศูนย์. ดังนั้น, ในกรณีนี้ a 32-bit data word ถูกสร้างขึ้นทุกๆ two pixel clock cycles.

The first captured data ถูกวางใน the LSB position ใน the 32-bit word และ the 2nd captured data ถูกวางใน the MSB position ใน the 32-bit word ดังแสดงใน Table 109.



tha

17.4.4 Synchronization

The digital camera interface รองรับ embedded or hardware (DCMI_HSYNC and DCMI_VSYNC) synchronization. เมื่อ embedded synchronization ถูกใช้, มันจะขึ้นอยู่กับ the digital camera module เพื่อให้แน่ใจว่า the 0x00 and 0xFF values ถูกใช้เฉพาะสำหรับ synchronization (ไม่ใน data). Embedded synchronization codes ถูกรองรับเฉพาะสำหรับ the 8-bit parallel data interface width (นั่นคือ, ใน the DCMI_CR register, the EDM[1:0] bits ควรถูกเคลียร์เป็น "00").

สำหรับ compressed data, the DCMI รองรับเฉพาะ the hardware synchronization mode. ในกรณีนี้, DCMI_VSYNC จะถูกใช้เป็น a start/end of the image, และ DCMI_HSYNC จะถูกใช้เป็น a Data Valid signal. Figure 105 แสดง the corresponding timing diagram.


tha

Hardware synchronization mode

ใน hardware synchronization mode, the two synchronization signals (DCMI_HSYNC/DCMI_VSYNC) ถูกใช้.

ขึ้นอยู่กับ the camera module/mode, data อาจถูกส่งในระหว่าง horizontal/vertical synchronization periods. The DCMI_HSYNC/DCMI_VSYNC signals ทำหน้าที่เหมือนกับ blanking signals เนื่องจากทุก the data ที่รับในระหว่าง DCMI_HSYNC/DCMI_VSYNC active periods ถูกเพิกเฉย.

เพื่อส่งถ่าย images อย่างถูกต้องลงใน the DMA/RAM buffer, data transfer จะถูกซิงโครไนซ์กับ the DCMI_VSYNC signal. เมื่อ the hardware synchronization mode ถูกเลือก, และ capture ถูกเปิดใช้งาน (CAPTURE bit ถูกเซ็ตใน DCMI_CR), data transfer จะถูกซิงโครไนซ์กับการทำให้ไม่ทำงานของ the DCMI_VSYNC signal (next start of frame).

Transfer จากนั้นสามารถต่อเนื่อง, ด้วย successive frames ที่ส่งถ่ายโดย DMA ไปยัง successive buffers หรือ the same/circular buffer. เพื่ออนุญาตให้ the DMA management ของ successive frames, a VSIF (Vertical synchronization interrupt flag) จะถูกทำให้ทำงานที่ the end ของแต่ละ frame.

tha

Embedded data synchronization mode

ใน synchronization mode นี้, the data flow จะถูกซิงโครไนซ์โดยใช้ 32-bit codes ที่ฝังอยู่ใน the data flow. โค้ดเหล่านี้ใช้ the 0x00/0xFF values ที่ไม่ถูกใช้ใน data อีกต่อไป. มี 4 ประเภทของ codes, ทั้งหมดมี a 0xFF0000XY format. The embedded synchronization codes จะรองรับเฉพาะใน 8-bit parallel data width capture (ใน the DCMI_CR register, the EDM[1:0] bits ควรถูกโปรแกรมเป็น "00"). สำหรับ data widths อื่นๆ, โหมดนี้จะสร้างผลลัพธ์ที่คาดเดาไม่ได้และห้ามใช้.

Note: Camera modules สามารถมี 8 โค้ดดังกล่าว (ใน interleaved mode). ด้วยเหตุนี้, the interleaved mode ไม่ถูกรองรับโดย the
          camera interface (มิฉะนั้น, ทุกๆ other half-frame จะถูกทิ้ง).

tha

•   Mode 2
     Four embedded codes ให้สัญญาน the following events
     –   Frame start (FS)
     –   Frame end (FE)
     –   Line start (LS)
     –   Line end (LE)

     The XY values ใน the 0xFF0000XY format ของ the four codes สามารถโปรแกรมได้ (ดู Section 17.7.7: DCMI
     embedded synchronization code register (DCMI_ESCR)).

     A 0xFF value ถูกโปรแกรมเป็น a "frame end" หมายความว่าทุก the unused codes จะถูกตีความเป็น valid frame end codes.

     ในโหมดนี้, ทันทีที่ the camera interface ถูกเปิดใช้งานแล้ว, the frame capture จะสตาร์ทหลังจากการเกิดขึ้นครั้งแรกของ the
     frame end (FE) code ถูกตามโดย a frame start (FS) code.

tha

•   Mode 1
     An alternative coding คือ the camera mode 1. โหมดนี้เข้ากันได้กับ ITU656.
     The codes ให้สัญญานชุดอื่นอีกชุดของ events:
     –   SAV (active line) - line start
     –   EAV (active line) - line end
     –   SAV (blanking) - end of line ในระหว่าง interframe blanking period
     –   EAV (blanking) - end of line ในระหว่าง interframe blanking period