STM32F7 9 Chrom-ART Accelerator™ controller (DMA2D)

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

Previous topic - Next topic

tha

Memory-to-memory

ใน memory-to-memory mode, the DMA2D ไม่ดำเนินการ graphical data transformation ใดๆ. The foreground input FIFO ทำหน้าที่เป็น a buffer และ the data จะถูกส่งถ่ายจาก the source memory location ที่กำหนดใน DMA2D_FGMAR ไปยัง the destination memory location ที่ชี้โดย DMA2D_OMAR.

The color mode ที่โปรแกรมใน the CM[3:0] bits of the DMA2D_FGPFCCR register กำหนดจำนวนของ bits ต่อ pixel สำหรับทั้ง input and output.

ขนาดของ the area ที่จะถูกส่งถ่ายถูกกำหนดโดย the DMA2D_NLR and DMA2D_FGOR registers สำหรับ the source, และโดย DMA2D_NLR and DMA2D_OOR registers สำหรับ the destination.

tha

Memory-to-memory with PFC

ในโหมดนี้, the DMA2D ดำเนินการ a pixel format conversion ของ the source data และเก็บพวกมันใน the destination memory location.

ขนาดของ the area ที่จะถูกส่งถ่ายถูกกำหนดโดย the DMA2D_NLR and DMA2D_FGOR registers สำหรับ the source, และโดย DMA2D_NLR and DMA2D_OOR registers สำหรับ the destination.

Data ถูกดึงจาก the location ที่กำหนดใน the DMA2D_FGMAR register และถูกประมวลผลโดย the foreground PFC. The original pixel format ถูกกำหนดค่าผ่านทาง the DMA2D_FGPFCCR register.

ถ้า the original pixel format เป็น direct color mode, ดังนั้น the color channels จะถูกขยายเป็น 8 bits ทั้งหมด.

ถ้า the pixel format เป็น indirect color mode, the associated CLUT ต้องถูกโหลดลงใน the CLUT memory.

tha

The CLUT loading สามารถถูกทำโดยอัตโนมัติโดยลำดับข้างล่างต่อไปนี้ :
1.   เซ็ต the CLUT address ลงใน the DMA2D_FGCMAR.
2.   เซ็ต the CLUT size ใน the CS[7:0] bits of the DMA2D_FGPFCCR register.
3.   เซ็ต the CLUT format (24 or 32 bits) ใน the CCM bit of the DMA2D_FGPFCCR register.
4.   สตาร์ท the CLUT loading โดยการเซ็ต the START bit of the DMA2D_FGPFCCR register.

ทันทีที่ the CLUT loading เสร็จสมบูรณ์, the CTCIF flag of the DMA2D_IFR register จะถูกทำให้พุ่งขึ้น, และ an interrupt จะถูกสร้างถ้า the CTCIE bit ถูกเซ็ตใน DMA2D_CR. The automatic CLUT loading process ไม่สามารถทำงานขนานไปกับ classical DMA2D transfers ได้.

The CLUT สามารถถูกเติมโดย the CPU หรือโดย master อื่นใดๆผ่านทาง the APB port. การเข้าถึงไปยัง the CLUT จะไม่สามารถทำได้เมื่อ a DMA2D transfer กำลังดำเนินการอยู่และใช้ the CLUT(indirect color format).


tha

ควบคู่ไปกับ the color conversion process, the alpha value สามารถถูกเพิ่มหรือเปลี่ยนแปลงได้ขึ้นอยู่กับ the value ที่โปรแกรมใน the DMA2D_FGPFCCR register. ถ้า the original image ไม่มี an alpha channel, a default alpha value of 0xFF จะถูกเพิ่มโดยอัตโนมัติเพื่อให้ได้ a fully opaque pixel. The alpha value สามารถถูกแก้ไขได้ตาม the AM[1:0] bits of the DMA2D_FGPFCCR register:
•   มันสามารถถูกไม่เปลี่ยนแปลง.
•   มันสามารถถูกแทนที่โดย the value ที่กำหนดใน the ALPHA[7:0] value of the DMA2D_FGPFCCR register.
•   มันสามารถถูกแทนที่โดย the original value ที่คูณด้วย the ALPHA[7:0] value of the DMA2D_FGPFCCR register ที่หารด้วย
     255.

The resulting 32-bit data ถูกเข้าระหัสโดย the OUT PFC ลงใน the format ที่ระบุโดย the CM[2:0] field of the DMA2D_OPFCCR register. The output pixel format ไม่สามารรถเป็น the indirect mode เนื่องจากไม่มี CLUT generation process ถูกรองรับ.

The processed data ถูกเขียนลงใน the destination memory location ที่ชี้โดย DMA2D_OMAR.

tha

Memory-to-memory with PFC and blending

ในโหมดนี้, 2 sources ถูกดึงมาใน the foreground FIFO และ background FIFO จาก the memory locations ที่กำหนดโดย DMA2D_FGMAR and DMA2D_BGMAR.

The two pixel format converters ต้องถูกกำหนดค่าตามที่อธิบายใน the memory-to-memory mode. configurations ของพวกมันสามารถแตกต่างกันเนื่องจากแต่ละ pixel format converter เป็นอิสระและมี CLUT memory เป็นของพวกมันเอง.

เมื่อแต่ละ pixel ถูกแปลงเป็น 32 bits แล้วโดย PFCs ที่เกี่ยวข้องของพวกมัน, พวกมันถูกผสมตามสมการข้างล่าง:



The resulting 32-bit pixel value ถูกเข้าระหัสโดย the output PFC ตาม the specified output format, และ the data จะถูกเขียนลงใน the destination memory location ที่ชี้โดย DMA2D_OMAR.

tha

Configuration error detection

The DMA2D เช็คว่า the configuration ถูกต้องก่อนการส่งถ่ายใดๆ. The configuration error interrupt flag ถูกเซ็ตโดย hardware เมื่อ a wrong configuration ถูกตรวจพบเมื่อ a new transfer/automatic loading สตาร์ท. An interrupt จากนั้นจะถูกสร้างถ้า the CEIE bit of the DMA2D_CR ถูกเซ็ต.

The wrong configurations ที่สามารถถูกตรวจพบได้ถูกแสดงรายการไว้ด้านล่าง:
•   Foreground CLUT automatic loading: MA bits of DMA2D_FGCMAR ไม่ถูกวางแนวเดียวกันกับ CCM of
     DMA2D_FGPFCCR.
•   Background CLUT automatic loading: MA bits of DMA2D_BGCMAR ไม่ถูกวางแนวเดียวกันกับ CCM of
     DMA2D_BGPFCCR
•   Memory transfer (ยกเว้นใน register-to-memory mode): MA bits of DMA2D_FGMAR ไม่ถูกวางแนวเดียวกันกับ CM of
     DMA2D_FGPFCCR
•   Memory transfer (ยกเว้นใน register-to-memory mode): CM bits of DMA2D_FGPFCCR ไม่ถูกต้อง
•   Memory transfer (ยกเว้นใน register-to-memory mode): PL bits of DMA2D_NLR เป็นคี่ในขณะที่ CM of
     DMA2D_FGPFCCR เป็น A4 or L4
•   Memory transfer (ยกเว้นใน register-to-memory mode): LO bits of DMA2D_FGOR เป็นคี่ในขณะที่ CM of
     DMA2D_FGPFCCR เป็น A4 or L4
•   Memory transfer (เฉพาะใน blending mode): MA bits of DMA2D_BGMAR ไม่ถูกวางแนวเดียวกันกับ the CM of
     DMA2D_BGPFCCR
•   Memory transfer: (เฉพาะใน blending mode) CM bits of DMA2D_BGPFCCR ไม่ถูกต้อง
•   Memory transfer (เฉพาะใน blending mode): PL bits of DMA2D_NLR เป็นคี่ในขณะที่ CM of DMA2D_BGPFCCR เป็น A4
     or L4
•   Memory transfer (เฉพาะใน blending mode): LO bits of DMA2D_BGOR เป็นคี่ในขณะที่ CM of DMA2D_BGPFCCR เป็น
     A4 or L4
•   Memory transfer (ยกเว้นใน memory to memory mode): MA bits of DMA2D_OMAR ไม่ถูกวางแนวเดียวกันกับ CM bits of
     DMA2D_OPFCCR.
•   Memory transfer (ยกเว้นใน memory to memory mode): CM bits of DMA2D_OPFCCR ไม่ถูกต้อง
•   Memory transfer: NL bits of DMA2D_NLR = 0
•   Memory transfer: PL bits of DMA2D_NLR = 0

tha

9.3.12 DMA2D transfer control (start, suspend, abort and completion)

ทันทีที่ the DMA2D ถูกกำหนดค่า, the transfer สามารถถูกเริ่มโดยการเซ็ต the START bit of the DMA2D_CR register. ทันทีที่ the transfer เสร็จสมบูรณ์, the START bit จะถูกรีเซ็ตโดยอัตโนมัติและ the TCIF flag of the DMA2D_ISR register จะถูกทำให้พุ่งขึ้น. An interrupt สามารถถูกสร้างถ้า the TCIE bit of the DMA2D_CR ถูกเซ็ต.

The user application สามารถระงับค้างไว้ the DMA2D ณ เวลาใดก็ได้โดยการเซ็ต the SUSP bit of the DMA2D_CR register. The transaction จากนั้นสามารถถูกยกเลิกโดยการเซ็ต the ABORT bit of the DMA2D_CR register หรือสามารถถูกรีสตาร์ทโดยการรีเซ็ต the SUSP bit of the DMA2D_CR register.

The user application สามารถยกเลิก an ongoing transaction ณ เวลาใดก็ได้โดยการเซ็ต the ABORT bit of the DMA2D_CR register. ในกรณีนี้, the TCIF flag ไม่ถูกทำให้พุ่งขึ้น.

Automatic CLUT transfers สามารถถูกยกเลิกหรือถูกระงับค้างไว้โดยการใช้ the ABORT or the SUSP bit of the DMA2D_CR register.

tha

9.3.13 Watermark

A watermark สามารถถูกโปรแกรมเพื่อสร้าง an interrupt เมื่อ the last pixel ของ a given line ถูกเขียนไปยัง the destination memory area แล้ว.

The line number ถูกกำหนดใน the LW[15:0] field of the DMA2D_LWR register.

เมื่อ the last pixel ของ line นี้ถูกส่งถ่ายแล้ว, the TWIF flag of the DMA2D_ISR register จะถูกทำให้พุ่งขึ้นและ an interrupt จะถูกสร้างถ้า the TWIE bit of the DMA2D_CR ถูกเซ็ต.