diff --git a/python/surf/devices/silabs/_Si5345Lite.py b/python/surf/devices/silabs/_Si5345Lite.py index 34c5ebcef2..62067a31d7 100644 --- a/python/surf/devices/silabs/_Si5345Lite.py +++ b/python/surf/devices/silabs/_Si5345Lite.py @@ -13,6 +13,7 @@ import csv import click import fnmatch +import time class Si5345Lite(pr.Device): def __init__(self, @@ -50,8 +51,15 @@ def LoadCsvFile(arg): return # Power down during the configuration load - self.Page0.PDN.set(0x1) - + #self.Page0.PDN.set(0x1) + + #preamble + self._setValue(0x0B24<<2,0xC0) + self._setValue(0x0B25<<2,0x0) + self._setValue(0x0540<<2,0x1) + time.sleep(0.3) + self._setValue(0x001C<<2,0x1) + # Open the .CSV file with open(path) as csvfile: reader = csv.reader(csvfile, delimiter=',', quoting=csv.QUOTE_NONE) @@ -62,18 +70,24 @@ def LoadCsvFile(arg): offset = (int(row[0],16)<<2), data = int(row[1],16), ) - # Update local RemoteVariables and verify conflagration self.readBlocks(recurse=True) self.checkBlocks(recurse=True) # Execute the Page5.BW_UPDATE_PLL command - self.Page5.BW_UPDATE_PLL.set(0x1) - self.Page5.BW_UPDATE_PLL.set(0x0) + #self.Page5.BW_UPDATE_PLL.set(0x1) + #self.Page5.BW_UPDATE_PLL.set(0x0) + # Power Up after the configuration load - self.Page0.PDN.set(0x0) - + #self.Page0.PDN.set(0x0) + + self._setValue(0x0514<<2,0x1) + self._setValue(0x001C<<2,0x1) + self._setValue(0x0540<<2,0x0) + self._setValue(0x0B24<<2,0xC3) + self._setValue(0x0B25<<2,0x2) + # Clear the internal error flags self.Page0.ClearIntErrFlag.set(0x1) self.Page0.ClearIntErrFlag.set(0x0) @@ -83,17 +97,17 @@ def LoadCsvFile(arg): ############################## self._pages = { 0: silabs.Si5345Page0(offset=(0x000<<2),simpleDisplay=simpleDisplay,expand=False), # 0x0000 - 0x03FF - 1: silabs.Si5345PageBase(name='Page1',offset=(0x100<<2),expand=False,hidden=not (advanceUser)), # 0x0400 - 0x07FF - 2: silabs.Si5345PageBase(name='Page2',offset=(0x200<<2),expand=False,hidden=not (advanceUser)), # 0x0800 - 0x0BFF - 3: silabs.Si5345PageBase(name='Page3',offset=(0x300<<2),expand=False,hidden=not (advanceUser)), # 0x0C00 - 0x0FFF - 4: silabs.Si5345PageBase(name='Page4',offset=(0x400<<2),expand=False,hidden=not (advanceUser)), # 0x1000 - 0x13FF + 1: silabs.Si5345PageBase(name='Page1',offset=(0x100<<2),expand=False,hidden=False), # 0x0400 - 0x07FF + 2: silabs.Si5345Page2(offset=(0x200<<2),simpleDisplay=simpleDisplay,expand=False), # 0x0800 - 0x0BFF + 3: silabs.Si5345PageBase(name='Page3',offset=(0x300<<2),expand=False,hidden=False), # 0x0C00 - 0x0FFF + 4: silabs.Si5345PageBase(name='Page4',offset=(0x400<<2),expand=False,hidden=False), # 0x1000 - 0x13FF 5: silabs.Si5345Page5(offset=(0x500<<2),simpleDisplay=simpleDisplay,expand=False), # 0x1400 - 0x17FF - 6: silabs.Si5345PageBase(name='Page6',offset=(0x600<<2),expand=False,hidden=not (advanceUser)), # 0x1800 - 0x1BFF - 7: silabs.Si5345PageBase(name='Page7',offset=(0x700<<2),expand=False,hidden=not (advanceUser)), # 0x1C00 - 0x1FFF - 8: silabs.Si5345PageBase(name='Page8',offset=(0x800<<2),expand=False,hidden=not (advanceUser)), # 0x2000 - 0x23FF - 9: silabs.Si5345PageBase(name='Page9',offset=(0x900<<2),expand=False,hidden=not (advanceUser)), # 0x2400 - 0x27FF - 10: silabs.Si5345PageBase(name='PageA',offset=(0xA00<<2),expand=False,hidden=not (advanceUser)), # 0x2800 - 0x2BFF - 11: silabs.Si5345PageBase(name='PageB',offset=(0xB00<<2),expand=False,hidden=not (advanceUser)), # 0x2C00 - 0x2FFF + 6: silabs.Si5345PageBase(name='Page6',offset=(0x600<<2),expand=False,hidden=False), # 0x1800 - 0x1BFF + 7: silabs.Si5345PageBase(name='Page7',offset=(0x700<<2),expand=False,hidden=False), # 0x1C00 - 0x1FFF + 8: silabs.Si5345PageBase(name='Page8',offset=(0x800<<2),expand=False,hidden=False), # 0x2000 - 0x23FF + 9: silabs.Si5345PageBase(name='Page9',offset=(0x900<<2),expand=False,hidden=False), # 0x2400 - 0x27FF + 10: silabs.Si5345PageBase(name='PageA',offset=(0xA00<<2),expand=False,hidden=False), # 0x2800 - 0x2BFF + 11: silabs.Si5345PageBase(name='PageB',offset=(0xB00<<2),expand=False,hidden=False), # 0x2C00 - 0x2FFF } # Add Pages diff --git a/python/surf/devices/silabs/_Si5345Pages.py b/python/surf/devices/silabs/_Si5345Pages.py index 75f948f3e5..72b4371832 100644 --- a/python/surf/devices/silabs/_Si5345Pages.py +++ b/python/surf/devices/silabs/_Si5345Pages.py @@ -34,7 +34,7 @@ def __init__(self, bulkOpEn = False, # FALSE for large variables overlapEn = False, verify = False, # FALSE due to a mix of RO/WO/RW variables - hidden = True, + hidden = False, base = pr.UInt, mode = "RW", groups = ['NoStream','NoState','NoConfig'], # Not saving config/state to YAML @@ -432,7 +432,7 @@ def __init__(self, bitSize = 1, bitOffset = 0, mode = 'WO', - hidden = simpleDisplay, + #hidden = simpleDisplay, ) self.MyLinkVariable( @@ -442,7 +442,7 @@ def __init__(self, bitSize = 1, bitOffset = 2, mode = 'WO', - hidden = simpleDisplay, + #hidden = simpleDisplay, ) self.MyLinkVariable( @@ -1063,6 +1063,95 @@ def __init__(self, ) +class Si5345Page2(Si5345PageBase): + def __init__(self, + name = "Page2", + description = "", + simpleDisplay = True, + liteVersion = True, + **kwargs): + super().__init__(name=name, description=description, **kwargs) + + self.MyLinkVariable( + name = "DESIGN_ID[0]", + description = "", + offset = (0x6B << 2), + bitSize = 64, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[1]", + description = "", + offset = (0x6C << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[2]", + description = "", + offset = (0x6D << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[3]", + description = "", + offset = (0x6E << 2), + bitSize = 64, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[4]", + description = "", + offset = (0x6F << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[5]", + description = "", + offset = (0x70 << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + self.MyLinkVariable( + name = "DESIGN_ID[6]", + description = "", + offset = (0x71 << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + self.MyLinkVariable( + name = "DESIGN_ID[7]", + description = "", + offset = (0x72 << 2), + bitSize = 8, + bitOffset = 0, + mode = 'RW', + hidden = False, + ) + + class Si5345Page5(Si5345PageBase): def __init__(self, name = "Page5",