blob: f198e822b4a11c14a62eae33269ba642c16cea34 [file] [log] [blame]
Patrick Benavoli95ac0342011-11-07 20:32:51 +01001<?xml version="1.0" encoding="UTF-8"?>
2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
3 <xs:attributeGroup name="Nameable">
Patrick Benavoliee65e6d2011-11-20 18:52:24 +01004 <xs:attribute name="Name" type="xs:NMTOKEN" use="required"/>
Patrick Benavoli95ac0342011-11-07 20:32:51 +01005 <xs:attribute name="Description" type="xs:string" use="optional"/>
6 </xs:attributeGroup>
7 <xs:simpleType name="SizeType">
8 <xs:restriction base="xs:positiveInteger">
9 <xs:pattern value="8|16|32"/>
10 </xs:restriction>
11 </xs:simpleType>
Guillaume Denneulin95331562012-09-27 15:13:10 +020012 <xs:simpleType name="SizeType64">
13 <xs:restriction base="xs:positiveInteger">
14 <xs:pattern value="8|16|32|64"/>
15 </xs:restriction>
16 </xs:simpleType>
Patrick Benavoli95ac0342011-11-07 20:32:51 +010017 <xs:attributeGroup name="IntegerParameterAttributes">
18 <xs:attribute name="Size" type="SizeType" use="required"/>
19 <xs:attribute name="Min" type="xs:integer" use="optional"/>
20 <xs:attribute name="Max" type="xs:integer" use="optional"/>
21 <xs:attribute name="Signed" type="xs:boolean" use="optional" default="false"/>
22 </xs:attributeGroup>
23 <xs:attributeGroup name="ArrayLengthAttribute">
24 <xs:attribute name="ArrayLength" type="xs:nonNegativeInteger" use="optional" default="0"/>
25 </xs:attributeGroup>
Patrick Benavoliee65e6d2011-11-20 18:52:24 +010026 <xs:complexType name="Adaptation">
27 <xs:attribute name="Offset" type="xs:integer" default="0"/>
28 </xs:complexType>
29 <xs:element name="LinearAdaptation">
30 <xs:complexType>
31 <xs:complexContent>
32 <xs:extension base="Adaptation">
33 <xs:attribute name="SlopeNumerator" type="xs:double" default="1"/>
34 <xs:attribute name="SlopeDenominator" type="xs:double" default="1"/>
35 </xs:extension>
36 </xs:complexContent>
37 </xs:complexType>
38 </xs:element>
Patrick Benavoli95ac0342011-11-07 20:32:51 +010039 <xs:complexType name="Parameter" abstract="true">
40 <xs:attributeGroup ref="Nameable"/>
41 <xs:attribute name="Mapping" type="xs:string" use="optional"/>
42 <xs:attributeGroup ref="ArrayLengthAttribute"/>
43 </xs:complexType>
44 <xs:element name="BooleanParameter">
45 <xs:complexType>
46 <xs:complexContent>
47 <xs:extension base="Parameter">
48 <xs:attribute name="Size" fixed="8"/>
49 </xs:extension>
50 </xs:complexContent>
51 </xs:complexType>
52 </xs:element>
53 <xs:complexType name="IntegerParameterType">
54 <xs:complexContent>
55 <xs:extension base="Parameter">
Patrick Benavoliee65e6d2011-11-20 18:52:24 +010056 <xs:choice minOccurs="0">
57 <xs:element ref="LinearAdaptation"/>
58 </xs:choice>
Patrick Benavoli95ac0342011-11-07 20:32:51 +010059 <xs:attributeGroup ref="IntegerParameterAttributes"/>
60 <xs:attribute name="Unit" type="xs:token" use="optional"/>
61 </xs:extension>
62 </xs:complexContent>
63 </xs:complexType>
64 <xs:element name="IntegerParameter" type="IntegerParameterType"/>
65 <xs:complexType name="EnumParameterType">
66 <xs:complexContent>
67 <xs:extension base="Parameter">
68 <xs:sequence>
69 <xs:element name="ValuePair" maxOccurs="unbounded">
70 <xs:complexType>
Patrick Benavoli68808c62012-02-02 17:12:41 +010071 <xs:attribute name="Literal" type="xs:string" use="required"/>
Patrick Benavoliee65e6d2011-11-20 18:52:24 +010072 <xs:attribute name="Numerical" use="required">
Patrick Benavoli95ac0342011-11-07 20:32:51 +010073 <xs:simpleType>
74 <xs:restriction base="xs:string">
75 <xs:pattern value="0|[+-]?[1-9][0-9]*"/>
76 <xs:pattern value="0x[0-9a-fA-F]+"/>
77 </xs:restriction>
78 </xs:simpleType>
79 </xs:attribute>
80 </xs:complexType>
81 </xs:element>
82 </xs:sequence>
83 <xs:attribute name="Size" type="SizeType" use="required"/>
84 </xs:extension>
85 </xs:complexContent>
86 </xs:complexType>
87 <xs:element name="EnumParameter" type="EnumParameterType">
88 <xs:unique name="LiteralUniqueness">
89 <xs:selector xpath="ValuePair"/>
90 <xs:field xpath="@Literal"/>
91 </xs:unique>
92 <xs:unique name="NumericalUniqueness">
93 <xs:selector xpath="ValuePair"/>
94 <xs:field xpath="@Numerical"/>
Patrick Benavoliee65e6d2011-11-20 18:52:24 +010095 </xs:unique>
Patrick Benavoli95ac0342011-11-07 20:32:51 +010096 </xs:element>
97 <xs:complexType name="FixedPointParameterType">
98 <xs:complexContent>
99 <xs:extension base="Parameter">
100 <xs:attribute name="Size" type="SizeType" use="required"/>
101 <xs:attribute name="Integral" type="xs:nonNegativeInteger" use="required"/>
102 <xs:attribute name="Fractional" type="xs:nonNegativeInteger" use="required"/>
103 <xs:attribute name="Unit" type="xs:token" use="optional"/>
104 </xs:extension>
105 </xs:complexContent>
106 </xs:complexType>
107 <xs:element name="FixedPointParameter" type="FixedPointParameterType"/>
108 <xs:complexType name="BitParameterType">
109 <xs:attributeGroup ref="Nameable"/>
110 <xs:attribute name="Size" use="required">
111 <xs:simpleType>
112 <xs:restriction base="xs:positiveInteger">
Guillaume Denneulin95331562012-09-27 15:13:10 +0200113 <xs:maxInclusive value="64"/>
Patrick Benavoli95ac0342011-11-07 20:32:51 +0100114 </xs:restriction>
115 </xs:simpleType>
116 </xs:attribute>
117 <xs:attribute name="Pos" use="required">
118 <xs:simpleType>
119 <xs:restriction base="xs:nonNegativeInteger">
Guillaume Denneulin95331562012-09-27 15:13:10 +0200120 <xs:maxInclusive value="63"/>
Patrick Benavoli95ac0342011-11-07 20:32:51 +0100121 </xs:restriction>
122 </xs:simpleType>
123 </xs:attribute>
Patrick Benavoli79f16cc2011-11-25 22:36:41 +0100124 <xs:attribute name="Max" type="xs:integer" use="optional"/>
Patrick Benavoli95ac0342011-11-07 20:32:51 +0100125 </xs:complexType>
126 <xs:element name="BitParameterBlock">
127 <xs:complexType>
128 <xs:sequence>
129 <xs:element name="BitParameter" type="BitParameterType" maxOccurs="unbounded"/>
130 </xs:sequence>
131 <xs:attributeGroup ref="Nameable"/>
Guillaume Denneulin95331562012-09-27 15:13:10 +0200132 <xs:attribute name="Size" type="SizeType64" use="required"/>
Patrick Benavoli95ac0342011-11-07 20:32:51 +0100133 <xs:attribute name="Mapping" type="xs:string" use="optional"/>
134 </xs:complexType>
135 <xs:unique name="BitParameterBlockSubElementsUniqueness">
136 <xs:selector xpath="*"/>
137 <xs:field xpath="@Name"/>
138 </xs:unique>
139 </xs:element>
140 <xs:element name="StringParameter">
141 <xs:complexType>
142 <xs:attributeGroup ref="Nameable"/>
143 <xs:attribute name="Mapping" type="xs:string" use="optional"/>
144 <xs:attribute name="MaxLength" type="xs:nonNegativeInteger" use="required"/>
145 </xs:complexType>
146 </xs:element>
147 <xs:group name="ParameterBlockGroup">
148 <xs:choice>
149 <xs:element ref="BooleanParameter"/>
150 <xs:element ref="IntegerParameter"/>
151 <xs:element ref="EnumParameter"/>
152 <xs:element ref="FixedPointParameter"/>
153 <xs:element ref="BitParameterBlock"/>
154 <xs:element ref="StringParameter"/>
155 <xs:element name="ParameterBlock" type="ParameterBlockType">
156 <xs:unique name="ParameterBlockSubElementsUniqueness">
157 <xs:selector xpath="*"/>
158 <xs:field xpath="@Name"/>
159 </xs:unique>
160 </xs:element>
161 </xs:choice>
162 </xs:group>
163 <xs:complexType name="ParameterBlockType">
164 <xs:sequence>
165 <xs:group ref="ParameterBlockGroup" maxOccurs="unbounded"/>
166 </xs:sequence>
167 <xs:attributeGroup ref="Nameable"/>
168 <xs:attributeGroup ref="ArrayLengthAttribute"/>
169 <xs:attribute name="Mapping" type="xs:string" use="optional"/>
170 </xs:complexType>
171</xs:schema>