<?xml version="1.0" encoding="UTF-8" standalone="no"?><IP xmlns="http://mcd.rou.st.com/modules.php?name=mcu" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance" DBVersion="V4.0" IPType="peripheral" Name="COMP" Version="advsmu_v3_6_Cube" ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Modes.xsd">
	<About>COMP: Ultra-Low-Power Comparator</About>

	<!-- Pinout Parameters for COMP 1/2 for BigScorpio & Scorpio2 (Category 2/3/4/5). Already selected on Pinout TreeView -->
	<RefParameter Comment="Inverting Input" DefaultValue="null" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="$IpNumber=1"/>
        <PossibleValue Comment="External I/O (COMP1 : Internal Connection to VREFINT)" Value="COMP_INVERTINGINPUT_IO"/>
		<Description>Selects the Inverting Input of the Comparator.</Description>
    </RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_IO" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="$IpNumber=2"/>
        <PossibleValue Comment="External I/O (COMP2_INM connected to pin PB3) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_IO"/>
        <PossibleValue Comment="VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_VREFINT"/>
        <PossibleValue Comment="3/4 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_3_4VREFINT"/>
        <PossibleValue Comment="1/2 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_1_2VREFINT"/>
        <PossibleValue Comment="1/4 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_1_4VREFINT"/>
        <PossibleValue Comment="DAC_OUT1 (PA4) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_DAC1"/>
        <PossibleValue Comment="DAC2_OUT (PA5) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_DAC2"/>
		<Description>Selects the Inverting Input of the Comparator.</Description>
    </RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_1_2VREFINT" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
        <PossibleValue Comment="External I/O (COMP2_INM connected to pin PB3) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_IO"/>
        <PossibleValue Comment="VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_VREFINT"/>
        <PossibleValue Comment="3/4 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_3_4VREFINT"/>
        <PossibleValue Comment="1/2 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_1_2VREFINT"/>
        <PossibleValue Comment="1/4 VREFINT connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_1_4VREFINT"/>
        <PossibleValue Comment="DAC_OUT1 (PA4) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_DAC1"/>
        <PossibleValue Comment="DAC2_OUT (PA5) connected to comparator 2 inverting input " Value="COMP_INVERTINGINPUT_DAC2"/>
		<Description>Selects the inverting input of the comparator.</Description>
    </RefParameter>
	
	
	<!-- Pinout of Non-Inverting Input for COMP1 -->
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA0" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA0_COMP1_INP &amp; ($IpNumber=1)"/>
		<PossibleValue Comment="I/O pin PA0 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA0"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA1" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA1_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA1 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA1"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA2" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA2_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA2 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA2"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA3" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA3_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA3 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA3"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA4" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA4_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA4 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA4"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA5" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA5_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA5 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA5"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA6" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA6_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA6 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA6"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PA7" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PA7_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PA7 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PA7"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB0" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB0_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB0 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB0"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB1" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB1_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB1 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB1"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB12" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB12_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB12 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB12"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB13" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB13_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB13 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB13"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB14" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB14_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB14 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB14"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB15" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB15_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PB15 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB15"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC0" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC0_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC0 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC0"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC1" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC1_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC1 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC1"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC2" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC2_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC2 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC2"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC3" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC3_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC3 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC3"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC4" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC4_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC4 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC4"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PC5" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PC5_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PC5 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PC5"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PE7" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PE7_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PE7 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PE7"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PE8" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PE8_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PE8 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PE8"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PE9" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PE9_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PE9 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PE9"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PE10" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PE10_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PE10 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PE10"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PF6" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PF6_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PF6 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PF6"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PF7" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PF7_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PF7 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PF7"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PF8" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PF8_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PF8 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PF8"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PF9" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PF9_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PF9 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PF9"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PF10" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PF10_COMP1_INP &amp; ($IpNumber=1)"/>
        <PossibleValue Comment="I/O pin PF10 connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_PF10"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	
	<!-- Pinout of Non-Inverting Input for COMP2 -->
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB4" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB4_COMP2_INP &amp; ($IpNumber=2)"/>
        <PossibleValue Comment="I/O pin PB4 connection to COMP2 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB4"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB5" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="PB5_COMP2_INP &amp; ($IpNumber=2)"/>
		<PossibleValue Comment="I/O pin PB5 connection to COMP2 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB5"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB6" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB6_COMP2_INP &amp; ($IpNumber=2)"/>
        <PossibleValue Comment="I/O pin PB6 connection to COMP2 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB6"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_PB7" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="PB7_COMP2_INP &amp; ($IpNumber=2)"/>
        <PossibleValue Comment="I/O pin PB7 connection to COMP2 non-inverting input " Value="COMP_NONINVERTINGINPUT_PB7"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>
	
	<!-- Pinout of Non-Inverting Input for Other Cases -->
	<RefParameter Comment="Non-Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_NONE" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
		<PossibleValue Comment="In case of window mode: No I/O pin connection to COMP1 non-inverting input. Instead, connection to COMP2 non-inverting input. " Value="COMP_NONINVERTINGINPUT_NONE"/>
		<PossibleValue Comment="OPAMP1 output connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_OPAMP1"/>
		<PossibleValue Comment="OPAMP2 output connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_OPAMP2"/>
		<PossibleValue Comment="OPAMP3 output connection to COMP1 non-inverting input " Value="COMP_NONINVERTINGINPUT_OPAMP3"/>
		<Description>Selects the Non-Inverting Input of the Comparator.</Description>
	</RefParameter>	
		
	<!-- WindowMode. Only for COMP2 --> 
	<RefParameter Comment="Window Mode" DefaultValue="COMP_WINDOWMODE_ENABLE" Group="Pinout Parameters" Name="WindowMode" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="($IpNumber=2) &amp; COMP1_WindowsMode"/>
		<PossibleValue Comment="Disabled" Value="COMP_WINDOWMODE_DISABLE"/>
		<PossibleValue Comment="Enabled" Value="COMP_WINDOWMODE_ENABLE"/>
	</RefParameter>
	<RefParameter Comment="Window Mode" DefaultValue="COMP_WINDOWMODE_DISABLE" Group="Pinout Parameters" Name="WindowMode" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="($IpNumber=2)"/>
		<PossibleValue Comment="Disabled" Value="COMP_WINDOWMODE_DISABLE"/>
		<PossibleValue Comment="Enabled" Value="COMP_WINDOWMODE_ENABLE"/>
	</RefParameter>
	<RefParameter Comment="Window Mode" DefaultValue="null" Group="Pinout Parameters" Name="WindowMode" Type="list" Visible="false">
		<PossibleValue Comment="Disabled" Value="COMP_WINDOWMODE_DISABLE"/>
		<PossibleValue Comment="Enabled" Value="COMP_WINDOWMODE_ENABLE"/>
	</RefParameter>
	
	
	<!-- Basic Parameters -->
	<!-- Speed Modes. Only for COMP2 --> 
	<RefParameter Comment="Speed Mode" DefaultValue="COMP_MODE_LOWSPEED" Group="Basic Parameters" Name="Mode" Type="list">
		<Condition Diagnostic="" Expression="$IpNumber=2"/>
        <PossibleValue Comment="High Speed" Value="COMP_MODE_HIGHSPEED"/>
		<PossibleValue Comment="Low Speed" Value="COMP_MODE_LOWSPEED"/>
		<Description>Selects the operating Consumption Mode of the Comparator to adjust the Speed/Consumption.</Description>
    </RefParameter>
	<RefParameter Comment="Speed / Power Mode" DefaultValue="null" Group="Basic Parameters" Name="Mode" Type="list" Visible="false">
        <PossibleValue Comment="High Speed" Value="COMP_MODE_HIGHSPEED"/>
		<PossibleValue Comment="Low Speed" Value="COMP_MODE_LOWSPEED"/>
    </RefParameter>
	
	<!-- Trigger Modes when using Interruption --> 
	<RefParameter Comment="Interrupt Trigger Mode" DefaultValue="COMP_TRIGGERMODE_NONE" Group="Basic Parameters" Name="TriggerMode" Type="list">
        <PossibleValue Comment="None" Value="COMP_TRIGGERMODE_NONE"/>
        <PossibleValue Comment="Rising Edge" Semaphore="$IpInstance_EXTI_IT_ENABLED" Value="COMP_TRIGGERMODE_IT_RISING"/>
        <PossibleValue Comment="Falling Edge" Semaphore="$IpInstance_EXTI_IT_ENABLED" Value="COMP_TRIGGERMODE_IT_FALLING"/>
        <PossibleValue Comment="Rising/Falling Edge" Semaphore="$IpInstance_EXTI_IT_ENABLED" Value="COMP_TRIGGERMODE_IT_RISING_FALLING"/>
		<Description>Selects the Trigger Mode of the Comparator when using Interruption on EXTI line (Interrupt Mode).</Description>
    </RefParameter>
	
	<!-- Internal Puling Resistor for Non-Inverting Input. Only for COMP1 -->
    <RefParameter Comment="Non-Inverting Internal Resistor" DefaultValue="COMP_NONINVERTINGINPUT_NOPULL" Group="Basic Parameters" Name="NonInvertingInputPull" Type="list">
    	<Condition Diagnostic="" Expression="$IpNumber=1"/>
        <PossibleValue Comment="None" Value="COMP_NONINVERTINGINPUT_NOPULL"/>
        <PossibleValue Comment="10 kOhm Pull-Up" Value="COMP_NONINVERTINGINPUT_10KPU"/>
        <PossibleValue Comment="10 kOhm Pull-Down" Value="COMP_NONINVERTINGINPUT_10KPD"/>
        <PossibleValue Comment="400 kOhm Pull-Up" Value="COMP_NONINVERTINGINPUT_400KPU"/>
        <PossibleValue Comment="400 kOhm Pull-Down" Value="COMP_NONINVERTINGINPUT_400KPD"/>
    	<Description>Selects the internal pulling resistor connected on Non-Inverting Input.</Description>
    </RefParameter>
	<RefParameter Comment="Non-Inverting Internal Resistor" DefaultValue="null" Group="Basic Parameters" Name="NonInvertingInputPull" Type="list" Visible="false">
		<PossibleValue Comment="None" Value="COMP_NONINVERTINGINPUT_NOPULL"/>
	</RefParameter>
	
	<!-- Output Parameters. Only for COMP2 -->
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="$IpNumber=2"/>
        <PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 2 Input Capture 4" Value="COMP_OUTPUT_TIM2IC4"/>
        <PossibleValue Comment="Timer 2 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM2OCREFCLR"/>
        <PossibleValue Comment="Timer 3 Input Capture 4" Value="COMP_OUTPUT_TIM3IC4"/>
        <PossibleValue Comment="Timer 3 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM3OCREFCLR"/>
        <PossibleValue Comment="Timer 4 Input Capture 4" Value="COMP_OUTPUT_TIM4IC4"/>
        <PossibleValue Comment="Timer 4 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM4OCREFCLR"/>
        <PossibleValue Comment="Timer 10 Input Capture 1" Value="COMP_OUTPUT_TIM10IC1"/>
		<Description>Selects the output redirection of the comparator.</Description>
    </RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="null" Group="Output Parameters" Name="Output" Type="list" Visible="false">
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
	</RefParameter>
	
	
	<!-- InputPlus is the default Mode -->
	<RefMode Abstract="true" Name="InputPlus_BaseMode">
		<ConfigForMode>Comp_Init</ConfigForMode>
		<Parameter Name="Mode">
			<Condition Diagnostic="" Expression="$IpNumber=2"/>
		</Parameter>
		<Parameter Name="TriggerMode"/>
		<Parameter Name="NonInvertingInputPull">
			<Condition Diagnostic="" Expression="$IpNumber=1"/>
		</Parameter>
		<Parameter Name="Output">
			<Condition Diagnostic="" Expression="$IpNumber=2"/>
		</Parameter>
	</RefMode>
	
	<!-- 'Non-Inverting Input' RefModes list -->
	<RefMode BaseMode="InputPlus_BaseMode" Name="INP">
		<Parameter Name="NonInvertingInput"/>
	</RefMode>
	<RefMode BaseMode="InputPlus_BaseMode" Name="INP_OPAMP1">
		<Parameter Name="NonInvertingInput">
			<PossibleValue>COMP_NONINVERTINGINPUT_OPAMP1</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="INP_OPAMP2">
		<Parameter Name="NonInvertingInput">
			<PossibleValue>COMP_NONINVERTINGINPUT_OPAMP2</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="INP_OPAMP3">
		<Parameter Name="NonInvertingInput">
			<PossibleValue>COMP_NONINVERTINGINPUT_OPAMP3</PossibleValue>
		</Parameter>	
	</RefMode>
		
	<!-- 'WindowMode' RefModes list -->
	<RefMode BaseMode="InputPlus_BaseMode" Name="WindowMode"/>
		
		
	<!-- 'Inverting Input' RefModes list -->
	<RefMode Name="INM">
		<Parameter Name="InvertingInput">
	           <PossibleValue>COMP_INVERTINGINPUT_IO</PossibleValue>
                </Parameter>	
	</RefMode>
	<RefMode Name="VREFINT">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_VREFINT</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="VREFINT_34">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_3_4VREFINT</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="VREFINT_12">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_1_2VREFINT</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="VREFINT_14">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_1_4VREFINT</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="INM_DACOUT1">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_DAC1</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="INM_DACOUT2">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_DAC2</PossibleValue>
		</Parameter>	
	</RefMode>
		
	
	<!-- Modes for COMP. Defined for BigScorpio & Scorpio2 (Category 2/3/4/5). Caution : COMP1 do not work with an ADC activated unless in Windows mode ( Bug 315353)-->
	<ModeLogicOperator Name="OR">
		<Mode Name="InputPlus" UserName="Input [+]">
			<ModeLogicOperator Name="XOR">
				<Mode Name="INP" ShrinkName="Input [+] : INP" UserName="INP">
					<SignalLogicalOp Name="AND">
						<Signal Name="INP"/>
					</SignalLogicalOp>
					<Semaphore>$IpInstance_ExternalInputPlus</Semaphore>
		                	<Condition Diagnostic="ADC must be disabled" Expression="(($IpNumber=1) &amp; !USE_ADC) | ($IpNumber=2)"/>
				</Mode>
				<Mode Name="INP_OPAMP1" RemoveCondition="!(OPAMP1:$modeexist_Filter) | ($IpNumber=2)" UserName="OPAMP 1">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_OPAMP1"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'OPAMP 1' activated" Expression="OPAMP1 &amp;(($IpNumber=1) &amp; !USE_ADC) | ($IpNumber=2) "/>
				</Mode>
				<Mode Name="INP_OPAMP2" RemoveCondition="!(OPAMP2:$modeexist_Filter) | ($IpNumber=2)" UserName="OPAMP 2">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_OPAMP2"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'OPAMP 2' activated" Expression="OPAMP2 &amp;(($IpNumber=1) &amp; !USE_ADC) | ($IpNumber=2) "/>
				</Mode>
				<Mode Name="INP_OPAMP3" RemoveCondition="!(OPAMP3:$modeexist_Filter) | ($IpNumber=2)" UserName="OPAMP 3">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_OPAMP3"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'OPAMP 3' activated" Expression="OPAMP3 &amp;(($IpNumber=1) &amp; !USE_ADC) | ($IpNumber=2) "/>
				</Mode>
				<Mode Name="WindowMode" RemoveCondition="($IpNumber=2)" UserName="Window Mode">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_WindowMode"/>
					</SignalLogicalOp>
					<Semaphore>$IpInstance_WindowsMode</Semaphore>
					<Condition Diagnostic="Need to have an INP (External Input [+]) on next Comparator" Expression="(($IpNumber=1) &amp; COMP2_ExternalInputPlus)"/>
				</Mode>
			</ModeLogicOperator>
			<Semaphore>$IpInstance_InputPlus</Semaphore>
		</Mode>
		
		<Mode Name="InputNeg" RemoveCondition="($IpNumber=1)" UserName="Input [-]">
			<ModeLogicOperator Name="XOR">
				<Mode Name="INM" UserName="INM">
					<SignalLogicalOp Name="AND">
						<Signal Name="INM"/>
					</SignalLogicalOp>
				</Mode>
				<Mode Name="INM_DACOUT1" RemoveCondition="!(DAC:$modeexist_DAC_OUT1)" UserName="DAC OUT1">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_DACOUT1"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'DAC Out 1' activated" Expression="(DAC_OUT1_Conf)"/>
				</Mode>
				<Mode Name="INM_DACOUT2" RemoveCondition="!(DAC:$modeexist_DAC_OUT2)" UserName="DAC OUT2">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_DACOUT2"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'DAC Out 2' activated" Expression="(DAC_OUT2_Conf)"/>
				</Mode>
				<Mode Name="VREFINT" UserName="Internal VRef">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_VREFINT"/>
					</SignalLogicalOp>
				</Mode>
				<Mode Name="VREFINT_34" UserName="3/4 Internal VRef">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_VREFINT34"/>
					</SignalLogicalOp>
				</Mode>
				<Mode Name="VREFINT_12" UserName="1/2 Internal VRef">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_VREFINT12"/>
					</SignalLogicalOp>
				</Mode>
				<Mode Name="VREFINT_14" UserName="1/4 Internal VRef">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_VREFINT14"/>
					</SignalLogicalOp>
				</Mode>
			</ModeLogicOperator>
			<Condition Diagnostic="Need to have an INP (External Input [+]) activated" Expression="$IpInstance_InputPlus"/>
		</Mode>
	</ModeLogicOperator>
	
	<!-- Signals for COMP. -->
	<RefSignal IOMode="Analog" Name="INP"/>
	<RefSignal IOMode="Analog" Name="INM"/>
	<RefSignal IOMode="AlternateFunctionPushPull" Name="OUT"/>

	<RefSignal Name="VS_WindowMode" Virtual="true"/>
	<RefSignal Name="VS_VREFINT" Virtual="true"/>
	<RefSignal Name="VS_VREFINT34" Virtual="true"/>
	<RefSignal Name="VS_VREFINT12" Virtual="true"/>
	<RefSignal Name="VS_VREFINT14" Virtual="true"/>
	<RefSignal Name="VS_DACOUT1" Virtual="true"/>
	<RefSignal Name="VS_DACOUT2" Virtual="true"/>
	<RefSignal Name="VS_OPAMP1" Virtual="true"/>
	<RefSignal Name="VS_OPAMP2" Virtual="true"/>
	<RefSignal Name="VS_OPAMP3" Virtual="true"/>
	
	<!-- Semaphore for COMP -->
	<Semaphore>$IpInstance</Semaphore>
</IP>