STM32F7 17 Digital camera interface (DCMI)

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

Previous topic - Next topic

tha

Bit 7 VSPOL: Vertical synchronization polarity
     บิตนี้ระบุระดับบน the DCMI_VSYNC pin เมื่อ the data ใช้ไม่ได้บน the parallel interface.
     0: DCMI_VSYNC active low
     1: DCMI_VSYNC active high

Bit 6 HSPOL: Horizontal synchronization polarity
     บิตนี้ระบุระดับบน the DCMI_HSYNC pin เมื่อ the data ใช้ไม่ได้บน the parallel interface.
     0: DCMI_HSYNC active low
     1: DCMI_HSYNC active high

Bit 5 PCKPOL: Pixel clock polarity
     บิตนี้กำหนดค่า the capture edge ของ the pixel clock
     0: Falling edge active.
     1: Rising edge active.

Bit 4 ESS: Embedded synchronization select
     0: Hardware synchronization data capture (frame/line start/stop) ถูกซิงโครไนซ์กับ the
          DCMI_HSYNC/DCMI_VSYNC signals.
     1: Embedded synchronization data capture ถูกซิงโครไนซ์กับ synchronization codes ที่ฝังอยู่ใน the data flow.
  Note: ใช้ได้เฉพาะสำหรับ 8-bit parallel data. HSPOL/VSPOL จะถูกเพิกเฉยเมื่อ the ESS bit ถูกเซ็ต.
     บิตนี้ถูกปิดใช้งานใน JPEG mode.

tha

Bit 3 JPEG: JPEG format
     0: Uncompressed video format
     1: บิตนี้ถูกใช้สำหรับ JPEG data transfers. The DCMI_HSYNC signal ถูกใช้เป็น data enable. The crop และ embedded
          synchronization features (ESS bit) ไม่สามารถถูกใช้ในโหมดนี้.

Bit 2 CROP: Crop feature
     0: The full image ถูกจับ. ในกรณีนี้จำนวนทั้งหมดของ bytes ใน an image frame ควรเป็นผลคูณของ 4
     1: เฉพาะ the data ภายใน the window ที่ระบุโดย the crop register จะถูกจับ. ถ้าขนาดของ the crop window เกิน the
          picture size, ดังนั้นเฉพาะ the picture size เท่านั้นจะถูกจับ.

Bit 1 CM: Capture mode
     0: Continuous grab mode - The received data ถูกส่งถ่ายลงใน the destination memory ผ่านทาง the DMA. The
          buffer location และ mode (linear or circular buffer) ถูกควบคุมผ่านทาง the system DMA.
     1: Snapshot mode (single frame) - ทันทีที่ทำให้ทำงาน, the interface รอสำหรับ the start of frame และจากนั้นส่งถ่าย a
          single frame ผ่านทาง the DMA. ที่ the end of the frame, the CAPTURE bit จะถูกรีเซ็ตโดยอัตโนมัติ.

Bit 0 CAPTURE: Capture enable
     0: Capture ถูกปิดใช้งาน.
     1: Capture ถูกเปิดใช้งาน.
     The camera interface รอสำหรับ the first start of frame, จากนั้น a DMA request จะถูกสร้างเพื่อส่งถ่าย the received data
     ลงใน the destination memory.
     ใน snapshot mode, the CAPTURE bit จะถูกเคลียร์โดยอัตโนมัติที่ the end of the 1st frame ที่รับ.
     ใน continuous grab mode, ถ้า the software เคลียร์บิตนี้ในขณะที่ a capture กำลังดำเนินการอยู่, the bit จะถูกเคลียร์อย่างเป็น
     ผลหลังจาก the frame end.
  Note: The DMA controller และ all DCMI configuration registers ควรถูกโปรแกรมอย่างถูกต้องก่อนการเปิดใช้งานบิตนี้.

tha

17.7.2 DCMI status register (DCMI_SR)

Address offset: 0x04
Reset value: 0x0000 0000



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

Bit 2 FNE: FIFO not empty
     บิตนี้ให้ the status ของ the FIFO
     1: FIFO บรรจุ valid data
     0: FIFO ว่างเปล่า

