STM32F7 9 Chrom-ART Accelerator™ controller (DMA2D)

Started by tha, November 04, 2022, 08:17:21 AM

Previous topic - Next topic

tha

9 Chrom-ART Accelerator™ controller (DMA2D)

9.1 DMA2D introduction

The Chrom-ART Accelerator™ (DMA2D) เป็น a specialized DMA อุทิศให้กับการจัดการภาพ มันสามารถดำเนินการการทำงานดังต่อไปนี้:
•   เติมบางส่วนหรือทั้งหมดของภาพปลายทางด้วยสีเฉพาะ
•   คัดลอกบางส่วนหรือทั้งหมดของภาพต้นทางไปยังบางส่วนหรือทั้งหมดของภาพปลายทาง
•   คัดลอกบางส่วนหรือทั้งหมดของภาพต้นทางไปยังบางส่วนหรือทั้งหมดของภาพปลายทางด้วย a pixel format conversion
•   ผสมบางส่วนและ/หรือ two complete source images ด้วยรูปแบบพิกเซลที่แตกต่างกันและคัดลอกผลลัพธ์บางส่วนหรือทั้งหมดไปยัง
     บางส่วนหรือทั้งหมดของภาพปลายทางด้วยรูปแบบสีที่แตกต่างกัน.

ทุก the classical color coding schemes ถูกรองรับจาก 4-bit จนถึง 32-bit ต่อ pixel ด้วย indexed or direct color mode. The DMA2D มี dedicated memories ของมันเองสำหรับ CLUTs (color look-up tables).

tha

9.2 DMA2D main features

The main DMA2D features คือ:
•   Single AHB master bus architecture.
•   AHB slave programming interface รองรับ 8/16/32-bit accesses (ยกเว้นสำหรับ CLUT accesses ซึ่งเป็น 32-bit).
•   User programmable working area size
•   User programmable offset สำรับ sources and destination areas
•   User programmable sources and destination addresses บน the whole memory space
•   มากถึง 2 sources ที่มีการทำงานผสม
•   Alpha value สามารถถูกแก้ไข (source value, fixed value or modulated value)
•   User programmable source and destination color format
•   มากถึง 11 color formats ที่รองรับจาก 4-bit จนถึง 32-bit ต่อ pixel ด้วย indirect or direct color coding
•   2 internal memories สำหรับ CLUT storage ใน indirect color mode
•   Automatic CLUT loading หรือ CLUT programming โดยทาง the CPU
•   User programmable CLUT size
•   Internal timer เพื่อควบคุม AHB bandwidth
•   4 operating modes: register-to-memory, memory-to-memory, memory-to-memory with pixel format
     conversion, and memory-to-memory with pixel format conversion และการผสม
•   Area filling ด้วย a fixed color
•   คัดลอกจาก an area ไปยังที่อื่นๆ
•   คัดลอกด้วย pixel format conversion ระหว่าง source and destination images
•   คัดลอกจาก two sources ด้วยรูปแบบสีที่เป็นอิสระและการผสม
•   ทิ้งและระงับค้างไว้ DMA2D operations
•   Watermark interrupt บน a user programmable destination line
•   Interrupt generation บน bus error หรือ access conflict
•   Interrupt generation บน process completion

tha

9.3 DMA2D functional description

9.3.1 General description

The DMA2D controller ดำเนินการ direct memory transfer. ในฐานะที่เป็น an AHB master, มันสามารถใช้การควบคุมของ the AHB bus matrix เพื่อเริ่มต้น AHB transactions.

The DMA2D สามารถทำงานในโหมดต่อไปนี้:
•   Register-to-memory
•   Memory-to-memory
•   Memory-to-memory with Pixel Format Conversion
•   Memory-to-memory with Pixel Format Conversion and Blending

The AHB slave port ถูกใช้เพื่อโปรแกรม the DMA2D controller.

The block diagram of the DMA2D ถูกแสดงใน Figure 29: DMA2D block diagram.



tha

9.3.2 DMA2D control

The DMA2D controller ถูกกำหนดค่าผ่านทาง the DMA2D Control Register (DMA2D_CR) ซึ่งอนุญาตให้เลือก:

The user application สามารถดำเนินการการทำงานต่อไปนี้:
•   เลือก the operating mode
•   เปิดใช้งาน/ปิดใช้งาน the DMA2D interrupt
•   สตาร์ท/ระงับค้างไว้/ละทิ้ง ongoing data transfers

tha

9.3.3 DMA2D foreground and background FIFOs

The DMA2D foreground (FG) FG FIFO และ background (BG) FIFO ดึง the input data ที่จะถูกคัดลอกและ/หรือประมวลผล.

