summaryrefslogtreecommitdiffstats
path: root/xml/test_pywrap
diff options
context:
space:
mode:
Diffstat (limited to 'xml/test_pywrap')
-rw-r--r--xml/test_pywrap/camera.xml6
-rw-r--r--xml/test_pywrap/names.xml16
-rw-r--r--xml/test_pywrap/props.xml14
-rw-r--r--xml/test_pywrap/test_prop2.py7
-rw-r--r--xml/test_pywrap/test_prop3.py4
-rw-r--r--xml/test_pywrap/units.xml35
-rw-r--r--xml/test_pywrap/views.xml6
7 files changed, 88 insertions, 0 deletions
diff --git a/xml/test_pywrap/camera.xml b/xml/test_pywrap/camera.xml
new file mode 100644
index 0000000..4b31209
--- /dev/null
+++ b/xml/test_pywrap/camera.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <bank bar="0" size="0x0200" protocol="software_registers" read_address="0x9000" write_address="0x9000" word_size="32" endianess="little" format="0x%lx" name="fpga" description="IPECamera Registers">
+ <register address="0x00" offset="0" size="32" default="0" rwmask="0" mode="RW" name="reg1"/>
+ </bank>
+</model>
diff --git a/xml/test_pywrap/names.xml b/xml/test_pywrap/names.xml
new file mode 100644
index 0000000..f6ddbcc
--- /dev/null
+++ b/xml/test_pywrap/names.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <enum name="enumm1" description="enum towards temperatures register">
+ <name name="high" value="0x100" min="0x2" max="0x300"/>
+ <name name="low" value="0x010"/>
+ </enum>
+ <enum name="enumm2" description="enum towards sensor_temperature register">
+ <name name="high" value="0x120"/>
+ <name name="low" value="0x010" min="0x00" max="0x020"/>
+ </enum>
+ <enum name="enumm3" description="enum towards cmosis_exp_register register">
+ <name name="short" value="0x000"/>
+ <name name="mid" value="0x010"/>
+ <name name="long" value="0x100" min="0x0F0"/>
+ </enum>
+</model>
diff --git a/xml/test_pywrap/props.xml b/xml/test_pywrap/props.xml
new file mode 100644
index 0000000..137ad04
--- /dev/null
+++ b/xml/test_pywrap/props.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <transform path="/test/prop1" register="test_prop1" unit="C" read_from_register="(503975./1024000)*${/registers/fpga/reg1} + 28715./100" description="formula to get real fpga temperature from the fpga_temperature register in decimal"/>
+ <script path="/test/prop2"
+ register="test_prop2"
+ unit="C"
+ script="test_prop2.py"
+ description="test python script #1"/>
+ <script path="/test/prop3"
+ register="test_prop3"
+ unit="C"
+ script="test_prop3.py"
+ description="test python script #2"/>
+</model>
diff --git a/xml/test_pywrap/test_prop2.py b/xml/test_pywrap/test_prop2.py
new file mode 100644
index 0000000..e9a3364
--- /dev/null
+++ b/xml/test_pywrap/test_prop2.py
@@ -0,0 +1,7 @@
+import pcipywrap
+import os
+
+def read_from_register():
+ reg1_val = pcipywrap.read_register('reg1');
+ test_prop1_val = pcipywrap.read_register('test_prop3');
+ return test_prop1_val - reg1_val;
diff --git a/xml/test_pywrap/test_prop3.py b/xml/test_pywrap/test_prop3.py
new file mode 100644
index 0000000..c1300b3
--- /dev/null
+++ b/xml/test_pywrap/test_prop3.py
@@ -0,0 +1,4 @@
+import os
+
+def read_from_register():
+ return 10;
diff --git a/xml/test_pywrap/units.xml b/xml/test_pywrap/units.xml
new file mode 100644
index 0000000..74ab9f7
--- /dev/null
+++ b/xml/test_pywrap/units.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <unit name="C">
+ <transform unit="K" transform="$value+273.15"/>
+ <transform unit="F" transform="$value*(9./5)+32"/>
+ </unit>
+ <unit name="K">
+ <transform unit="C" transform="$value-273.15"/>
+ <transform unit="F" transform="($value-273.15)*(9./5)+32"/>
+ </unit>
+ <unit name="F">
+ <transform unit="C" transform="($value-32)*5./9"/>
+ <transform unit="K" transform="($value+273.15-32)*5./9"/>
+ </unit>
+ <unit name="s">
+ <transform unit="ms" transform="$value*1000"/>
+ <transform unit="us" transform="$value*1000000"/>
+ <transform unit="ns" transform="$value*1000000000"/>
+ </unit>
+ <unit name="ms">
+ <transform unit="s" transform="$value/1000"/>
+ <transform unit="us" transform="$value*1000"/>
+ <transform unit="ns" transform="$value*1000000"/>
+ </unit>
+ <unit name="us">
+ <transform unit="s" transform="$value/1000000"/>
+ <transform unit="ms" transform="$value/1000"/>
+ <transform unit="ns" transform="$value*1000"/>
+ </unit>
+ <unit name="ns">
+ <transform unit="s" transform="$value/1000000000"/>
+ <transform unit="ms" transform="$value/1000000"/>
+ <transform unit="us" transform="$value/1000"/>
+ </unit>
+</model>
diff --git a/xml/test_pywrap/views.xml b/xml/test_pywrap/views.xml
new file mode 100644
index 0000000..c40cd0f
--- /dev/null
+++ b/xml/test_pywrap/views.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <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"/>
+</model>