Skip to content

Commit

Permalink
Add emulation support for AD7124-8
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Nov 22, 2023
1 parent 0e13595 commit adec4bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/emu/devices/ad7124-8.xml
Original file line number Diff line number Diff line change
@@ -0,0 +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="serial" description="no-OS 0.1" ><context-attribute name="hw_carrier" value="SDP_K1" /><context-attribute name="hw_mezzanine" value="EVAL-AD7124-8ASDZ" /><context-attribute name="hw_name" value="EVAL-AD7124-8ASDZ" /><context-attribute name="uri" value="serial:/dev/ttyS0,230400,8n1n" /><context-attribute name="serial,port" value="/dev/ttyS0" /><context-attribute name="serial,description" value="ttyS0" /><device id="iio:device0" name="ad7124-8" ><channel id="voltage0" name="voltage0" type="input" ><scan-element index="0" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage0_raw" value="12888383" /><attribute name="scale" filename="in_voltage0_scale" value="0.000298" /><attribute name="offset" filename="in_voltage0_offset" value="-8388608" /></channel><channel id="voltage1" name="voltage1" type="input" ><scan-element index="1" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage1_raw" value="13424123" /><attribute name="scale" filename="in_voltage1_scale" value="0.000298" /><attribute name="offset" filename="in_voltage1_offset" value="-8388608" /></channel><channel id="voltage2" name="voltage2" type="input" ><scan-element index="2" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage2_raw" value="11772319" /><attribute name="scale" filename="in_voltage2_scale" value="0.000298" /><attribute name="offset" filename="in_voltage2_offset" value="-8388608" /></channel><channel id="voltage3" name="voltage3" type="input" ><scan-element index="3" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage3_raw" value="10253543" /><attribute name="scale" filename="in_voltage3_scale" value="0.000298" /><attribute name="offset" filename="in_voltage3_offset" value="-8388608" /></channel><channel id="voltage4" name="voltage4" type="input" ><scan-element index="4" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage4_raw" value="10658046" /><attribute name="scale" filename="in_voltage4_scale" value="0.000298" /><attribute name="offset" filename="in_voltage4_offset" value="-8388608" /></channel><channel id="voltage5" name="voltage5" type="input" ><scan-element index="5" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage5_raw" value="12582563" /><attribute name="scale" filename="in_voltage5_scale" value="0.000298" /><attribute name="offset" filename="in_voltage5_offset" value="-8388608" /></channel><channel id="voltage6" name="voltage6" type="input" ><scan-element index="6" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage6_raw" value="13529249" /><attribute name="scale" filename="in_voltage6_scale" value="0.000298" /><attribute name="offset" filename="in_voltage6_offset" value="-8388608" /></channel><channel id="voltage7" name="voltage7" type="input" ><scan-element index="7" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage7_raw" value="12473086" /><attribute name="scale" filename="in_voltage7_scale" value="0.000298" /><attribute name="offset" filename="in_voltage7_offset" value="-8388608" /></channel><channel id="voltage8" name="voltage8" type="input" ><scan-element index="8" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage8_raw" value="10601046" /><attribute name="scale" filename="in_voltage8_scale" value="0.000298" /><attribute name="offset" filename="in_voltage8_offset" value="-8388608" /></channel><channel id="voltage9" name="voltage9" type="input" ><scan-element index="9" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage9_raw" value="10309732" /><attribute name="scale" filename="in_voltage9_scale" value="0.000298" /><attribute name="offset" filename="in_voltage9_offset" value="-8388608" /></channel><channel id="voltage10" name="voltage10" type="input" ><scan-element index="10" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage10_raw" value="11928386" /><attribute name="scale" filename="in_voltage10_scale" value="0.000298" /><attribute name="offset" filename="in_voltage10_offset" value="-8388608" /></channel><channel id="voltage11" name="voltage11" type="input" ><scan-element index="11" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage11_raw" value="13451002" /><attribute name="scale" filename="in_voltage11_scale" value="0.000298" /><attribute name="offset" filename="in_voltage11_offset" value="-8388608" /></channel><channel id="voltage12" name="voltage12" type="input" ><scan-element index="12" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage12_raw" value="12922814" /><attribute name="scale" filename="in_voltage12_scale" value="0.000298" /><attribute name="offset" filename="in_voltage12_offset" value="-8388608" /></channel><channel id="voltage13" name="voltage13" type="input" ><scan-element index="13" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage13_raw" value="10931057" /><attribute name="scale" filename="in_voltage13_scale" value="0.000298" /><attribute name="offset" filename="in_voltage13_offset" value="-8388608" /></channel><channel id="voltage14" name="voltage14" type="input" ><scan-element index="14" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage14_raw" value="10175125" /><attribute name="scale" filename="in_voltage14_scale" value="0.000298" /><attribute name="offset" filename="in_voltage14_offset" value="-8388608" /></channel><channel id="voltage15" name="voltage15" type="input" ><scan-element index="15" format="le:S32/32&gt;&gt;0" /><attribute name="raw" filename="in_voltage15_raw" value="11752352" /><attribute name="scale" filename="in_voltage15_scale" value="0.000298" /><attribute name="offset" filename="in_voltage15_offset" value="-8388608" /></channel><attribute name="sampling_frequency" value="2400" /><debug-attribute name="direct_reg_access" value="143" /></device></context>
11 changes: 11 additions & 0 deletions test/emu/hardware_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,14 @@ adis16475:
- iio:device0
- pyadi_iio_class_support:
- adis16475

ad7124-8:
- ad7124
- pyadi_iio_class_support:
- ad7124
- emulate:
- filename: ad7124-8.xml
- data_devices:
- iio:device0
- pyadi_iio_class_support:
- ad7124

0 comments on commit adec4bb

Please sign in to comment.