Skip to content

Instantly share code, notes, and snippets.

@mfe5003
Created August 25, 2018 15:42
Show Gist options
  • Save mfe5003/215d231a1b7c90f31b2b4e5f52a3b49b to your computer and use it in GitHub Desktop.
Save mfe5003/215d231a1b7c90f31b2b4e5f52a3b49b to your computer and use it in GitHub Desktop.
additions to CPLD code for ad9910 profile support
# CFG configuration register bit masks
CFG_PROF_MASK = 7 << CFG_PROFILE
@kernel
def change_profile(self, profile):
"""Change the DDS profile for all channels in the configuration register.
:param profile: profile number between 0 and 7
"""
self.cfg_write((self.cfg_reg & ~CFG_PROF_MASK) | ((profile & 7) << CFG_PROFILE))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment