ad5592r#
- class adi.ad5592r.ad5592r(uri='', device_name='')#
Bases:
context_manager
AD5592R and AD5593R SPI / I2C interface, 8-channel, 12-bit Confiburable ADC/DAC, digital GPIO
- Analog I/O pins are configured in the device tree and can be ADC, DAC, or both. Channel attributes are as follows, where X corresponds to device channel number:
voltageX_adc.raw: Raw 12-bit ADC code. read only for ADC channels
voltageX_adc.scale: ADC scale, millivolts per lsb
voltageX_adc.scale_available: Available scales, corresponding to Vref*1, Vref*2
voltageX(): Returns ADC reading in millivolts (read only)
voltageX_dac.raw: Raw 12-bit DAC code. read/write for DAC channels
voltageX_dac.scale: ADC scale, millivolts per lsb
voltageX_dac.scale_available: Available scales (corresponding to 1X/2X gain)
voltageX(1234.5): Sets/Returns ADC reading in millivolts
temp.raw: Temperature raw value
temp.scale: Temperature scale value
temp.offset Temperature offset value
temp(): Returns temperature in degrees Celsius
- class channel_adc(ctrl, channel_name, output)#
Bases:
attribute
AD5592R Input Voltage Channels
- property raw#
- property scale#
- property scale_available#
Available scales
- class channel_dac(ctrl, channel_name, output)#
Bases:
channel_adc
AD5592R Output Voltage Channels (Add setter to raw property)
- property raw#
The number of individual channels is based on the hardware configuration of the device. The are individually accessed as properties like so:
dev = adi.ad5592r(uri="ip:analog")
dev.dac_0.raw = 10
dev.dac_1.raw = 30
data = dev.adc_0.raw
print(data)
temp_c = (dev.temp_0.raw + dev.temp_0.offset) * dev.temp_0.scale
print(temp_c)