Skip to content

Commit

Permalink
Merge pull request #594 from trishaange01/ad7746_adxrs290_support
Browse files Browse the repository at this point in the history
Update ad7746 test
  • Loading branch information
tfcollins authored Sep 11, 2024
2 parents 849f787 + 980d44d commit 41e385f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion test/emu/devices/ad7746.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE context [<!ELEMENT context (device | context-attribute)*><!ELEMENT context-attribute EMPTY><!ELEMENT device (channel | attribute | debug-attribute | buffer-attribute)*><!ELEMENT channel (scan-element?, attribute*)><!ELEMENT attribute EMPTY><!ELEMENT scan-element EMPTY><!ELEMENT debug-attribute EMPTY><!ELEMENT buffer-attribute EMPTY><!ATTLIST context name CDATA #REQUIRED description CDATA #IMPLIED><!ATTLIST context-attribute name CDATA #REQUIRED value CDATA #REQUIRED><!ATTLIST device id CDATA #REQUIRED name CDATA #IMPLIED><!ATTLIST channel id CDATA #REQUIRED type (input|output) #REQUIRED name CDATA #IMPLIED><!ATTLIST scan-element index CDATA #REQUIRED format CDATA #REQUIRED scale CDATA #IMPLIED><!ATTLIST attribute name CDATA #REQUIRED filename CDATA #IMPLIED value CDATA #IMPLIED><!ATTLIST debug-attribute name CDATA #REQUIRED value CDATA #IMPLIED><!ATTLIST buffer-attribute name CDATA #REQUIRED value CDATA #IMPLIED>]><context name="network" description="192.168.10.151 Linux analog 5.15.92-v7l+ #1 SMP Tue Apr 2 06:14:52 UTC 2024 armv7l" ><context-attribute name="hw_carrier" value="Raspberry Pi 4 Model B Rev 1.1" /><context-attribute name="dtoverlay" value="vc4-kms-v3d,rpi-cn0552" /><context-attribute name="local,kernel" value="5.15.92-v7l+" /><context-attribute name="uri" value="ip:192.168.10.151" /><context-attribute name="ip,ip-addr" value="192.168.10.151" /><device id="hwmon0" name="rpi_volt" ><channel id="in0" type="input" ><attribute name="lcrit_alarm" filename="in0_lcrit_alarm" value="0" /></channel></device><device id="iio:device0" name="ad7746" ><channel id="voltage1" name="supply" type="input" ><attribute name="label" filename="in_voltage1_supply_label" value="supply" /><attribute name="raw" filename="in_voltage1_supply_raw" value="23759046" /><attribute name="sampling_frequency" filename="in_voltage_sampling_frequency" value="50" /><attribute name="sampling_frequency_available" filename="in_voltage_sampling_frequency_available" value="50 31 16 8" /><attribute name="scale" filename="in_voltage_scale" value="0.000139474" /></channel><channel id="capacitance1" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibbias_calibration" filename="in_capacitance1_calibbias_calibration" value="ERROR" /><attribute name="calibscale" filename="in_capacitance1_calibscale" value="1.376861" /><attribute name="calibscale_calibration" filename="in_capacitance1_calibscale_calibration" value="ERROR" /><attribute name="offset" filename="in_capacitance1_offset" value="0" /><attribute name="raw" filename="in_capacitance1_raw" value="-8388608" /><attribute name="sampling_frequency" filename="in_capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance_scale" value="0.000000488" /></channel><channel id="capacitance0" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibbias_calibration" filename="in_capacitance0_calibbias_calibration" value="ERROR" /><attribute name="calibscale" filename="in_capacitance0_calibscale" value="1.376861" /><attribute name="calibscale_calibration" filename="in_capacitance0_calibscale_calibration" value="ERROR" /><attribute name="offset" filename="in_capacitance0_offset" value="0" /><attribute name="raw" filename="in_capacitance0_raw" value="8388607" /><attribute name="sampling_frequency" filename="in_capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance_scale" value="0.000000488" /></channel><channel id="capacitance0-capacitance2" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibscale" filename="in_capacitance0-capacitance2_calibscale" value="1.376861" /><attribute name="offset" filename="in_capacitance0-capacitance2_offset" value="0" /><attribute name="raw" filename="in_capacitance0-capacitance2_raw" value="8388607" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /></channel><channel id="temp0" type="input" ><attribute name="input" filename="in_temp0_input" value="34211" /></channel><channel id="capacitance1-capacitance3" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibbias" filename="in_capacitance_calibbias" value="32768" /><attribute name="calibscale" filename="in_capacitance1-capacitance3_calibscale" value="1.376861" /><attribute name="offset" filename="in_capacitance1-capacitance3_offset" value="0" /><attribute name="raw" filename="in_capacitance1-capacitance3_raw" value="-8388608" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="91" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /></channel><channel id="voltage0" type="input" ><attribute name="calibscale_calibration" filename="in_voltage0_calibscale_calibration" value="ERROR" /><attribute name="raw" filename="in_voltage0_raw" value="10759" /><attribute name="sampling_frequency" filename="in_voltage_sampling_frequency" value="50" /><attribute name="sampling_frequency_available" filename="in_voltage_sampling_frequency_available" value="50 31 16 8" /><attribute name="scale" filename="in_voltage_scale" value="0.000139474" /></channel><channel id="temp1" type="input" ><attribute name="input" filename="in_temp1_input" value="-248295" /></channel></device><device id="iio_sysfs_trigger" ><attribute name="add_trigger" value="ERROR" /><attribute name="remove_trigger" value="ERROR" /></device></context>
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE context [<!ELEMENT context (device | context-attribute)*><!ELEMENT context-attribute EMPTY><!ELEMENT device (channel | attribute | debug-attribute | buffer-attribute)*><!ELEMENT channel (scan-element?, attribute*)><!ELEMENT attribute EMPTY><!ELEMENT scan-element EMPTY><!ELEMENT debug-attribute EMPTY><!ELEMENT buffer-attribute EMPTY><!ATTLIST context name CDATA #REQUIRED description CDATA #IMPLIED><!ATTLIST context-attribute name CDATA #REQUIRED value CDATA #REQUIRED><!ATTLIST device id CDATA #REQUIRED name CDATA #IMPLIED><!ATTLIST channel id CDATA #REQUIRED type (input|output) #REQUIRED name CDATA #IMPLIED><!ATTLIST scan-element index CDATA #REQUIRED format CDATA #REQUIRED scale CDATA #IMPLIED><!ATTLIST attribute name CDATA #REQUIRED filename CDATA #IMPLIED value CDATA #IMPLIED><!ATTLIST debug-attribute name CDATA #REQUIRED value CDATA #IMPLIED><!ATTLIST buffer-attribute name CDATA #REQUIRED value CDATA #IMPLIED>]><context name="network" description="192.168.10.151 Linux analog 6.1.54-v7l+ #1 SMP Mon Aug 5 09:24:25 UTC 2024 armv7l" ><context-attribute name="hw_carrier" value="Raspberry Pi 4 Model B Rev 1.1" /><context-attribute name="dtoverlay" value="vc4-kms-v3d,rpi-cn0552" /><context-attribute name="hw_model" value="0x0001 on Raspberry Pi 4 Model B Rev 1.1" /><context-attribute name="hw_mezzanine" value="0x0001" /><context-attribute name="hw_name" value="PMD-RPI-INTZ" /><context-attribute name="hw_vendor" value="Analog Devices, Inc." /><context-attribute name="hw_serial" value="1eff9747-601b-4b3b-bc02-97c7fc0b6904" /><context-attribute name="local,kernel" value="6.1.54-v7l+" /><context-attribute name="uri" value="ip:192.168.10.151" /><context-attribute name="ip,ip-addr" value="192.168.10.151" /><device id="hwmon0" name="cpu_thermal" ><channel id="temp1" type="input" ><attribute name="crit" filename="temp1_crit" value="110000" /><attribute name="input" filename="temp1_input" value="42842" /></channel></device><device id="hwmon1" name="rpi_volt" ><channel id="in0" type="input" ><attribute name="lcrit_alarm" filename="in0_lcrit_alarm" value="0" /></channel></device><device id="iio:device0" name="ad7746" ><channel id="voltage1" name="supply" type="input" ><attribute name="label" filename="in_voltage1_supply_label" value="supply" /><attribute name="raw" filename="in_voltage1_supply_raw" value="3959339" /><attribute name="sampling_frequency" filename="in_voltage_sampling_frequency" value="8" /><attribute name="sampling_frequency_available" filename="in_voltage_sampling_frequency_available" value="50 31 16 8" /><attribute name="scale" filename="in_voltage1_supply_scale" value="0.000836849" /></channel><channel id="capacitance1" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibbias_calibration" filename="in_capacitance1_calibbias_calibration" value="ERROR" /><attribute name="calibscale" filename="in_capacitance1_calibscale" value="1.000000" /><attribute name="calibscale_calibration" filename="in_capacitance1_calibscale_calibration" value="ERROR" /><attribute name="offset" filename="in_capacitance1_offset" value="5079690" /><attribute name="raw" filename="in_capacitance1_raw" value="-7341632" /><attribute name="sampling_frequency" filename="in_capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance_scale" value="0.000000488" /></channel><channel id="capacitance0" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibbias_calibration" filename="in_capacitance0_calibbias_calibration" value="ERROR" /><attribute name="calibscale" filename="in_capacitance0_calibscale" value="1.000000" /><attribute name="calibscale_calibration" filename="in_capacitance0_calibscale_calibration" value="ERROR" /><attribute name="offset" filename="in_capacitance0_offset" value="5079690" /><attribute name="raw" filename="in_capacitance0_raw" value="8388607" /><attribute name="sampling_frequency" filename="in_capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance_scale" value="0.000000488" /></channel><channel id="voltage0" type="input" ><attribute name="calibscale_calibration" filename="in_voltage0_calibscale_calibration" value="ERROR" /><attribute name="raw" filename="in_voltage0_raw" value="3959224" /><attribute name="sampling_frequency" filename="in_voltage_sampling_frequency" value="8" /><attribute name="sampling_frequency_available" filename="in_voltage_sampling_frequency_available" value="50 31 16 8" /><attribute name="scale" filename="in_voltage0_scale" value="0.000139474" /></channel><channel id="capacitance0-capacitance2" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibscale" filename="in_capacitance0-capacitance2_calibscale" value="1.000000" /><attribute name="raw" filename="in_capacitance0-capacitance2_raw" value="-7341632" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="zeropoint" filename="in_capacitance0-capacitance2_zeropoint" value="0" /></channel><channel id="capacitance1-capacitance3" type="input" ><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibbias" filename="in_capacitance_calibbias" value="50" /><attribute name="calibscale" filename="in_capacitance1-capacitance3_calibscale" value="1.000000" /><attribute name="raw" filename="in_capacitance1-capacitance3_raw" value="8388607" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency" filename="in_capacitance-capacitance_sampling_frequency" value="9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="sampling_frequency_available" filename="in_capacitance_sampling_frequency_available" value="91 84 50 26 16 13 11 9" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="scale" filename="in_capacitance-capacitance_scale" value="0.000000488" /><attribute name="zeropoint" filename="in_capacitance1-capacitance3_zeropoint" value="0" /></channel><channel id="temp0" type="input" ><attribute name="raw" filename="in_temp0_raw" value="10731" /><attribute name="scale" filename="in_temp_scale" value="0.488281250" /></channel><channel id="temp1" type="input" ><attribute name="raw" filename="in_temp1_raw" value="10731" /><attribute name="scale" filename="in_temp_scale" value="0.488281250" /></channel><attribute name="waiting_for_supplier" value="0" /></device></context>
8 changes: 0 additions & 8 deletions test/test_ad7746.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
@pytest.mark.parametrize(
"channel, attr",
[
(TEMP_INT, "input"),
(TEMP_EXT, "input"),
(VIN, "raw"),
(VIN_VDD, "raw"),
(VIN, "scale"),
Expand Down Expand Up @@ -161,17 +159,11 @@ def test_ad7746_attr_singleval(
(CIN2, "calibbias", [0, 62745, 125, 50], 0.5, 2),
(CIN2_DIFF, "calibbias", [0, 62745, 125, 50], 0.5, 2),
(CIN1, "offset", ["8127504"], 1, 2),
(CIN1_DIFF, "offset", ["8127504"], 1, 2),
(CIN2, "offset", ["8127504"], 1, 2),
(CIN2_DIFF, "offset", ["8127504"], 1, 2),
(CIN1, "offset", ["7111566"], 1, 2),
(CIN1_DIFF, "offset", ["7111566"], 1, 2),
(CIN2, "offset", ["7111566"], 1, 2),
(CIN2_DIFF, "offset", ["7111566"], 1, 2),
(CIN1, "offset", ["5079690"], 1, 2),
(CIN1_DIFF, "offset", ["5079690"], 1, 2),
(CIN2, "offset", ["5079690"], 1, 2),
(CIN2_DIFF, "offset", ["5079690"], 1, 2),
],
)
def test_ad7746_attr_multiple_val(
Expand Down

0 comments on commit 41e385f

Please sign in to comment.