2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-24 10:54:02 +08:00

added docstrings to ad9910.py

This commit is contained in:
Garrett 2019-11-11 15:50:40 -06:00 committed by Robert Jördens
parent 4ad3651022
commit 3a19ba7e62

View File

@ -529,14 +529,26 @@ class AD9910:
@kernel
def set_ftw(self, ftw):
"""Set the value stored to the AD9910's frequency tuning word (FTW) register.
:param ftw: Frequency tuning word to be stored, range: 0 to 0xffffffff.
"""
self.write32(_AD9910_REG_FTW, ftw)
@kernel
def set_asf(self, asf):
"""Set the value stored to the AD9910's amplitude scale factor (ASF) register.
:param asf: Amplitude scale factor to be stored, range: 0 to 0x3ffe.
"""
self.write32(_AD9910_REG_ASF, asf<<2)
@kernel
def set_pow(self, pow_):
"""Set the value stored to the AD9910's phase offset word (POW) register.
:param pow_: Phase offset word to be stored, range: 0 to 0xffff.
"""
self.write32(_AD9910_REG_POW, pow_)
@portable(flags={"fast-math"})
@ -633,18 +645,26 @@ class AD9910:
@kernel
def set_frequency(self, frequency):
"""Set the value stored to the AD9910's FTW register
"""Set the value stored to the AD9910's frequency tuning word (FTW) register.
:param frequency: frequency to be stored, in Hz
:param frequency: frequency to be stored, in Hz.
"""
return self.set_ftw(self.frequency_to_ftw(frequency))
@kernel
def set_amplitude(self, amplitude):
"""Set the value stored to the AD9910's amplitude scale factor (ASF) register.
:param amplitude: amplitude to be stored, in units of full scale.
"""
return self.set_asf(self.amplitude_to_asf(amplitude))
@kernel
def set_phase(self, turns):
"""Set the value stored to the AD9910's phase offset word (POW) register.
:param turns: phase offset to be stored, in turns.
"""
return self.set_pow(self.turns_to_pow(turns))
@kernel