Skip to content

Commit

Permalink
Merge pull request #1122 from slaclab/xadc-dev
Browse files Browse the repository at this point in the history
Enhancements to XADC Rogue Device
  • Loading branch information
ruck314 authored Nov 30, 2023
2 parents b55ecb7 + bef9014 commit 46afd93
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions python/surf/xilinx/_Xadc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ def __init__(self,
description = "AXI-Lite XADC for Xilinx 7 Series (Refer to PG091 & PG019)",
auxChannels = 0,
zynq = False,
simpleViewList = ["Temperature", "VccInt", "VccAux", "VccBram"],
pollInterval = 5,
**kwargs):
super().__init__(description=description, **kwargs)

if isinstance(auxChannels, int):
auxChannels = list(range(auxChannels))

self.simpleViewList = simpleViewList
self.simpleViewList.append('enable')

def addPair(name, offset, bitSize, units, bitOffset, description, function, pollInterval=0):
self.add(pr.RemoteVariable(
name = ("Raw"+name),
Expand Down Expand Up @@ -56,7 +61,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "degC",
function = self.convTemp,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip temperature sensor measurement is
stored in this location. The data is MSB justified in the
Expand Down Expand Up @@ -116,7 +121,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccInt supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -164,7 +169,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccAux supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -214,7 +219,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccBram supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -331,6 +336,8 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
variable=self.AuxRaw[ch],
linkedGet=self.convAuxVoltage))

self.simpleViewList.append(f'Aux[{ch}]')

if (zynq):
addPair(
name = 'VccpInt',
Expand Down Expand Up @@ -610,5 +617,5 @@ def simpleView(self):
# Hide all the variable
self.hideVariables(hidden=True)
# Then unhide the most interesting ones
vars = ["enable", "Temperature", "VccInt", "VccAux", "VccBram"]
vars = self.simpleViewList
self.hideVariables(hidden=False, variables=vars)

0 comments on commit 46afd93

Please sign in to comment.