forked from M-Labs/artiq
lda: add support for ping
This commit is contained in:
parent
d51493fb5d
commit
b672a99174
@ -63,6 +63,9 @@ class Ldasim:
|
|||||||
print("setting attenuation to {}".format(att))
|
print("setting attenuation to {}".format(att))
|
||||||
self._attenuation = att
|
self._attenuation = att
|
||||||
|
|
||||||
|
def ping(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class Lda:
|
class Lda:
|
||||||
"""Lab Brick Digital Attenuator driver.
|
"""Lab Brick Digital Attenuator driver.
|
||||||
@ -230,3 +233,10 @@ class Lda:
|
|||||||
raise ValueError("Cannot set attenuation {} < 0".format(att))
|
raise ValueError("Cannot set attenuation {} < 0".format(att))
|
||||||
else:
|
else:
|
||||||
self.set(0x8d, bytes([int(round(att.amount*4))]))
|
self.set(0x8d, bytes([int(round(att.amount*4))]))
|
||||||
|
|
||||||
|
def ping(self):
|
||||||
|
try:
|
||||||
|
self.get_attenuation()
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user