From f73e2a3d30b9243bb636038031216a65487ddc73 Mon Sep 17 00:00:00 2001 From: Fabian Schmid Date: Sun, 17 Nov 2019 16:51:26 +0100 Subject: [PATCH] doc: clarify urukul attenuator behavior Closes #1386 Signed-off-by: Fabian Schmid --- artiq/coredevice/ad9910.py | 4 ++++ artiq/coredevice/ad9912.py | 4 ++++ artiq/coredevice/urukul.py | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/artiq/coredevice/ad9910.py b/artiq/coredevice/ad9910.py index a93242455..9982dbf06 100644 --- a/artiq/coredevice/ad9910.py +++ b/artiq/coredevice/ad9910.py @@ -684,6 +684,8 @@ class AD9910: def set_att_mu(self, att): """Set digital step attenuator in machine units. + This method will write the attenuator settings of all four channels. + .. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att_mu` :param att: Attenuation setting, 8 bit digital. @@ -694,6 +696,8 @@ class AD9910: def set_att(self, att): """Set digital step attenuator in SI units. + This method will write the attenuator settings of all four channels. + .. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att` :param att: Attenuation in dB. diff --git a/artiq/coredevice/ad9912.py b/artiq/coredevice/ad9912.py index adcfcb4dc..9e1005932 100644 --- a/artiq/coredevice/ad9912.py +++ b/artiq/coredevice/ad9912.py @@ -113,6 +113,8 @@ class AD9912: def set_att_mu(self, att): """Set digital step attenuator in machine units. + This method will write the attenuator settings of all four channels. + .. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att_mu` :param att: Attenuation setting, 8 bit digital. @@ -123,6 +125,8 @@ class AD9912: def set_att(self, att): """Set digital step attenuator in SI units. + This method will write the attenuator settings of all four channels. + .. seealso:: :meth:`artiq.coredevice.urukul.CPLD.set_att` :param att: Attenuation in dB. Higher values mean more attenuation. diff --git a/artiq/coredevice/urukul.py b/artiq/coredevice/urukul.py index cf84bd94f..2cad18188 100644 --- a/artiq/coredevice/urukul.py +++ b/artiq/coredevice/urukul.py @@ -288,7 +288,8 @@ class CPLD: def set_att_mu(self, channel, att): """Set digital step attenuator in machine units. - This method will write the attenuator settings of all four channels. + This method will also write the attenuator settings of the three other channels. Use + :meth:`get_att_mu` to retrieve the hardware state set in previous experiments. :param channel: Attenuator channel (0-3). :param att: Digital attenuation setting: @@ -315,6 +316,10 @@ class CPLD: def set_att(self, channel, att): """Set digital step attenuator in SI units. + This method will write the attenuator settings of all four channels. + + .. seealso:: :meth:`set_att_mu` + :param channel: Attenuator channel (0-3). :param att: Attenuation setting in dB. Higher value is more attenuation. Minimum attenuation is 0*dB, maximum attenuation is @@ -326,6 +331,8 @@ class CPLD: def get_att_mu(self): """Return the digital step attenuator settings in machine units. + The result is stored and will be used in future calls of :meth:`set_att_mu`. + :return: 32 bit attenuator settings """ self.bus.set_config_mu(SPI_CONFIG | spi.SPI_INPUT, 32,