The FIFOs ดึง the pixels สอดคล้องกันกับ the color format ที่กำหนดใน pixel format converter (PFC) โดยเฉพาะของพวกมัน.

พวกมันถูกโปรแกรมผ่านทางชุดของ control registers:
•   DMA2D foreground memory address register (DMA2D_FGMAR)
•   DMA2D foreground offset register (DMA2D_FGOR)
•   DMA2D background memory address register (DMA2D_BGMAR)
•   DMA2D background offset register (DMA2D_BGBOR)
•   DMA2D number of lines register (จำนวนของ lines และ pixel ต่อ lines) (DMA2D_NLR)

เมื่อ the DMA2D ทำงานใน register-to-memory mode, จะไม่มี the FIFOs ถูกทำให้ทำงาน.

เมื่อ the DMA2D ทำงานใน memory-to-memory mode (ไม่มี pixel format conversion และไม่มี blending operation), มีเพียง the FG FIFO ที่ถูกทำให้ทำงงานและทำหน้าที่เป็น a buffer.

เมื่อ the DMA2D ทำงานใน memory-to-memory operation ที่มี pixel format conversion (ไม่มี blending operation), the BG FIFO ไม่ถูกทำให้ทำงาน.

tha

9.3.4 DMA2D foreground and background pixel format converter (PFC)

DMA2D foreground pixel format converter (PFC) และ background pixel format converter ดำเนินการ the pixel format conversion เพื่อสร้าง a 32-bit ต่อ pixel value. The PFC สามารถแก้ไข the alpha channel ได้อีกด้วย.

ขั้นตอนแรกของ the converter จะแปลง the color format. รูปแบบสีเริ่มแรกของ the foreground pixel and background pixels ถูกกำหนดค่าผ่านทาง the CM[3:0] bits ของ the DMA2D_FGPFCCR and DMA2D_BGPFCCR, ตามลำดับ.

The supported input formats ถูกให้ไว้ใน Table 35: Supported color mode in input


tha

The color format ถูกโค๊ดดังต่อไปนี้:
•   Alpha value field: ความโปร่งใส
    0xFF value ตรงกันกับพิกเซลทึบแสงและ 0x00 ตรงกันกับค่าโปร่งใส.
•   R field สำหรับสีแดง
•   G field สำหรับสีเขียว
•   B field สำหรับสีน้ำเงิน
•   L field: ความสว่าง
    ฟิลด์นี้เป็นดัชนีชี้ไปยัง a CLUT เพื่อดึงส่วนประกอบ สาม/สี่ RGB/ARGB.

ถ้ารูปแบบเริ่มแรกเป็น direct color mode (ARGB/RGB), จากนั้นการขยายเป็น 8-bit ต่อ channel ถูกดำเนินการโดยการคัดลอก the MSBs ลงใน the LSBs. นี้ทำให้แน่ใจว่าเป็นเส้นตรงที่สมบูรณ์แบบของการแปลง.

ถ้ารูปแบบเริ่มแรกเป็น indirect color mode (L/AL), a CLUT ถูกต้องการและแต่ละ pixel format converter จะถูกสัมพันธ์กันกับ a 256 รายการ 32-bit CLUT.

ถ้า the original format ไม่ได้รวม an alpha channel เอาไว้, the alpha value จะถูกเซ็ตโดยอัตโนมัติเป็น 0xFF (ทึบแสง).

สำหรับ the specific alpha mode A4 and A8, ไม่มี color information ถูกจัดเก็บและไม่ได้ถูกดัชนีชี้. The color ที่จะถูกใช้สำหรับ the image generation ถูกคงที่และถูกกำหนดใน the DMA2D_FGCOLR สำหรับ foreground pixels และใน the DMA2D_BGCOLR register สำหรับ background pixels.

ลำดับของ the fields ใน the system memory ถูกกำหนดใน Table 36: Data order in memory.


tha

The 24-bit RGB888 ที่วางแนวบน 32-bit ถูกรองรับผ่านทาง the ARGB8888 mode.

ทันทีที่ the 32-bit value ถูกสร้าง, the alpha channel สามารถถูกแก้ไขสอดคล้องกับ the AM[1:0] field ของ the DMA2D_FGPFCCR/DMA2D_BGPFCCR registers ดังแสดงใน Table 37: Alpha mode configuration.

The alpha channel สามารถเป็น:
•   เก็บไว้ตามที่มันเป็น (ไม่มีการแก้ไข),
•   ถูกแทนที่โดย the ALPHA[7:0] value of DMA2D_FGPFCCR/DMA2D_BGPFCCR,
•   หรือถูกแทนที่โดย the original alpha value ที่คูณโดย the ALPHA[7:0] value ของ DMA2D_FGPFCCR/DMA2D_BGPFCCR
     ที่หารโดย 255.