<?xml version="1.0" encoding="UTF-8" ?>
<!--
	Generic rules mechanism 
	Currently called in the IP tree view and in the expert view in the pinout
	Schema
	<rule cache="true"> <- cache is optional
		<condition>!SAMPLING_G2_IO1</condition>
		<match>STM32F091.*</match>
		<match>PA4</match>
		<match>TSC_G2_IO1.*</match>
		<diagnostic><font size="3" color="red">This GPIO offers a reduced touch sensing sensitivity. You should use it as sampling capacitor I/O</font></diagnostic>
		<result type="type">windows-warning.png</result> <- type integer, boolean, default is string
    </rule>

	All items are optional
	If you write a condition but no match only the condition is evaluated
	If you pass a match the number of match item must match the number of parameters passed in the code
	In the pinout view the parameters are
		the mcu name
		the pin name
		the list of signals mapped on the pin
		
	In the tree view the parameters are
		the mcu name
		the mode name in the form <parent mode name>.<mode name>
		the diagnostic is displayed as a popup message on the mode if there is no other message to displayed
		the result corresponds to the icon name to display (name in the list of known names in IconList
	
	Examples
	this rule adds a warning message and an icon on the mode in the combobox Shield, item G2_IO1	
	<rule cache="true">
		<match>STM32F091.*</match>
		<match>Shield.*G2_IO1.*</match>
		<diagnostic><font size="3" color="red">This GPIO offers a reduced touch sensing sensitivity. It is thus recommended to use it as sampling capacitor I/O</font></diagnostic>
		<result>windows-warning.png</result>
	</rule>
	this rule adds a warning message and an icon on the checkbox mode G2_IO1	
	<rule cache="true">
		<match>STM32F091.*</match>
		<match>Group 2.*G2_IO1.*</match>
		<diagnostic><font size="3" color="red">This GPIO offers a reduced touch sensing sensitivity. It is thus recommended to use it as sampling capacitor I/O</font></diagnostic>
		<result>windows-warning.png</result>
	</rule>
	this rule adds a warning message in the pinout expert panel on the pin
	<rule>
		<condition>!SAMPLING_G2_IO1</condition>
		<match>STM32F091.*</match>
		<match>PA4</match>
		<match>TSC_G2_IO1.*</match>
		<diagnostic><font size="3" color="red">This GPIO offers a reduced touch sensing sensitivity. You should use it as sampling capacitor I/O</font></diagnostic>
	</rule>
	
-->
<rules>
	<rule cache="true">
		<condition>S_SECURE</condition>
		<match>STM32L5.*</match>
		<match>GTZC.Enable</match>
		<diagnostic>"Enable" mode mandatory for TZEN=1</diagnostic>
	</rule>
    <rule cache="true">
        <condition>S_SECURE</condition>
        <match>STM32L5.*</match>
        <match>ICACHE_REG Secure Attribute.Not Secured</match>
        <diagnostic>Warning: In order that cache operations are possible in non secure<br/>application, it is recommended that the secure attribute<br/>is kept not secured in the secure application</diagnostic>
    </rule>
    <rule cache="true">
        <condition>S_SECURE</condition>
        <match>STM32L5.*</match>
        <match>ICACHE_REG Secure Attribute.Secured</match>
        <diagnostic>Warning: In order that cache operations are possible in non secure<br/>application, it is recommended that the secure attribute<br/>is kept not secured in the secure application</diagnostic>
    </rule>
    <rule cache="true">
        <condition>S_SECURE</condition>
        <match>STM32L5.*</match>
        <match>root.ICACHE_REG Secure Attribute</match>
        <diagnostic>Warning: In order that cache operations are possible in non secure<br/>application, it is recommended that the secure attribute<br/>is kept not secured in the secure application</diagnostic>
    </rule>

	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.PD3 Full Stack</match>
		<diagnostic>ALL PD3 feature are available (select the 'USBPDCORE_PD3_FULL_CMx_xxx.x lib')</diagnostic>
	</rule>
	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.PD3 Config 1</match>
		<diagnostic>ALL PD3 feature are available except VDM (select the 'USBPDCORE_PD3_CONFIG_1_CMx_xxx.x lib')</diagnostic>
	</rule>
	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.PD3 Min Source</match>
		<diagnostic>Source configuration only with minimum PD3 feature (select the 'USBPDCORE_PD3_CONFIG_MINSRC_CMx_xxx.x lib')</diagnostic>
	</rule>
	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.PD3 Min Sink</match>
		<diagnostic>Sink configuration only with minimum PD3 feature (select the 'USBPDCORE_PD3_CONFIG_MINSNK_CMx_xxx.x lib')</diagnostic>
	</rule>
	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.Type C with State Machine</match>
		<diagnostic>No PD available but the state machine Type-C is enabled (select the 'USBPDCORE_NO_PD_CMx_xxx.x lib' and USBPDCORE_LIB_NO_PD and USBPD_STATE_MACHINE switches should be enabled)</diagnostic>
	</rule>
	<rule cache="true">
		<match>STM32.*</match>
		<match>Stack Configuration.Type C only</match>
		<diagnostic>No PD available but the state machine Type-C is disabled (select the 'USBPDCORE_NO_PD_CMx_xxx.x lib' and USBPDCORE_LIB_NO_PD switch should be enabled)</diagnostic>
	</rule>

    <!-- 3 following rules to add warning at UART4 mode level for MP1 when UART4 is selected on Cortx-M4 -->
    <rule cache="true">
		<condition>UART4_CUBE  &amp; PA13_UART4_TX</condition>
		<match>STM32MP1.*</match>
		<match>root.Mode</match>
		<diagnostic>This mode requires Pin PA13 (UART_TX) also used in Boot ROM (hardcoded) and as default debug console in OpenSTLinux.<br></br>Consequently the signal may be disturbed in case of Linux reboot</diagnostic>
		<result>warning.png</result>
	</rule>
	<!-- rule to clean root warning-->
    <rule cache="true">
		<condition>UART4_CUBE  &amp; !PA13_UART4_TX</condition>
		<match>STM32MP1.*</match>
		<match>root.Mode</match>
		<diagnostic></diagnostic>
	</rule>
    <rule cache="true">
		<condition>UART4_CUBE  &amp; PA13_UART4_TX</condition>
		<match>STM32MP1.*</match>
		<match>Mode.*</match>
		<diagnostic>This mode requires Pin PA13 (UART_TX) also used in Boot ROM (hardcoded) and as default debug console in OpenSTLinux.<br></br>Consequently the signal may be disturbed in case of Linux reboot</diagnostic>
		<result>warning.png</result>
	</rule>


</rules>

