<?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="fastcomp_v1_2_d446_Cube" ns0:schemaLocation="http://mcd.rou.st.com/modules.php?name=mcu ../../../../../../../doc/V4/Development/Specifications/db/IP_Modes.xsd">
	<About>COMP: Fast Comparator</About>
	
	<!-- Pinout Parameters for COMP 1/2/3/4/5/6/7 (Sunfish). Already selected on Pinout TreeView -->
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_IO1" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="((PA0_COMP1_INM  &amp; ($IpNumber=1)) | (PA2_COMP2_INM  &amp; ($IpNumber=2)) | (PD15_COMP3_INM  &amp; ($IpNumber=3)) |                                  (PE8_COMP4_INM  &amp; ($IpNumber=4)) | (PD13_COMP5_INM  &amp; ($IpNumber=5)) | (PD10_COMP6_INM  &amp; ($IpNumber=6)) |                                 (PC0_COMP7_INM  &amp; ($IpNumber=7)))"/>
		<PossibleValue Comment="I/O1 (PA0/PA2/PD15/PE8/PD13/PD10/PC0)" Value="COMP_INVERTINGINPUT_IO1"/>
	</RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_IO2" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="((PB12_COMP3_INM  &amp; ($IpNumber=3)) | (PB2_COMP4_INM &amp; ($IpNumber=4)) | (PB10_COMP5_INM &amp; ($IpNumber=5)) |                                  (PB15_COMP6_INM &amp; ($IpNumber=6)))"/>
        <PossibleValue Comment="I/O2 (-/-/PB12/PB2/PB10/PB15/-)" Value="COMP_INVERTINGINPUT_IO2"/>
    </RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_DAC1_CH1" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="((PA4_COMP1_INM  &amp; ($IpNumber=1)) | (PA4_COMP2_INM &amp; ($IpNumber=2)) | (PA4_COMP3_INM  &amp; ($IpNumber=3)) |                                 (PA4_COMP4_INM  &amp; ($IpNumber=4)))"/>
		<PossibleValue Comment="DAC1_OUT (PA4)" Value="COMP_INVERTINGINPUT_DAC1_CH1"/>
	</RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_DAC1_CH2" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="((PA5_COMP1_INM  &amp; ($IpNumber=1)) | (PA5_COMP2_INM &amp; ($IpNumber=2)) | (PA5_COMP3_INM  &amp; ($IpNumber=3)) |                                 (PA5_COMP4_INM  &amp; ($IpNumber=4)))"/>
        <PossibleValue Comment="DAC1_OUT2 (PA5)" Value="COMP_INVERTINGINPUT_DAC1_CH2"/>
    </RefParameter>
	<RefParameter Comment="Inverting Input" DefaultValue="COMP_INVERTINGINPUT_VREFINT" Group="Pinout Parameters" Name="InvertingInput" Type="list" Visible="false">
		<PossibleValue Comment="VREFINT" Value="COMP_INVERTINGINPUT_VREFINT"/>
		<PossibleValue Comment="DAC1_OUT1 (PA4)" Value="COMP_INVERTINGINPUT_DAC1_CH1"/>
		<PossibleValue Comment="1/4 VREFINT" Value="COMP_INVERTINGINPUT_1_4VREFINT"/>
		<PossibleValue Comment="1/2 VREFINT" Value="COMP_INVERTINGINPUT_1_2VREFINT"/>
		<PossibleValue Comment="3/4 VREFINT" Value="COMP_INVERTINGINPUT_3_4VREFINT"/>
	</RefParameter>
		
	<RefParameter Comment="Non Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
		<Condition Diagnostic="" Expression="(PA1_COMP1_INP  &amp; ($IpNumber=1) &amp; COMP1_SwitchDAC)"/>
		<PossibleValue Comment="Switch DAC - PA1" Value="COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED"/>
	</RefParameter>
	<RefParameter Comment="Non Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_IO1" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
        <Condition Diagnostic="" Expression="((PA1_COMP1_INP  &amp; ($IpNumber=1)) | (PA7_COMP2_INP &amp; ($IpNumber=2)) | (PB14_COMP3_INP  &amp; ($IpNumber=3)) |                                 (PB0_COMP4_INP  &amp; ($IpNumber=4)) | (PB13_COMP5_INP &amp; ($IpNumber=5)) | (PB11_COMP6_INP  &amp; ($IpNumber=6)) |                                 (PC1_COMP7_INP  &amp; ($IpNumber=7)))"/>
        <PossibleValue Comment="I/O1 (PA1/PA7/PB14/PB0/PB13/PB11/PC1)" Value="COMP_NONINVERTINGINPUT_IO1"/>
    </RefParameter>
	<RefParameter Comment="Non Inverting Input" DefaultValue="COMP_NONINVERTINGINPUT_IO1" Group="Pinout Parameters" Name="NonInvertingInput" Type="list" Visible="false">
		<PossibleValue Comment="I/O1 (PA1)" Value="COMP_NONINVERTINGINPUT_IO1"/>
	</RefParameter>
	
	<!-- Window Mode not Used on Sunfish (F303xE). 
	<RefParameter Comment="Window Mode" DefaultValue="COMP_WINDOWMODE_DISABLED" Name="WindowMode" Type="list" Group="Pinout Parameters" Visible="false">
		<PossibleValue Comment="Disabled" Value="COMP_WINDOWMODE_DISABLED"/>
		<PossibleValue Comment="Enabled" Value="COMP_WINDOWMODE_ENABLED"/>
	</RefParameter>
	-->

	<!-- Basic Parameters -->
	<!-- Speed Mode not Used on Sunfish (F303xE). 
	<RefParameter Comment="Speed Mode" DefaultValue="COMP_MODE_HIGHSPEED" Name="Mode" Type="list" Group="Basic Parameters">
		<PossibleValue Comment="High Speed " Value="COMP_MODE_HIGHSPEED"/>
		<PossibleValue Comment="Medium Speed " Value="COMP_MODE_MEDIUMSPEED"/>
		<PossibleValue Comment="Low Power " Value="COMP_MODE_LOWPOWER"/>
		<PossibleValue Comment="Ultra-Low Power" Value="COMP_MODE_ULTRALOWPOWER"/>
	</RefParameter>
	-->
	
	<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"/>
	</RefParameter>
	
	<!-- Blanking Source. -->
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=1) | ($IpNumber=2)"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 1 Output Compare 5" Condition="!Semaphore_output_Channel5TIM1" Diagnostic="Need to activate Timer 1 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM1OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 2 Output Compare 3" Condition="!Semaphore_output_Channel3TIM2" Diagnostic="Need to activate Timer 2 Channel 3 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM2OC3"/>
		<PossibleValue Action="Disable" Comment="Timer 3 Output Compare 3" Condition="!Semaphore_output_Channel3TIM3" Diagnostic="Need to activate Timer 3 Channel 3 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM3OC3"/>
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=3)"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 1 Output Compare 5" Condition="!Semaphore_output_Channel5TIM1" Diagnostic="Need to activate Timer 1 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM1OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 2 Output Compare 4" Condition="!Semaphore_output_Channel4TIM2" Diagnostic="Need to activate Timer 2 Channel 4 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM2OC4"/>
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=4) &amp; !TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 3 Output Compare 4" Condition="!Semaphore_output_Channel4TIM3" Diagnostic="Need to activate Timer 3 Channel 4 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM3OC4"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 1" Condition="!Semaphore_output_Channel1TIM15" Diagnostic="Need to activate Timer 15 Channel 1 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC1"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=4) &amp; TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 3 Output Compare 4" Condition="!Semaphore_output_Channel4TIM3" Diagnostic="Need to activate Timer 3 Channel 4 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM3OC4"/>
		<PossibleValue Action="Disable" Comment="Timer 8 Output Compare 5" Condition="!Semaphore_output_Channel5TIM8" Diagnostic="Need to activate Timer 8 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM8OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 1" Condition="!Semaphore_output_Channel1TIM15" Diagnostic="Need to activate Timer 15 Channel 1 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC1"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=5) &amp; !TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 3 Output Compare 3" Condition="!Semaphore_output_Channel3TIM3" Diagnostic="Need to activate Timer 3 Channel 3 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM3OC3"/>
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=5) &amp; TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 3 Output Compare 3" Condition="!Semaphore_output_Channel3TIM3" Diagnostic="Need to activate Timer 3 Channel 3 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM3OC3"/>
		<PossibleValue Action="Disable" Comment="Timer 8 Output Compare 5" Condition="!Semaphore_output_Channel5TIM8" Diagnostic="Need to activate Timer 8 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM8OC5"/>
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=6) &amp; !TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 2 Output Compare 4" Condition="!Semaphore_output_Channel4TIM2" Diagnostic="Need to activate Timer 2 Channel 4 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM2OC4"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 2" Condition="!Semaphore_output_Channel2TIM15" Diagnostic="Need to activate Timer 15 Channel 2 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC2"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=6) &amp; TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 2 Output Compare 4" Condition="!Semaphore_output_Channel4TIM2" Diagnostic="Need to activate Timer 2 Channel 4 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM2OC4"/>
		<PossibleValue Action="Disable" Comment="Timer 8 Output Compare 5" Condition="!Semaphore_output_Channel5TIM8" Diagnostic="Need to activate Timer 8 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM8OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 2" Condition="!Semaphore_output_Channel2TIM15" Diagnostic="Need to activate Timer 15 Channel 2 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC2"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=7) &amp; !TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 1 Output Compare 5" Condition="!Semaphore_output_Channel5TIM1" Diagnostic="Need to activate Timer 1 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM1OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 2" Condition="!Semaphore_output_Channel2TIM15" Diagnostic="Need to activate Timer 15 Channel 2 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC2"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=7) &amp; TIM8_Exist"/>
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
		<PossibleValue Action="Disable" Comment="Timer 1 Output Compare 5" Condition="!Semaphore_output_Channel5TIM1" Diagnostic="Need to activate Timer 1 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM1OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 8 Output Compare 5" Condition="!Semaphore_output_Channel5TIM8" Diagnostic="Need to activate Timer 8 Channel 5 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM8OC5"/>
		<PossibleValue Action="Disable" Comment="Timer 15 Output Compare 2" Condition="!Semaphore_output_Channel2TIM15" Diagnostic="Need to activate Timer 15 Channel 2 in an 'Output Compare' Mode." Value="COMP_BLANKINGSRCE_TIM15OC2"/> 
	</RefParameter>
	<RefParameter Comment="Blanking Source" DefaultValue="COMP_BLANKINGSRCE_NONE" Group="Basic Parameters" Name="BlankingSrce" Type="list" Visible="false">
		<PossibleValue Comment="None" Value="COMP_BLANKINGSRCE_NONE"/>
	</RefParameter>
	
	<!-- Output Parameters -->
	<RefParameter Comment="Output Polarity" DefaultValue="COMP_OUTPUTPOL_NONINVERTED" Group="Output Parameters" Name="OutputPol" Type="list">
		<PossibleValue Comment="Not Inverted " Value="COMP_OUTPUTPOL_NONINVERTED"/>
		<PossibleValue Comment="Inverted " Value="COMP_OUTPUTPOL_INVERTED"/>
	</RefParameter>
	
	<!-- Internal Output Selection. On Sunfish, TIM3 is not used(?) and TIM4 & TIM8 are not present -->
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=1)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 1 Input Capture 1" Value="COMP_OUTPUT_TIM1IC1"/>
		<PossibleValue Comment="Timer 1 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM1OCREFCLR"/>
		<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 1" Value="COMP_OUTPUT_TIM3IC1"/>
		<PossibleValue Comment="Timer 3 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM3OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
        <PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
        <PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
        
	</RefParameter>
	<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 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 1 Input Capture 1" Value="COMP_OUTPUT_TIM1IC1"/>
		<PossibleValue Comment="Timer 1 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM1OCREFCLR"/>
		<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 1" Value="COMP_OUTPUT_TIM3IC1"/>
		<PossibleValue Comment="Timer 3 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM3OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Output Compare Reference Clear" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
    </RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=3)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 1 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM1OCREFCLR"/>
		<PossibleValue Comment="Timer 2 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM2OCREFCLR"/>
		<PossibleValue Comment="Timer 3 Input Capture 2" Value="COMP_OUTPUT_TIM3IC2"/>
		<PossibleValue Comment="Timer 4 Input Capture 1" Value="COMP_OUTPUT_TIM4IC1"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Comment="Timer 15 Break Input (BKIN)" Value="COMP_OUTPUT_TIM15BKIN"/>
		<PossibleValue Comment="Timer 15 Input Capture 1" Value="COMP_OUTPUT_TIM15IC1"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
		
	</RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=4)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 3 Input Capture 3" Value="COMP_OUTPUT_TIM3IC3"/>
		<PossibleValue Comment="Timer 3 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM3OCREFCLR"/>
		<PossibleValue Comment="Timer 4 Input Capture 2" Value="COMP_OUTPUT_TIM4IC2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Output Compare Reference Clear" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Comment="Timer 15 Input Capture 2" Value="COMP_OUTPUT_TIM15IC2"/>
		<PossibleValue Comment="Timer 15 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM15OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
	</RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=5)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 2 Input Capture 1" Value="COMP_OUTPUT_TIM2IC1"/>
		<PossibleValue Comment="Timer 3 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM3OCREFCLR"/>
		<PossibleValue Comment="Timer 4 Input Capture 3" Value="COMP_OUTPUT_TIM4IC3"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Output Compare Reference Clear" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Comment="Timer 16 Break Input (BKIN)" Value="COMP_OUTPUT_TIM16BKIN"/>
		<PossibleValue Comment="Timer 17 Input Capture 1" Value="COMP_OUTPUT_TIM17IC1"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
	</RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=6)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 2 Input Capture 2" Value="COMP_OUTPUT_TIM2IC2"/>
		<PossibleValue Comment="Timer 2 Output Compare Reference Clear" Value="COMP_OUTPUT_COMP6_TIM2OCREFCLR"/>
		<PossibleValue Comment="Timer 4 Input Capture 4" Value="COMP_OUTPUT_TIM4IC4"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Output Compare Reference Clear" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Comment="Timer 16 Input Capture 1" Value="COMP_OUTPUT_TIM16IC1"/>
		<PossibleValue Comment="Timer 16 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM16OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
	</RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" Group="Output Parameters" Name="Output" Type="list">
		<Condition Diagnostic="" Expression="($IpNumber=7)"/>
		<PossibleValue Comment="None" Value="COMP_OUTPUT_NONE"/>
		<PossibleValue Comment="Timer 1 Break Input (BKIN)" Value="COMP_OUTPUT_TIM1BKIN"/>
		<PossibleValue Comment="Timer 1 Break Input 2 (BKIN2)" Value="COMP_OUTPUT_TIM1BKIN2"/>
		<PossibleValue Comment="Timer 1 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM1OCREFCLR"/>
		<PossibleValue Comment="Timer 1 Input Capture 2" Value="COMP_OUTPUT_TIM1IC2"/>
		<PossibleValue Comment="Timer 2 Input Capture 3" Value="COMP_OUTPUT_TIM2IC3"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input (BKIN)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Break Input 2 (BKIN2)" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 8 Output Compare Reference Clear" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM8OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!TIM8_Exist" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2"/>
		<PossibleValue Comment="Timer 17 Break Input (BKIN)" Value="COMP_OUTPUT_TIM17BKIN"/>
		<PossibleValue Comment="Timer 17 Output Compare Reference Clear" Value="COMP_OUTPUT_TIM17OCREFCLR"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input (BKIN)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN"/>
		<PossibleValue Action="Remove" Comment="Timer 20 Break Input 2 (BKIN2)" Condition="!TIM20_Exist" Value="COMP_OUTPUT_TIM20BKIN2"/>
		<PossibleValue Action="Remove" Comment="Timer 20 BKIN2, Timer 8 BKIN2 or Timer 1 BKIN2" Condition="!(TIM8_Exist &amp; TIM20_Exist)" Value="COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2"/>
	</RefParameter>
	<RefParameter Comment="Output Internal Selection" DefaultValue="COMP_OUTPUT_NONE" 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="TriggerMode"/>
		<Parameter Name="BlankingSrce"/>
		<Parameter Name="OutputPol"/>
		<Parameter Name="Output"/>
	</RefMode>
	
	<!-- 'Switch with DAC' RefMode-->
	<RefMode BaseMode="InputPlus_BaseMode" Name="Switch_DAC">
		<Parameter Name="NonInvertingInput"/>
	</RefMode>
	
	<!-- 'Non-Inverting Input' RefModes list -->
	<RefMode BaseMode="InputPlus_BaseMode" Name="INP">
		<Parameter Name="NonInvertingInput"/>
	</RefMode>


	<!-- 'Window Mode' RefMode-->
	<!--
	<RefMode Name="WindowMode" BaseMode="InputPlus_BaseMode">
		<Parameter Name="WindowMode">
			<PossibleValue>COMP_WINDOWMODE_ENABLED</PossibleValue>
		</Parameter>
	</RefMode>
	-->


	<!-- 'Inverting Input' RefModes list -->
	<RefMode Name="INM">
		<Parameter Name="InvertingInput"/>
	</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_DAC1OUT1">
		<Parameter Name="InvertingInput">
			<PossibleValue>COMP_INVERTINGINPUT_DAC1_CH1</PossibleValue>
		</Parameter>	
	</RefMode>
	<RefMode Name="INM_DAC1OUT2">
        <Parameter Name="InvertingInput">
            <PossibleValue>COMP_INVERTINGINPUT_DAC1_CH2</PossibleValue>
        </Parameter>    
    </RefMode>
	
	
	<!-- Modes for COMP. Defined for Sunfish (F303xE) -->
	<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>
				</Mode>
				<Mode Name="Switch_DAC" RemoveCondition="!(($IpNumber=1) &amp; (DAC1:$modeexist_DAC_OUT1))" UserName="Switch with DAC1 OUT1">
					<SignalLogicalOp Name="AND">
						<Signal Name="INP"/>
						<Signal Name="VS_Switch"/>
					</SignalLogicalOp>
					<Semaphore>$IpInstance_SwitchDAC</Semaphore>
					<Condition Diagnostic="Need to have 'DAC1 Out 1' activated" Expression="(DAC1_OUT1_Conf)"/>
				</Mode>
				<!-- No Windows Mode for Sunfish (?) 
				<Mode Name="WindowMode" UserName="Window Mode" RemoveCondition="($IpNumber=2)" >
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_WindowMode"/>
					</SignalLogicalOp>
					<Condition Expression="(($IpNumber=1) &amp; COMP2_ExternalInputPlus)" 
								Diagnostic="Need to have an INP (External Input [+]) on next Comparator"/>
				</Mode>
				-->
			</ModeLogicOperator>
			<Semaphore>$IpInstance_InputPlus</Semaphore>
		</Mode>
		
		<Mode Name="InputNeg" UserName="Input [-]">
			<ModeLogicOperator Name="XOR">
				<Mode Name="INM" UserName="INM">
					<SignalLogicalOp Name="AND">
						<Signal Name="INM"/>
					</SignalLogicalOp>
				</Mode>
				<Mode Name="INM_DAC1OUT1" RemoveCondition="!(DAC1:$modeexist_DAC_OUT1)" UserName="DAC1 OUT1">
					<SignalLogicalOp Name="AND">
						<Signal Name="VS_DAC1OUT1"/>
					</SignalLogicalOp>
					<Condition Diagnostic="Need to have an 'DAC1 Out 1' activated" Expression="(DAC1_OUT1_Conf)"/>
				</Mode>
				<Mode Name="INM_DAC1OUT2" RemoveCondition="!(DAC1:$modeexist_Enable_DAC_OUT2)" UserName="DAC1 OUT2">
                    <SignalLogicalOp Name="AND">
                        <Signal Name="VS_DAC1OUT2"/>
                    </SignalLogicalOp>
                    <Condition Diagnostic="Need to have an 'DAC1 Out 2' activated" Expression="(DAC1_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>
		
		<Mode Name="ExternalOutput" UserName="External Output">
			<ModeLogicOperator Name="OR">
				<Mode Name="ExternalOutput">
					<SignalLogicalOp Name="AND">
						<Signal Name="OUT"/>
					</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_Switch" 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_DAC1OUT1" Virtual="true"/>
	<RefSignal Name="VS_DAC1OUT2" Virtual="true"/>
	<!-- <RefSignal Name="VS_DAC2OUT1" Virtual="true"/> -->
</IP>