2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

urukul, ad9912, ad9910: expose CFG RF switch better

* conincident setting of multiple switches
* per channel setting
This commit is contained in:
Robert Jördens 2018-10-24 11:01:13 +00:00 committed by Robert Jördens
parent 4e04b6b4dd
commit 89a961fb00
3 changed files with 28 additions and 0 deletions

View File

@ -230,3 +230,13 @@ class AD9910:
:param att: Attenuation in dB.
"""
self.cpld.set_att(self.chip_select - 4, att)
@kernel
def cfg_sw(self, state):
"""Set CPLD CFG RF switch state. The RF switch is controlled by the
logical or of the CPLD configuration shift register
RF switch bit and the SW TTL line (if used).
:param state: CPLD CFG RF switch bit
"""
self.cpld.cfg_sw(self.chip_select - 4, state)

View File

@ -182,3 +182,13 @@ class AD9912:
"""
self.set_mu(self.frequency_to_ftw(frequency),
self.turns_to_pow(phase))
@kernel
def cfg_sw(self, state):
"""Set CPLD CFG RF switch state. The RF switch is controlled by the
logical or of the CPLD configuration shift register
RF switch bit and the SW TTL line (if used).
:param state: CPLD CFG RF switch bit
"""
self.cpld.cfg_sw(self.chip_select - 4, state)

View File

@ -231,6 +231,14 @@ class CPLD:
c &= ~(1 << channel)
self.cfg_write(c)
@kernel
def cfg_switches(self, state):
"""Configure all four RF switches through the configuration register.
:param state: RF switch state as a 4 bit integer.
"""
self.cfg_write((self.cfg_reg & ~0xf) | state)
@kernel
def set_att_mu(self, channel, att):
"""Set digital step attenuator in machine units.