diff options
-rw-r--r-- | tools/gencfg/processors/hal/stm32f4xx/config.fmpp | 5 | ||||
-rw-r--r-- | tools/gencfg/schema/common/doc.xsd | 57 | ||||
-rw-r--r-- | tools/gencfg/schema/hal/abstract_adc_cfg.xsd | 43 | ||||
-rw-r--r-- | tools/gencfg/schema/hal/abstract_driver_cfg.xsd | 8 | ||||
-rw-r--r-- | tools/gencfg/schema/hal/stm32f4xx/Copy of stm32f4xx_adc_cfg.xsd | 219 | ||||
-rw-r--r-- | tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd | 437 | ||||
-rw-r--r-- | tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd | 29 | ||||
-rw-r--r-- | tools/gencfg/xml/stm32f4xx_cfg.xml | 43 |
8 files changed, 820 insertions, 21 deletions
diff --git a/tools/gencfg/processors/hal/stm32f4xx/config.fmpp b/tools/gencfg/processors/hal/stm32f4xx/config.fmpp new file mode 100644 index 000000000..307a6f61c --- /dev/null +++ b/tools/gencfg/processors/hal/stm32f4xx/config.fmpp @@ -0,0 +1,5 @@ +sourceRoot: templates
+outputRoot: output
+data: {
+ doc1: xml(../input/stm32f4xx_cfg.xml)
+}
diff --git a/tools/gencfg/schema/common/doc.xsd b/tools/gencfg/schema/common/doc.xsd index 573beb618..b7395605b 100644 --- a/tools/gencfg/schema/common/doc.xsd +++ b/tools/gencfg/schema/common/doc.xsd @@ -1,42 +1,57 @@ <?xml version="1.0" encoding="UTF-8"?>
-<xs:schema
- elementFormDefault="qualified"
+<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="NamedItem">
<xs:annotation>
- <xs:documentation>>Generic item with optional name and brief description
+ <xs:documentation>>Generic item with optional name and brief
+ description
</xs:documentation>
</xs:annotation>
- <xs:attribute
- name="name"
- type="xs:string"
- use="required"></xs:attribute>
- <xs:attribute
- name="brief"
- type="xs:string"
- use="optional"></xs:attribute>
+ <xs:attribute name="name" use="required">
+ <xs:annotation>
+ <xs:documentation>Object name.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\w[\w\d_]*"></xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="brief" use="optional">
+ <xs:annotation>
+ <xs:documentation>Object brief description, 72 chars max in a
+ single line.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+
+ <xs:maxLength value="72"></xs:maxLength>
+ <xs:minLength value="0"></xs:minLength>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
</xs:complexType>
<xs:complexType name="DocumentedItem">
<xs:annotation>
- <xs:documentation>>Something that can have a detailed description attached
+ <xs:documentation>>Something that can have a detailed description
+ attached
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="NamedItem">
- <xs:sequence
- maxOccurs="unbounded"
- minOccurs="0">
- <xs:element
- name="details"
- type="xs:string"
- maxOccurs="1"
- minOccurs="0">
+ <xs:sequence maxOccurs="unbounded" minOccurs="0">
+ <xs:element name="details" type="xs:string"
+ maxOccurs="1" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Object documentation as text, does not
+ preserve formatting.</xs:documentation>
+ </xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
- </xs:complexType>
+ </xs:complexType> </xs:schema>
diff --git a/tools/gencfg/schema/hal/abstract_adc_cfg.xsd b/tools/gencfg/schema/hal/abstract_adc_cfg.xsd new file mode 100644 index 000000000..4a2901c4e --- /dev/null +++ b/tools/gencfg/schema/hal/abstract_adc_cfg.xsd @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:include schemaLocation="abstract_driver_cfg.xsd" />
+
+ <xs:complexType name="AbstractAdcGroupCfgType">
+ <xs:complexContent>
+ <xs:extension base="DocumentedItem">
+ <xs:attribute name="circular" type="xs:boolean"
+ use="required">
+ </xs:attribute>
+ <xs:attribute name="conversion_callback" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\w?[\w\d_]*"></xs:pattern>
+ <xs:minLength value="0"></xs:minLength>
+ <xs:maxLength value="24"></xs:maxLength>
+ <xs:whiteSpace value="collapse"></xs:whiteSpace>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="error_callback" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\w?[\w\d_]*"></xs:pattern>
+ <xs:minLength value="0"></xs:minLength>
+ <xs:maxLength value="24"></xs:maxLength>
+ <xs:whiteSpace value="collapse"></xs:whiteSpace>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+
+ <xs:complexType name="AbstractAdcCfgType">
+ <xs:complexContent>
+ <xs:extension base="DocumentedItem"></xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+</xs:schema>
diff --git a/tools/gencfg/schema/hal/abstract_driver_cfg.xsd b/tools/gencfg/schema/hal/abstract_driver_cfg.xsd new file mode 100644 index 000000000..a884cd090 --- /dev/null +++ b/tools/gencfg/schema/hal/abstract_driver_cfg.xsd @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:include schemaLocation="../common/doc.xsd" />
+
+ <xs:complexType name="AbstractDriverCfgType"></xs:complexType> +</xs:schema>
diff --git a/tools/gencfg/schema/hal/stm32f4xx/Copy of stm32f4xx_adc_cfg.xsd b/tools/gencfg/schema/hal/stm32f4xx/Copy of stm32f4xx_adc_cfg.xsd new file mode 100644 index 000000000..ff700b621 --- /dev/null +++ b/tools/gencfg/schema/hal/stm32f4xx/Copy of stm32f4xx_adc_cfg.xsd @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:include schemaLocation="../abstract_adc_cfg.xsd" /> + + <xs:complexType name="STM32F4AdcCfgType"> + <xs:complexContent> + <xs:extension base="AbstractAdcCfgType"> + <xs:sequence> + <xs:element name="groups" minOccurs="1" maxOccurs="1"> + <xs:complexType> + <xs:sequence> + <xs:element name="group" maxOccurs="unbounded" + minOccurs="1" type="STM32F4xxAdcGroupCfgType"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType> + + <xs:complexType name="STM32F4xxAdcChannelType"> + <xs:attribute name="sample" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration> + </xs:restriction> + </xs:simpleType> + </xs:attribute>
+ </xs:complexType>
+
+ <xs:complexType name="STM32F4xxAdcGroupCfgType">
+ <xs:complexContent>
+ <xs:extension base="DocumentedItem">
+
+ <xs:sequence>
+ <xs:element name="sample_time" maxOccurs="1" minOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="IN0" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN1" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN2" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN3" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN4" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN5" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN6" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN7" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN8" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN9" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN10" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN11" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN12" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN13" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN14" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="IN15" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="SENSOR" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="VREFINT" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ <xs:element name="VBAT" type="STM32F4xxAdcChannelType"
+ maxOccurs="1" minOccurs="1">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="channels_sequence" maxOccurs="1"
+ minOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="channel" maxOccurs="unbounded"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_CHANNEL_IN0"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN1"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN2"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN3"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN4"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN5"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN6"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN7"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN8"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN9"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN10"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN11"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN12"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN13"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN14"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN15"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_SENSOR"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_VREFINT"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_VBAT"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:sequence>
+ <xs:attribute name="alignment" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Samples are Right Aligned"></xs:enumeration>
+ <xs:enumeration value="1 Samples are Left Aligned"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="resolution" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Resolution 12 bits"></xs:enumeration>
+ <xs:enumeration value="1 Resolution 10 bits"></xs:enumeration>
+ <xs:enumeration value="2 Resolution 8 bits"></xs:enumeration>
+ <xs:enumeration value="3 Resolution 6 bits"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="trigger_mode" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Software"></xs:enumeration>
+ <xs:enumeration value="1 Rising Edge"></xs:enumeration>
+ <xs:enumeration value="2 Falling Edge"></xs:enumeration>
+ <xs:enumeration value="3 Both Edges"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="trigger_source" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Timer 1 CC1 event"></xs:enumeration>
+ <xs:enumeration value="1 Timer 1 CC2 event"></xs:enumeration>
+ <xs:enumeration value="2 Timer 1 CC3 event"></xs:enumeration>
+ <xs:enumeration value="3 Timer 2 CC2 event"></xs:enumeration>
+ <xs:enumeration value="4 Timer 2 CC3 event"></xs:enumeration>
+ <xs:enumeration value="5 Timer 2 CC4 event"></xs:enumeration>
+ <xs:enumeration value="6 Timer 2 TRGO event"></xs:enumeration>
+ <xs:enumeration value="7 Timer 3 CC1 event"></xs:enumeration>
+ <xs:enumeration value="8 Timer 3 TRGO event"></xs:enumeration>
+ <xs:enumeration value="9 Timer 4 CC4 event"></xs:enumeration>
+ <xs:enumeration value="10 Timer 5 CC1 event"></xs:enumeration>
+ <xs:enumeration value="11 Timer 5 CC2 event"></xs:enumeration>
+ <xs:enumeration value="12 Timer 5 CC3 event"></xs:enumeration>
+ <xs:enumeration value="13 Timer 8 CC1 event"></xs:enumeration>
+ <xs:enumeration value="14 Timer 8 CC4 event"></xs:enumeration>
+ <xs:enumeration value="15 EXTI line15"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="discontinuous_mode" type="xs:boolean"
+ use="required">
+ </xs:attribute>
+
+ <xs:attribute name="discontinuous_number" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+
+ <xs:minInclusive value="1"></xs:minInclusive>
+
+ <xs:maxInclusive value="8"></xs:maxInclusive>
+ <xs:whiteSpace value="collapse"></xs:whiteSpace>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+</xs:schema>
diff --git a/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd new file mode 100644 index 000000000..18cb6a03b --- /dev/null +++ b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd @@ -0,0 +1,437 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:include schemaLocation="../abstract_adc_cfg.xsd" /> + + <xs:complexType name="STM32F4AdcCfgType"> + <xs:complexContent> + <xs:extension base="AbstractAdcCfgType"> + <xs:sequence> + <xs:element name="groups" minOccurs="1" maxOccurs="1"> + <xs:complexType> + <xs:sequence> + <xs:element name="group" maxOccurs="unbounded" + minOccurs="1" type="STM32F4xxAdcGroupCfgType"></xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType> + + <xs:complexType name="STM32F4xxAdcChannelSettingsType"> + <xs:attribute name="sample" use="required"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration> + <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration> + </xs:restriction> + </xs:simpleType> + </xs:attribute>
+ </xs:complexType>
+
+ <xs:complexType name="STM32F4xxAdcGroupCfgType">
+ <xs:complexContent>
+ <xs:extension base="AbstractAdcGroupCfgType">
+ <xs:sequence>
+ <xs:element name="sample_time" maxOccurs="1"
+ minOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="IN0" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN1" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN2" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN3" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN4" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN5" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN6" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN7" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN8" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN9" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN10" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN11" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN12" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN13" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN14" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="IN15" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SENSOR" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="VREFINT" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="VBAT" maxOccurs="1"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_SAMPLE_3"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_15"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_28"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_56"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_84"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_112"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_144"></xs:enumeration>
+ <xs:enumeration value="ADC_SAMPLE_480"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="channels_sequence" maxOccurs="1"
+ minOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="channel" maxOccurs="unbounded"
+ minOccurs="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ADC_CHANNEL_IN0"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN1"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN2"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN3"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN4"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN5"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN6"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN7"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN8"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN9"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN10"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN11"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN12"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN13"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN14"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_IN15"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_SENSOR"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_VREFINT"></xs:enumeration>
+ <xs:enumeration value="ADC_CHANNEL_VBAT"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="alignment" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Samples are Right Aligned"></xs:enumeration>
+ <xs:enumeration value="1 Samples are Left Aligned"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="resolution" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 12 bits"></xs:enumeration>
+ <xs:enumeration value="1 10 bits"></xs:enumeration>
+ <xs:enumeration value="2 8 bits"></xs:enumeration>
+ <xs:enumeration value="3 6 bits"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="trigger_mode" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Software"></xs:enumeration>
+ <xs:enumeration value="1 Rising Edge"></xs:enumeration>
+ <xs:enumeration value="2 Falling Edge"></xs:enumeration>
+ <xs:enumeration value="3 Both Edges"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="trigger_source" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="0 Timer 1 CC1 event"></xs:enumeration>
+ <xs:enumeration value="1 Timer 1 CC2 event"></xs:enumeration>
+ <xs:enumeration value="2 Timer 1 CC3 event"></xs:enumeration>
+ <xs:enumeration value="3 Timer 2 CC2 event"></xs:enumeration>
+ <xs:enumeration value="4 Timer 2 CC3 event"></xs:enumeration>
+ <xs:enumeration value="5 Timer 2 CC4 event"></xs:enumeration>
+ <xs:enumeration value="6 Timer 2 TRGO event"></xs:enumeration>
+ <xs:enumeration value="7 Timer 3 CC1 event"></xs:enumeration>
+ <xs:enumeration value="8 Timer 3 TRGO event"></xs:enumeration>
+ <xs:enumeration value="9 Timer 4 CC4 event"></xs:enumeration>
+ <xs:enumeration value="10 Timer 5 CC1 event"></xs:enumeration>
+ <xs:enumeration value="11 Timer 5 CC2 event"></xs:enumeration>
+ <xs:enumeration value="12 Timer 5 CC3 event"></xs:enumeration>
+ <xs:enumeration value="13 Timer 8 CC1 event"></xs:enumeration>
+ <xs:enumeration value="14 Timer 8 CC4 event"></xs:enumeration>
+ <xs:enumeration value="15 EXTI line15"></xs:enumeration>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="discontinuous_mode" type="xs:boolean"
+ use="required">
+ </xs:attribute>
+ <xs:attribute name="discontinuous_number" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="1"></xs:minInclusive>
+ <xs:maxInclusive value="8"></xs:maxInclusive>
+ <xs:whiteSpace value="collapse"></xs:whiteSpace>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+</xs:schema>
diff --git a/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd new file mode 100644 index 000000000..f846403f3 --- /dev/null +++ b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema elementFormDefault="qualified"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:include schemaLocation="../../common/doc.xsd" />
+ <xs:include schemaLocation="stm32f4xx_adc_cfg.xsd" /> + + <xs:complexType name="STM32F4xxCfgType"> + <xs:complexContent> + <xs:extension base="DocumentedItem"> + <xs:sequence> + <xs:element name="configs" maxOccurs="1" minOccurs="1"> + <xs:complexType> + <xs:sequence maxOccurs="unbounded" minOccurs="1">
+ <xs:choice>
+ <xs:element name="adc_config" type="STM32F4AdcCfgType"
+ maxOccurs="1" minOccurs="0">
+ </xs:element>
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="configuration" type="STM32F4xxCfgType"></xs:element>
+</xs:schema>
diff --git a/tools/gencfg/xml/stm32f4xx_cfg.xml b/tools/gencfg/xml/stm32f4xx_cfg.xml new file mode 100644 index 000000000..65c9294e0 --- /dev/null +++ b/tools/gencfg/xml/stm32f4xx_cfg.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!-- STM32F4xx board Template -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd"
+ name="hal_configs">
+ <details>Application HAL configurations.</details>
+ <configs>
+ <adc_config name="ADCConfig1">
+ <groups>
+ <group discontinuous_number="1" name="ADCGroupConfig1"
+ trigger_mode="0 Software" error_callback=""
+ resolution="0 12 bits" trigger_source="0 Timer 1 CC1 event"
+ discontinuous_mode="true"
+ alignment="0 Samples are Right Aligned" conversion_callback=""
+ circular="true" brief="Example conversion group.">
+ <sample_time>
+ <IN0>ADC_SAMPLE_3</IN0>
+ <IN1>ADC_SAMPLE_3</IN1>
+ <IN2>ADC_SAMPLE_3</IN2>
+ <IN3>ADC_SAMPLE_3</IN3>
+ <IN4>ADC_SAMPLE_3</IN4>
+ <IN5>ADC_SAMPLE_3</IN5>
+ <IN6>ADC_SAMPLE_3</IN6>
+ <IN7>ADC_SAMPLE_3</IN7>
+ <IN8>ADC_SAMPLE_3</IN8>
+ <IN9>ADC_SAMPLE_3</IN9>
+ <IN10>ADC_SAMPLE_3</IN10>
+ <IN11>ADC_SAMPLE_3</IN11>
+ <IN12>ADC_SAMPLE_3</IN12>
+ <IN13>ADC_SAMPLE_3</IN13>
+ <IN14>ADC_SAMPLE_3</IN14>
+ <IN15>ADC_SAMPLE_3</IN15>
+ <SENSOR>ADC_SAMPLE_3</SENSOR>
+ <VREFINT>ADC_SAMPLE_3</VREFINT>
+ <VBAT>ADC_SAMPLE_3</VBAT>
+ </sample_time>
+ <channels_sequence>
+ <channel>ADC_CHANNEL_IN0</channel>
+ </channels_sequence>
+ </group>
+ </groups>
+ </adc_config></configs>
+</configuration>
|