ad7124
- class adi.ad7124.ad7124(uri='', device_name='', device_index=0)
Bases:
rx_chan_compAD7124 4/8-channel, low-noise, low-power, 24-bit sigma-delta ADC.
Analog input configuration (single-ended, differential, unipolar, bipolar) is set in the device tree. This class scans all channels and creates both a
channel[]list attribute and individual channel attributes for channel IDs that are valid Python identifiers, for example:my_ad7124.temp(temperature sensor)my_ad7124.voltage0(single-ended voltage input)
Differential channels such as
voltage0-voltage1are available throughchannel[]or asmy_ad7124.voltage0_voltage1(hyphens sanitized to underscores to form valid Python identifiers).The
enable_single_cycledevice attribute defaults to ‘Y’, and ensures that when multiple channels are enabled, output data is fully settled; intermediate, unsettled outputs from the digital filter are ignored. Setting to ‘N’ includes these unsettled samples, and is thus only valid when a single channel is valid. WARNING: Setting to ‘N’ when multiple channels are enabled will result in invalid data.Each voltage channel has the following sub-attributes:
raw– Raw ADC code (read only)scale/scale_available– ADC scale (millivolts per LSB) and available scalesfilter_type/filter_type_available– Digital filter typesampling_frequency– Per-channel sampling frequency__call__()– Returns reading in millivolts
The temperature channel is the same, with these exceptions:
scaledoes not have a setterscale_availabledoes not apply (raises error)__call__()returns temperature in degrees Celsius
Dynamic Attributes
The ad7124 class supports a variable number of channels depending on the hardware configuration. Channel property interfaces are dynamically generated using their IIO channel IDs and are available in channel and as named attributes (e.g. temp or dev.voltage0_voltage1). Voltage channels are instances of _ad7124_channel and temperature channels are instances of _temp_channel.