summaryrefslogtreecommitdiffstats
path: root/xml
diff options
context:
space:
mode:
Diffstat (limited to 'xml')
-rw-r--r--xml/model.xsd24
-rw-r--r--xml/test/camera.xml34
2 files changed, 57 insertions, 1 deletions
diff --git a/xml/model.xsd b/xml/model.xsd
index 5febd1a..cd0b4b0 100644
--- a/xml/model.xsd
+++ b/xml/model.xsd
@@ -4,8 +4,9 @@
<xsd:element name="model">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="banks" type="banks_type"/>
+ <xsd:element name="banks" type="banks_type" minOccurs="0" maxOccurs="1"/>
<xsd:element name="views" type="views_type" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="units" type="units_type" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:key name="Registerkey">
@@ -107,8 +108,29 @@
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="views" type="reg_to_views_type" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="units_type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="unit" type="unit_type"/>
+ </xsd:sequence>
</xsd:complexType>
+
+
+ <xsd:complexType name="unit_type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="convert_unit" type="convert_unit_type"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="convert_unit_type">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="value" type="xsd:string"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
<xsd:simpleType name="uint8_t">
<xsd:restriction base="xsd:integer">
diff --git a/xml/test/camera.xml b/xml/test/camera.xml
index bf26d80..ed01014 100644
--- a/xml/test/camera.xml
+++ b/xml/test/camera.xml
@@ -491,4 +491,38 @@
<description>enum towards cmosis_exp_register register</description>
</view>
</views>
+ <units>
+ <unit name="C">
+ <convert_unit value="K">@self+273.15</convert_unit>
+ <convert_unit value="F">@self*(9./5)+32</convert_unit>
+ </unit>
+ <unit name="K">
+ <convert_unit value="C">@self-273.15</convert_unit>
+ <convert_unit value="F">(@self-273.15)*(9./5)+32</convert_unit>
+ </unit>
+ <unit name="F">
+ <convert_unit value="C">(@self-32)*5./9</convert_unit>
+ <convert_unit value="K">(@self+273.15-32)*5./9</convert_unit>
+ </unit>
+ <unit name="s">
+ <convert_unit value="ms">@self*1000</convert_unit>
+ <convert_unit value="us">@self*1000000</convert_unit>
+ <convert_unit value="ns">@self*1000000000</convert_unit>
+ </unit>
+ <unit name="ms">
+ <convert_unit value="s">@self/1000</convert_unit>
+ <convert_unit value="us">@self*1000</convert_unit>
+ <convert_unit value="ns">@self*1000000</convert_unit>
+ </unit>
+ <unit name="us">
+ <convert_unit value="s">@self/1000000</convert_unit>
+ <convert_unit value="ms">@self/1000</convert_unit>
+ <convert_unit value="ns">@self*1000</convert_unit>
+ </unit>
+ <unit name="ns">
+ <convert_unit value="s">@self/1000000000</convert_unit>
+ <convert_unit value="ms">@self/1000000</convert_unit>
+ <convert_unit value="us">@self/1000</convert_unit>
+ </unit>
+ </units>
</model>