Bit 1 VSYNC:
     บิตนี้ให้ the state of the DCMI_VSYNC pin ที่มี the correct programmed polarity.
     เมื่อ embedded synchronization codes ถูกใช้, ความหมายของบิตนี้เป็นดังต่อไปนี้:
     0: active frame
     1: synchronization ระหว่าง frames
     ในกรณีของ embedded synchronization, บิตนี้มีความหมายเฉพาะถ้า the CAPTURE bit ใน DCMI_CR ถูกเซ็ต.

Bit 0 HSYNC:
     บิตนี้ให้ the state of the DCMI_HSYNC pin ที่มี the correct programmed polarity.
     เมื่อ embedded synchronization codes ถูกใช้, ความหมายของบิตนี้เป็นดังต่อไปนี้:
     0: active line
     1: synchronization ระหว่าง lines
     ในกรณีของ embedded synchronization, บิตนี้มีความหมายเฉพาะถ้า the CAPTURE bit ใน DCMI_CR ถูกเซ็ต.


tha

17.7.3 DCMI raw interrupt status register (DCMI_RIS)

Address offset: 0x08
Reset value: 0x0000 0000



DCMI_RIS ให้ the raw interrupt status และสามารถเข้าถึงได้ในการอ่านเท่านั้น. เมื่ออ่าน, register นี้จะส่งคืนกลับ the status of the corresponding interrupt ก่อนการบังด้วย the DCMI_IER register value.

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

Bit 4 LINE_RIS: Line raw interrupt status
     บิตนี้จะเซ็ตเมื่อ the DCMI_HSYNC signal เปลี่ยนจาก the inactive state ไปเป็น the active state. มันไปเป็น high แม้ว่า the
     line ไม่ถูกต้อง.
     ในกรณีของ embedded synchronization, บิตนี้ถูกเซ็ตเฉพาะถ้า the CAPTURE bit ใน DCMI_CR ถูกเซ็ต.
     มันจะถูกเคลียร์โดยการเขียน a '1' ไปยัง the LINE_ISC bit ใน DCMI_ICR.

Bit 3 VSYNC_RIS: DCMI_VSYNC raw interrupt status
     บิตนี้จะเซ็ตเมื่อ the DCMI_VSYNC signal เปลี่ยนจาก the inactive state ไปเป็น the active state.
     ในกรณีของ embedded synchronization, บิตนี้ถูกเซ็ตเฉพาะถ้า the CAPTURE bit ใน DCMI_CR ถูกเซ็ต.
     มันจะถูกเคลียร์โดยการเขียน a '1' ไปยัง the VSYNC_ISC bit ใน DCMI_ICR.

Bit 2 ERR_RIS: Synchronization error raw interrupt status
     0: ไม่มี synchronization error ถูกตรวจพบ
     1: Embedded synchronization characters ไม่ถูกรับใน the correct order.
     บิตนี้ใช้ได้เฉพาะใน the embedded synchronization mode. มันจะถูกเคลียร์โดยการเขียน a '1' ไปยัง the ERR_ISC bit ใน
     DCMI_ICR.
  Note: บิตนี้มีให้ใชงานเฉพาะใน embedded synchronization mode.

Bit 1 OVR_RIS: Overrun raw interrupt status
     0: ไม่มี data buffer overrun เกิดขึ้น
     1: A data buffer overrun เกิดขึ้นและ the data FIFO เสียหาย.
     บิตนี้จะถูกเคลียร์โดยการเขียน a '1' ไปยัง the OVR_ISC bit ใน DCMI_ICR.

Bit 0 FRAME_RIS: Capture complete raw interrupt status
     0: ไม่มี new capture
     1: A frame ถูกจับแล้ว.
     บิตนี้ถูกเซ็ตเมื่อ a frame หรือ window ถูกจับแล้ว.
     ในกรณีของ a cropped window, บิตนี้จะถูกเซ็ตที่ the end of line of the last line ใน the crop. มันจะถูกเซ็ตถึงแม้ว่า the
     captured frame ว่างเปล่า (ตัวอย่างเช่น window ถูกครอบตัดภายนอก the frame).
     บิตนี้จะถูกเคลียร์โดยการเขียน a '1' ไปยัง the FRAME_ISC bit ใน DCMI_ICR.

tha

17.7.4 DCMI interrupt enable register (DCMI_IER)

Address offset: 0x0C
Reset value: 0x0000 0000



The DCMI_IER register ถูกใช้เพื่อเปิดใช้งาน interrupts. เมื่อหนึ่งใน the DCMI_IER bits ถูกเซ็ต, the corresponding interrupt จะถูกเปิดใช้งาน. รีจีสเตอร์นี้สามารถเข้าถึงได้ในทั้งอ่านและเขียน.

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

Bit 4 LINE_IE: Line interrupt enable
     0: ไม่มี interrupt generation เมื่อ the line ถูกรับ
     1: An Interrupt ถูกสร้างเมื่อ a line ถูกรับเสร็จสมบูรณ์แล้ว

Bit 3 VSYNC_IE: DCMI_VSYNC interrupt enable
     0: ไม่มี interrupt generation
     1: An interrupt ถูกสร้างบนแต่ละ DCMI_VSYNC transition จาก the inactive ไปเป็น the active state
     The active state ของ the DCMI_VSYNC signal ถูกกำหนดโดย the VSPOL bit.

Bit 2 ERR_IE: Synchronization error interrupt enable
     0: ไม่มี interrupt generation
     1: An interrupt ถูกสร้างถ้า the embedded synchronization codes ไม่ถูกรับใน the correct order.
  Note: บิตนี้มีให้ใชงานเฉพาะใน embedded synchronization mode.

Bit 1 OVR_IE: Overrun interrupt enable
     0: ไม่มี interrupt generation
     1: An interrupt ถูกสร้างถ้า the DMA ไม่สามารถส่งถ่าย the last data ก่อน new data (32-bit) ถูกรับ.

Bit 0 FRAME_IE: Capture complete interrupt enable
     0: ไม่มี interrupt generation
     1: An interrupt ถูกสร้างที่ the end ของแต่ละ received frame/crop window (ใน crop mode).

tha

17.7.5 DCMI masked interrupt status register (DCMI_MIS)

This DCMI_MIS register เป็น a read-only register. เมื่ออ่าน, มันจะส่งคืนกลับ the current masked status value (ขึ้นอยู่กับค่าใน DCMI_IER) ของ the corresponding interrupt. A bit ใน register นี้ถูกเซ็ตถ้า the corresponding enable bit ใน DCMI_IER ถูกเซ็ตและ the corresponding bit ใน DCMI_RIS ถูกเซ็ต.

Address offset: 0x10
Reset value: 0x0000 0000



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

Bit 4 LINE_MIS: Line masked interrupt status
     บิตนี้ให้ the status of the masked line interrupt
     0: ไม่มี interrupt generation เมื่อ the line ถูกรับ
     1: An Interrupt ถูกสร้างเมื่อ a line ถูกรับเสร็จสมบูรณ์แล้วและ the LINE_IE bit ถูกเซ็ตใน DCMI_IER.

Bit 3 VSYNC_MIS: VSYNC masked interrupt status
     บิตนี้ให้ the status of the masked VSYNC interrupt
     0: ไม่มี interrupt ถูกสร้างบน DCMI_VSYNC transitions
     1: An interrupt ถูกสร้างบนแต่ละ DCMI_VSYNC transition จาก the inactive ไปเป็น the active state และ the VSYNC_IE
         bit ถูกเซ็ตใน DCMI_IER.
     The active state ของ the DCMI_VSYNC signal ถูกกำหนดโดย the VSPOL bit.

Bit 2 ERR_MIS: Synchronization error masked interrupt status
     บิตนี้ให้ the status of the masked synchronization error interrupt
      0: ไม่มี interrupt ถูกสร้างบน a synchronization error
     1: An interrupt ถูกสร้างถ้า the embedded synchronization codes ไม่ถูกรับใน the correct order และ the ERR_IE bit ใน
         DCMI_IER ถูกเซ็ต.
  Note: บิตนี้มีให้ใชงานเฉพาะใน embedded synchronization mode.

Bit 1 OVR_MIS: Overrun masked interrupt status
     บิตนี้ให้ the status of the masked overflow interrupt
     0: ไม่มี interrupt ถูกสร้างบน overrun
     1: An interrupt ถูกสร้างถ้า the DMA ไม่สามารถส่งถ่าย the last data ก่อน new data (32-bit) ถูกรับและ the OVR_IE bit ถูก
         เซ็ตใน DCMI_IER.

Bit 0 FRAME_MIS: Capture complete masked interrupt status
     บิตนี้ให้ the status of the masked capture complete interrupt
     0: ไม่มี interrupt ถูกสร้างหลังจาก a complete capture
     1: An interrupt ถูกสร้างที่ the end ของแต่ละ received frame/crop window (ใน crop mode) และ the FRAME_IE bit ถูก
         เซ็ตใน DCMI_IER.

tha

17.7.6 DCMI interrupt clear register (DCMI_ICR)

Address offset: 0x14
Reset value: 0x0000 0000



The DCMI_ICR register เขียนได้อย่างเดียว. การเขียน a '1' ลงใน a bit ของรีจีสเตอร์นี้จะเคลียร์บิตที่ตรงกันใน the DCMI_RIS แลั DCMI_MIS registers. การเขียน a '0' ไม่มีผลอะไร.

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

Bit 4 LINE_ISC: line interrupt status clear
     การเขียน a '1' ลงในบิตนี้จะเคลียร์ LINE_RIS in the DCMI_RIS register

Bit 3 VSYNC_ISC: Vertical Synchronization interrupt status clear
     การเขียน a '1' ลงในบิตนี้จะเคลียร์ the VSYNC_RIS bit in DCMI_RIS

Bit 2 ERR_ISC: Synchronization error interrupt status clear
     การเขียน a '1' ลงในบิตนี้จะเคลียร์ the ERR_RIS bit in DCMI_RIS
   Note: บิตนี้มีให้ใชงานเฉพาะใน embedded synchronization mode.

Bit 1 OVR_ISC: Overrun interrupt status clear
     การเขียน a '1' ลงในบิตนี้จะเคลียร์ the OVR_RIS bit in DCMI_RIS

Bit 0 FRAME_ISC: Capture complete interrupt status clear
     การเขียน a '1' ลงในบิตนี้จะเคลียร์ the FRAME_RIS bit in DCMI_RIS

tha

17.7.7 DCMI embedded synchronization code register (DCMI_ESCR)

Address offset: 0x18
Reset value: 0x0000 0000



Bits 31:24 FEC[7:0]: Frame end delimiter code
     ไบต์นี้ระบุ the code of the frame end delimiter. The code ประกอบด้วย 4 ไบต์ในรูปแบบ 0xFF, 0x00, 0x00, FEC.
      ถ้า FEC ถูกโปรแกรมเป็น 0xFF, ทุก the unused codes (0xFF0000XY) จะถูกตีความเป็น frame end delimiters.

Bits 23:16 LEC[7:0]: Line end delimiter code
     ไบต์นี้ระบุ the code of the line end delimiter. The code ประกอบด้วย 4 ไบต์ในรูปแบบ 0xFF, 0x00, 0x00, LEC.

Bits 15:8 LSC[7:0]: Line start delimiter code
     ไบต์นี้ระบุ the code of the line start delimiter. The code ประกอบด้วย 4 ไบต์ในรูปแบบ 0xFF, 0x00, 0x00, LSC.

Bits 7:0 FSC[7:0]: Frame start delimiter code
     ไบต์นี้ระบุ the code of the frame start delimiter. The code ประกอบด้วย 4 ไบต์ในรูปแบบ 0xFF, 0x00, 0x00, FSC.
     ถ้า FSC ถูกโปรแกรมเป็น 0xFF, ไม่มี frame start delimiter ถูกตรวจพบ. แต่, the 1st occurrence ของ LSC หลังจาก an FEC
     code จะถูกตีความเป็น a start of frame delimiter.