forked from M-Labs/artiq
1
0
Fork 0

dds: make init_sync accessible for AD9914 only

This commit is contained in:
Sebastien Bourdeauducq 2016-08-15 17:45:18 +08:00
parent c4d17138a1
commit 23b704802d
1 changed files with 18 additions and 18 deletions

View File

@ -156,24 +156,6 @@ class _DDSGeneric:
timing margin.""" timing margin."""
dds_init(now_mu(), self.bus_channel, self.channel) dds_init(now_mu(), self.bus_channel, self.channel)
@kernel
def init_sync(self, sync_delay=0):
"""Resets and initializes the DDS channel as well as configures
the AD9914 DDS for synchronisation. The synchronisation procedure
follows the steps outlined in the AN-1254 application note.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this.
This function cannot be used in a batch; the correct way of
initializing multiple DDS channels is to call this function
sequentially with a delay between the calls. 10ms provides a good
timing margin.
:param sync_delay: integer from 0 to 0x3f that sets value of
SYNC_OUT (bits 3-5) and SYNC_IN (bits 0-2) delay ADJ bits."""
dds_init_sync(now_mu(), self.bus_channel, self.channel, sync_delay)
@kernel @kernel
def set_phase_mode(self, phase_mode): def set_phase_mode(self, phase_mode):
"""Sets the phase mode of the DDS channel. Supported phase modes are: """Sets the phase mode of the DDS channel. Supported phase modes are:
@ -236,3 +218,21 @@ class AD9914(_DDSGeneric):
"""Driver for AD9914 DDS chips. See ``_DDSGeneric`` for a description """Driver for AD9914 DDS chips. See ``_DDSGeneric`` for a description
of the functionality.""" of the functionality."""
pow_width = 16 pow_width = 16
@kernel
def init_sync(self, sync_delay=0):
"""Resets and initializes the DDS channel as well as configures
the AD9914 DDS for synchronisation. The synchronisation procedure
follows the steps outlined in the AN-1254 application note.
This needs to be done for each DDS channel before it can be used, and
it is recommended to use the startup kernel for this.
This function cannot be used in a batch; the correct way of
initializing multiple DDS channels is to call this function
sequentially with a delay between the calls. 10ms provides a good
timing margin.
:param sync_delay: integer from 0 to 0x3f that sets value of
SYNC_OUT (bits 3-5) and SYNC_IN (bits 0-2) delay ADJ bits."""
dds_init_sync(now_mu(), self.bus_channel, self.channel, sync_delay)