summaryrefslogtreecommitdiffstats
path: root/xml
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-10-19 15:58:46 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-10-19 15:58:46 +0200
commit55255f2ce3a2234850249efcabd9ba32d0a89a9c (patch)
tree586d075665bebbb698e3a84eee6595f47401997f /xml
parent87ef1499bfcaa0ea2a58cb6d3c327162507f6ac8 (diff)
downloadpcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.gz
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.bz2
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.tar.xz
pcitool-55255f2ce3a2234850249efcabd9ba32d0a89a9c.zip
Support computed (property-based) registers
Diffstat (limited to 'xml')
-rw-r--r--xml/test/camera.xml2
-rw-r--r--xml/types.xsd13
2 files changed, 14 insertions, 1 deletions
diff --git a/xml/test/camera.xml b/xml/test/camera.xml
index 81335b7..a84299a 100644
--- a/xml/test/camera.xml
+++ b/xml/test/camera.xml
@@ -106,7 +106,7 @@
<register address="0x1b0" offset="0" size="32" default="0" rwmask="0" mode="R" name="ddr_num_frames"/>
</bank>
<bank bar="0" size="0x0200" protocol="software_registers" read_address="0x0" write_address="0x0" word_size="32" endianess="little" format="0x%lx" name="dma" description="DMA Registers"/>
- <transform path="/test/prop1" unit="C" read_from_register="(503975./1024000)*${/registers/fpga/sensor_temperature:C} - 27315./100" write_to_register="(${/registers/fpga/sensor_temperature:C} + 27315./100)*(1024000./503975)" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
+ <transform path="/test/prop1" register="test_prop1" unit="C" read_from_register="(503975./1024000)*${/registers/fpga/sensor_temperature:C} - 27315./100" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
<transform name="formuu1" unit="C" read_from_register="(503975./1024000)*$value - 27315./100" write_to_register="($value + 27315./100)*(1024000./503975)" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
<transform name="formuu2" unit="C1" read_from_register="((1./4)*($value - 1200)) if $freq==0 else ((3./10)*($value - 1000))" write_to_register="4*$value + 1200 if $freq==0 else (10./3)*$value + 1000" description="formula to get real sensor temperature from the sensor_temperature register in decimal"/>
<transform name="formuu3" unit="us" read_from_register="($value+(43./100))*129./(40*1000000)if $freq==0 else ($value+(43./100))*129./(48*1000000)" write_to_register="$value/129.*(40*1000000) - 43./100 if $freq==0 else $value/129.*(48*1000000) - 43./100" description="formula to get real exposure time from the cmosis_exp_time register in decimal"/>
diff --git a/xml/types.xsd b/xml/types.xsd
index edcfb08..78be773 100644
--- a/xml/types.xsd
+++ b/xml/types.xsd
@@ -58,6 +58,7 @@
<xsd:attribute name="name" type="xsd:ID" />
<xsd:attribute name="unit" type="xsd:string" />
<xsd:attribute name="type" type="pcilib_data_type_t" />
+ <xsd:attribute name="mode" type="pcilib_access_mode_t" />
<xsd:attribute name="visible" type="bool_t" default="0" />
<xsd:attribute name="description" type="xsd:string" />
</xsd:complexType>
@@ -66,6 +67,7 @@
<xsd:complexContent>
<xsd:extension base="pcilib_view_t">
<xsd:attribute name="path" type="xsd:string" />
+ <xsd:attribute name="register" type="xsd:string" />
<xsd:attribute name="read_from_register" type="xsd:string" />
<xsd:attribute name="write_to_register" type="xsd:string" />
<!-- xsd 1.1 <xsd:assert test="(@path and not(@name)) or (not(@path) and @name)"/> -->
@@ -180,13 +182,24 @@
<xsd:enumeration value="dma3"/>
</xsd:restriction>
</xsd:simpleType>
+ <xsd:simpleType name="pcilib_access_mode_t">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="-"/>
+ <xsd:enumeration value="R"/>
+ <xsd:enumeration value="W"/>
+ <xsd:enumeration value="RW"/>
+ </xsd:restriction>
+ </xsd:simpleType>
<xsd:simpleType name="pcilib_register_mode_t">
<xsd:restriction base="xsd:string">
+ <xsd:enumeration value="-"/>
<xsd:enumeration value="R"/>
<xsd:enumeration value="W"/>
<xsd:enumeration value="RW"/>
<xsd:enumeration value="W1C"/>
<xsd:enumeration value="RW1C"/>
+ <xsd:enumeration value="W1I"/>
+ <xsd:enumeration value="RW1I"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="pcilib_data_type_t">