Skip to content

Commit

Permalink
Merge pull request #1123 from slaclab/xrfdc_mts
Browse files Browse the repository at this point in the history
adding MtsAdcSync/MtsDacSync
  • Loading branch information
ruck314 authored Nov 1, 2023
2 parents cddd5c7 + f72491d commit 46fa286
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions python/surf/xilinx/_RfDataConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,42 @@ def __init__(
expand = False,
))

for i in range(2):
self.add(pr.RemoteVariable(
name = f'MtsFifoCtrl[{i}]',
description = 'index[0] is MtsFifoCtrlADC, index[1] is MtsFifoCtrlDAC',
offset = 0x0010+4*i,
bitSize = 2,
bitOffset = 0,
mode = 'RW',
hidden = True,
))

self.add(pr.RemoteVariable(
name = 'MtsSysRefEnable',
offset = 0x6000+0x1C00+(0x24<<2), # XRFDC_DAC_TILE_DRP_ADDR(0) + XRFDC_HSCOM_ADDR offsets + XRFDC_MTS_SRCAP_T1
bitSize = 1,
bitOffset = 10, # XRFDC_MTS_SRCAP_EN_TRX_M=0x0400
mode = 'RW',
hidden = True,
))

def MtsAdcSync(self):
# Disable the FIFOs
self.MtsFifoCtrl[0].set(0x2)
# Enable SysRef Rx
self.MtsSysRefEnable.set(1)
# Disable the FIFOs
self.MtsFifoCtrl[0].set(0x3)

def MtsDacSync(self):
# Disable the FIFOs
self.MtsFifoCtrl[1].set(0x2)
# Enable SysRef Rx
self.MtsSysRefEnable.set(1)
# Disable the FIFOs
self.MtsFifoCtrl[1].set(0x3)

def Init(self, dynamicNco=False):

# Useful pointers
Expand Down

0 comments on commit 46fa286

Please sign in to comment.