<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<IP DBVersion="V4.0" IPType="service" IpGroup="Multimedia" Name="DMA2D" Version="dma2d1_v1_0" 
    xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
    ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Modes.xsd"
    xmlns="http://mcd.rou.st.com/modules.php?name=mcu">
    <About>DMA2D: Chrom-ART Accelerator</About>

	
    <!-- Foreground layer Configuration for DMA2D --> 
    <RefParameter Name="Instance" DefaultValue="DMA2D$Index" Comment="Instance" Type="" Visible="false"/>
	
    <RefParameter Comment="Input Offset" DefaultValue="0" Max="16383" Min="0" Name="InputOffsetForeground" Type="integer" Group="Foreground layer Configuration">
        <Condition Expression="!R2M_semaphore" Diagnostic=""/>
    </RefParameter>
    <RefParameter Visible="false" Comment="Input Offset" DefaultValue="null"  Name="InputOffsetForeground" Type="list" Group="Foreground layer Configuration">
    </RefParameter>
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_ARGB8888" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="M2M_semaphore &amp;ARGB8888 " Diagnostic=""/>
        <PossibleValue Comment="ARGB8888 " Value="DMA2D_INPUT_ARGB8888"/>
    </RefParameter>
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_RGB888" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="M2M_semaphore &amp;RGB888 " Diagnostic=""/>
        <PossibleValue Comment="RGB888"   Value="DMA2D_INPUT_RGB888"/>
    </RefParameter> 
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_RGB565" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="M2M_semaphore &amp;RGB565 " Diagnostic=""/>
        <PossibleValue Comment="RGB565"   Value="DMA2D_INPUT_RGB565"/>
    </RefParameter>
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_ARGB1555" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="M2M_semaphore &amp;ARGB1555 " Diagnostic=""/>
        <PossibleValue Comment="ARGB1555"   Value="DMA2D_INPUT_ARGB1555"/>
    </RefParameter>
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_ARGB4444" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="M2M_semaphore &amp;ARGB4444 " Diagnostic=""/>
        <PossibleValue Comment="ARGB4444"   Value="DMA2D_INPUT_ARGB4444"/>
    </RefParameter>
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_ARGB8888" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="!R2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="ARGB8888 " Value="DMA2D_INPUT_ARGB8888"/>
        <PossibleValue Comment="RGB888 "   Value="DMA2D_INPUT_RGB888"/>
        <PossibleValue Comment="RGB565 "   Value="DMA2D_INPUT_RGB565"/>
        <PossibleValue Comment="ARGB1555 " Value="DMA2D_INPUT_ARGB1555"/>
        <PossibleValue Comment="ARGB4444 " Value="DMA2D_INPUT_ARGB4444"/>
        <PossibleValue Comment="L8 "       Value="DMA2D_INPUT_L8"/>
        <PossibleValue Comment="AL44 "     Value="DMA2D_INPUT_AL44"/>
        <PossibleValue Comment="AL88 "     Value="DMA2D_INPUT_AL88"/>
        <PossibleValue Comment="L4 "       Value="DMA2D_INPUT_L4"/>
        <PossibleValue Comment="A8 "       Value="DMA2D_INPUT_A8" Semaphore="A8_mode_Foreground"/>
        <PossibleValue Comment="A4 "       Value="DMA2D_INPUT_A4" Semaphore="A4_mode_Foreground"/>
    </RefParameter>
    <RefParameter Visible="false" Comment="DMA2D Input Color Mode" DefaultValue="null" Name="InputColorModeForeground" Type="list" Group="Foreground layer Configuration">

    </RefParameter>
	
    <RefParameter Comment="DMA2D ALPHA MODE" DefaultValue="DMA2D_NO_MODIF_ALPHA" Name="AlphaModeForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="!R2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="No modification of the alpha channel value" Value="DMA2D_NO_MODIF_ALPHA"/>
        <PossibleValue Comment="Replace original alpha channel"             Value="DMA2D_REPLACE_ALPHA"/>
        <PossibleValue Comment="Combine original alpha channel"             Value="DMA2D_COMBINE_ALPHA"/>
    </RefParameter>
	
    <RefParameter Visible="false" Comment="DMA2D ALPHA MODE" DefaultValue="null" Name="AlphaModeForeground" Type="list" Group="Foreground layer Configuration">
     
    </RefParameter>
	
    <RefParameter Comment="Input Alpha"  DefaultValue="0" Max="4294967295" Min="0" Name="InputAlphaForeground" Type="integer" Group="Foreground layer Configuration">
        <Condition Expression="!R2M_semaphore &amp; (A8_mode_Foreground|A4_mode_Foreground)" Diagnostic=""/>
    </RefParameter>
    <RefParameter Comment="Input Alpha"  DefaultValue="0" Max="255" Min="0" Name="InputAlphaForeground" Type="integer" Group="Foreground layer Configuration">
        <Condition Expression="!R2M_semaphore " Diagnostic=""/>
    </RefParameter>

    <RefParameter Visible="false" Comment="Input Alpha"  DefaultValue="null"  Name="InputAlphaForeground" Type="list" Group="Foreground layer Configuration">
    </RefParameter>
	
	
    <RefParameter Comment="DMA2D ALPHA Inversion" DefaultValue="DMA2D_REGULAR_ALPHA" Name="AlphaInvertedForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="(DIE461|DIE451|DIE470|DIE480|DIE450|DIE471|DIE483)&amp;!R2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="Regular Alpha"   Value="DMA2D_REGULAR_ALPHA"/>
        <PossibleValue Comment="Inverted Alpha"  Value="DMA2D_INVERTED_ALPHA"/>
     
    </RefParameter>
	
    <RefParameter Visible="false" Comment="DMA2D ALPHA Inversion" DefaultValue="null" Name="AlphaInvertedForeground" Type="list" Group="Foreground layer Configuration">
    </RefParameter>
    <RefParameter Comment="DMA2D Red and Blue swap" DefaultValue="DMA2D_RB_REGULAR" Name="RedBlueSwapForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="(DIE461|DIE451|DIE470|DIE480|DIE471|DIE450|DIE483)&amp;!R2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="Regular mode (RGB or ARGB)"   Value="DMA2D_RB_REGULAR"/>
        <PossibleValue Comment="Swap mode (BGR or ABGR)"      Value="DMA2D_RB_SWAP"/>
     
    </RefParameter>
	
    <RefParameter Visible="false" Comment="DMA2D Red and Blue swap" DefaultValue="null" Name="RedBlueSwapForeground" Type="list" Group="Foreground layer Configuration">
    </RefParameter>
	    <RefParameter  Comment="DMA2D Chroma Sub-Sampling Mode" DefaultValue="DMA2D_NO_CSS" Name="ChromaSubSamplingForeground" Type="list" Group="Foreground layer Configuration">
        <Condition Expression="(STM32H7) &amp; !R2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="No chroma sub-sampling 4:4:4"   Value="DMA2D_NO_CSS"/>
        <PossibleValue Comment="Chroma sub-sampling 4:2:2"      Value="DMA2D_CSS_422"/>
        <PossibleValue Comment="Chroma sub-sampling 4:2:0"      Value="DMA2D_CSS_420"/>
     
    </RefParameter>
	
    <RefParameter Visible="false" Comment="DMA2D Chroma Sub-Sampling Mode" DefaultValue="null" Name="ChromaSubSamplingForeground" Type="list" Group="Foreground layer Configuration">
    </RefParameter>
    
    <!-- Background layer Configuration for DMA2D --> 
	
    <RefParameter Comment="Input Offset" DefaultValue="0" Max="16383" Min="0" Name="InputOffsetBackground" Type="integer" Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore" Diagnostic=""/>
    </RefParameter>
    <RefParameter Visible="false" Comment="Input Offset" DefaultValue="null"  Name="InputOffsetBackground" Type="list" Group="Background layer Configuration">
    </RefParameter>
	
    <RefParameter Comment="DMA2D Input Color Mode" DefaultValue="DMA2D_INPUT_ARGB8888" Name="InputColorModeBackground" Type="list" Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore" Diagnostic=""/>
        <PossibleValue Comment="ARGB8888 " Value="DMA2D_INPUT_ARGB8888"/>
        <PossibleValue Comment="RGB888 "   Value="DMA2D_INPUT_RGB888"/>
        <PossibleValue Comment="RGB565 "   Value="DMA2D_INPUT_RGB565"/>
        <PossibleValue Comment="ARGB1555 " Value="DMA2D_INPUT_ARGB1555"/>
        <PossibleValue Comment="ARGB4444 " Value="DMA2D_INPUT_ARGB4444"/>
        <PossibleValue Comment="L8 "       Value="DMA2D_INPUT_L8"/>
        <PossibleValue Comment="AL44 "     Value="DMA2D_INPUT_AL44"/>
        <PossibleValue Comment="AL88 "     Value="DMA2D_INPUT_AL88"/>
        <PossibleValue Comment="L4 "       Value="DMA2D_INPUT_L4"/>
        <PossibleValue Comment="A8 "       Value="DMA2D_INPUT_A8" Semaphore="A8_mode_Background"/>
        <PossibleValue Comment="A4 "       Value="DMA2D_INPUT_A4" Semaphore="A4_mode_Background"/>
    </RefParameter>
    <RefParameter  Visible="false" Comment="DMA2D Input Color Mode" DefaultValue="null" Name="InputColorModeBackground" Type="list" Group="Background layer Configuration">

    </RefParameter>
	
    <RefParameter Comment="DMA2D ALPHA MODE" DefaultValue="DMA2D_NO_MODIF_ALPHA" Name="AlphaModeBackground" Type="list" Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore" Diagnostic=""/>

        <PossibleValue Comment="No modification of the alpha channel value" Value="DMA2D_NO_MODIF_ALPHA"/>
        <PossibleValue Comment="Replace original alpha channel"             Value="DMA2D_REPLACE_ALPHA"/>
        <PossibleValue Comment="Combine original alpha channel"             Value="DMA2D_COMBINE_ALPHA"/>
    </RefParameter>
    <RefParameter  Visible="false" Comment="DMA2D ALPHA MODE" DefaultValue="null" Name="AlphaModeBackground" Type="list" Group="Background layer Configuration">
      
    </RefParameter>
    <RefParameter Comment="Input Alpha" DefaultValue="0" Max="4294967295" Min="0" Name="InputAlphaBackground" Type="integer"   Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore &amp; (A4_mode_Background|A8_mode_Background)" Diagnostic=""/>
    </RefParameter>
    <RefParameter Comment="Input Alpha" DefaultValue="0" Max="255" Min="0" Name="InputAlphaBackground" Type="integer"   Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore " Diagnostic=""/>
    </RefParameter>
    <RefParameter Visible="false" Comment="Input Alpha" DefaultValue="null"  Name="InputAlphaBackground" Type="list"   Group="Background layer Configuration">
    </RefParameter>
	
    <RefParameter Comment="DMA2D ALPHA Inversion" DefaultValue="DMA2D_REGULAR_ALPHA" Name="AlphaInvertedBackground" Type="list" Group="Background layer Configuration">
        <Condition Expression=" M2M_BLEND_semaphore &amp; !STM32F4" Diagnostic=""/>

        <PossibleValue Comment="Regular Alpha"   Value="DMA2D_REGULAR_ALPHA"/>
        <PossibleValue Comment="Inverted Alpha"  Value="DMA2D_INVERTED_ALPHA"/>
     
    </RefParameter>
	
    <RefParameter Visible="false" Comment="DMA2D ALPHA Inversion" DefaultValue="null" Name="AlphaInvertedBackground" Type="list" Group="Background layer Configuration">
    </RefParameter>
    <RefParameter  Comment="DMA2D Red and Blue swap" DefaultValue="DMA2D_RB_REGULAR" Name="RedBlueSwapBackground" Type="list" Group="Background layer Configuration">
        <Condition Expression="M2M_BLEND_semaphore &amp; !STM32F4" Diagnostic=""/>

        <PossibleValue Comment="Regular mode (RGB or ARGB)"   Value="DMA2D_RB_REGULAR"/>
        <PossibleValue Comment="Swap mode (BGR or ABGR)"      Value="DMA2D_RB_SWAP"/>
     
    </RefParameter>
	 <RefParameter Visible="false" Comment="DMA2D Red and Blue swap" DefaultValue="null" Name="RedBlueSwapBackground" Type="list" Group="Background layer Configuration">
    </RefParameter>
	
	


	
    <!-- Configuration  DMA2D --> 
    <RefParameter Comment="Transfer Mode" DefaultValue="DMA2D_M2M" Name="Mode" Type="list" Group="Basic Parameters">
	<Condition Expression="DIE470" Diagnostic=""/>
        <PossibleValue Comment="Memory to Memory"                                Value="DMA2D_M2M"       Semaphore="M2M_semaphore"/>
        <PossibleValue Comment="Memory to Memory with 'Pixel Format Conversion'" Value="DMA2D_M2M_PFC"   Semaphore="M2M_PFC_semaphore"/>
        <PossibleValue Comment="Memory to Memory with Blending"                  Value="DMA2D_M2M_BLEND" Semaphore="M2M_BLEND_semaphore"/>
        <PossibleValue Comment="Register to Memory"                              Value="DMA2D_R2M"       Semaphore="R2M_semaphore"/>
        <PossibleValue Comment="memory to memory with blending transfer mode and fixed color FG"                     Value="DMA2D_M2M_BLEND_FG"       Semaphore="FG_M2M_semaphore"/>
        <PossibleValue Comment="memory to memory with blending transfer mode and fixed color BG"                     Value="DMA2D_M2M_BLEND_BG"       Semaphore="BG_M2M_semaphore"/>
    </RefParameter>   
	
    <RefParameter Comment="Transfer Mode" DefaultValue="DMA2D_M2M" Name="Mode" Type="list" Group="Basic Parameters">

        <PossibleValue Comment="Memory to Memory"                                Value="DMA2D_M2M"       Semaphore="M2M_semaphore"/>
        <PossibleValue Comment="Memory to Memory with 'Pixel Format Conversion'" Value="DMA2D_M2M_PFC"   Semaphore="M2M_PFC_semaphore"/>
        <PossibleValue Comment="Memory to Memory with Blending"                  Value="DMA2D_M2M_BLEND" Semaphore="M2M_BLEND_semaphore"/>
        <PossibleValue Comment="Register to Memory"                              Value="DMA2D_R2M"       Semaphore="R2M_semaphore"/>
        <PossibleValue Comment="memory to memory with blending transfer mode and fixed color FG"                     Value="DMA2D_M2M_BLEND_FG"       Semaphore="FG_M2M_semaphore"/>
        <PossibleValue Comment="memory to memory with blending transfer mode and fixed color BG"                     Value="DMA2D_M2M_BLEND_BG"       Semaphore="BG_M2M_semaphore"/>
    </RefParameter>
	
    <RefParameter Comment="Color Mode" DefaultValue="DMA2D_OUTPUT_ARGB8888" Name="ColorMode" Type="list" Group="Basic Parameters">
        <PossibleValue Comment="ARGB8888" Value="DMA2D_OUTPUT_ARGB8888" Semaphore="ARGB8888"/>
        <PossibleValue Comment="RGB888"   Value="DMA2D_OUTPUT_RGB888"   Semaphore="RGB888"/>
        <PossibleValue Comment="RGB565"   Value="DMA2D_OUTPUT_RGB565"   Semaphore="RGB565"/>
        <PossibleValue Comment="ARGB1555" Value="DMA2D_OUTPUT_ARGB1555" Semaphore="ARGB1555"/>
        <PossibleValue Comment="ARGB4444" Value="DMA2D_OUTPUT_ARGB4444" Semaphore="ARGB4444"/>
    </RefParameter>
	
    <RefParameter Comment="Output Offset"    DefaultValue="0" Max="16383" Min="0" Name="OutputOffset" Type="integer" Group="Basic Parameters"/>
	
	   
    <RefParameter Comment="DMA2D Bytes Swap" DefaultValue="DMA2D_BYTES_REGULAR" Name="BytesSwap" Type="list" Group="Basic Parameters">

        <PossibleValue Comment="Bytes in regular order in output FIFO"        Value="DMA2D_BYTES_REGULAR"/>
        <PossibleValue Comment="Bytes are swapped two by two in output FIFO"  Value="DMA2D_BYTES_SWAP"/>
     
    </RefParameter>
    <RefParameter Comment="DMA2D Bytes Swap" DefaultValue="null" Name="BytesSwap" Type="list" Group="Basic Parameters" Visible="false"/>
	
    <RefParameter Comment="DMA2D Line Offset Mode" DefaultValue="DMA2D_BYTES_REGULAR" Name="LineOffsetMode" Type="list" Group="Basic Parameters">

        <PossibleValue Comment="Line offsets expressed in pixels"        Value="DMA2D_LOM_PIXELS"/>
        <PossibleValue Comment="Line offsets expressed in bytes"         Value="DMA2D_LOM_BYTES"/>
     
    </RefParameter>
    <RefParameter Comment="DMA2D Line Offset Mode" DefaultValue="null" Name="LineOffsetMode" Type="list" Group="Basic Parameters" Visible="false"/>

	
    <RefParameter Comment="Output Offsetsdv" DefaultValue="1" Max="1" Min="1" Name="LayerIdxForeground" Type="integer"  Visible="false" Group="Basic Parameters">
        <Condition Expression="!R2M_semaphore" Diagnostic=""/>
    </RefParameter>
    <RefParameter Comment="Output Offsetsdv" DefaultValue="null"  Name="LayerIdxForeground" Type="list"  Visible="false" Group="Basic Parameters">
    </RefParameter>
    <RefParameter Comment="Output Offsetsdv" DefaultValue="0" Max="0" Min="0" Name="LayerIdxBackground" Type="integer" Visible="false" Group="Basic Parameters">
        <Condition Expression="M2M_BLEND_semaphore|FG_M2M_semaphore|BG_M2M_semaphore" Diagnostic=""/>
    </RefParameter>
	
    <RefParameter Comment="Output Offsetsdv" DefaultValue="null"  Name="LayerIdxBackground" Type="list" Visible="false" Group="Basic Parameters">
    </RefParameter>
	 <RefParameter Comment="DMA2DString for LL" DefaultValue="DMA2D"  Name="DMA2Dx" Type="string" Visible="false" Group="Basic Parameters">
    </RefParameter>
	
	

    <!-- RefModes for DMA2D -->
    <RefMode Name="DMA2D_Activate" >
        <ConfigForMode>Dma2D_Init</ConfigForMode>
        <ConfigForMode>DMA2D_ConfigLayerBackground</ConfigForMode>
        <ConfigForMode>DMA2D_ConfigLayerForeground</ConfigForMode>
        <Parameter Name="Mode"></Parameter>
        <Parameter Name="ColorMode"></Parameter>
        <Parameter Name="OutputOffset"></Parameter>
        <Parameter Name="BytesSwap"></Parameter>
        <Parameter Name="LineOffsetMode"></Parameter>
        <Parameter Name="InputColorModeForeground"></Parameter>
        <Parameter Name="AlphaModeForeground"></Parameter>
        <Parameter Name="InputAlphaForeground"></Parameter>
        <Parameter Name="InputOffsetForeground"></Parameter>
        <Parameter Name="AlphaInvertedForeground"></Parameter>
        <Parameter Name="RedBlueSwapForeground"></Parameter>  
        <Parameter Name="ChromaSubSamplingForeground"></Parameter>  
		
        <Parameter Name="InputColorModeBackground"></Parameter>
        <Parameter Name="AlphaModeBackground"></Parameter>
        <Parameter Name="InputAlphaBackground"></Parameter>
        <Parameter Name="InputOffsetBackground"></Parameter>
        <Parameter Name="AlphaInvertedBackground"></Parameter>
        <Parameter Name="RedBlueSwapBackground"></Parameter>
        
    </RefMode>

		
    <!-- ModeLogicOperator for DMA2D -->
    <ModeLogicOperator Name="OR">
        <Mode Name="DMA2D_Activate" UserName="Activated">
            <ModeLogicOperator Name="XOR">
                <Mode Name="DMA2D_Activate" UserName="Activated">
                    <SignalLogicalOp Name="AND">
                        <Signal Name="VS_DMA2D" />
                    </SignalLogicalOp>
                   
                </Mode>  
            </ModeLogicOperator>
              <!-- WARNING : MW_DMA2D_MW semaphore is also used by X-CUBE-TOUCHGFX -->
             <Semaphore>MW_DMA2D_MW</Semaphore>
        </Mode>
    </ModeLogicOperator>
	
    <!-- RefSignal for DMA2D -->
    <RefSignal Name="VS_DMA2D" Virtual="true"/>

    <!-- Semaphore for DMA2D -->
    <Semaphore>DMA2D_activated</Semaphore>
</IP>
