Skip to content

Commit

Permalink
adding dynamicAddr arg (default=False) to _PMBus.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ruck314 committed May 7, 2024
1 parent a20e528 commit 240ed88
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/surf/protocols/i2c/_PMBus.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@
import pyrogue as pr

class PMBus(pr.Device):
def __init__(self, simpleDisplay = True, **kwargs):
def __init__(self, simpleDisplay = True, dynamicAddr=False, **kwargs):
super().__init__(**kwargs)

self.add(pr.RemoteVariable(
name = 'i2cAddr',
offset = 0x400,
bitSize = 10,
bitOffset = 0,
mode = 'RW',
mode = 'RW' if dynamicAddr else 'RO',
hidden = simpleDisplay,
))

self.add(pr.RemoteVariable(
name = 'tenbit',
offset = 0x400,
bitSize = 1,
bitOffset = 10,
mode = 'RW',
mode = 'RW' if dynamicAddr else 'RO',
hidden = simpleDisplay,
))

self.add(pr.RemoteVariable(
Expand All @@ -44,6 +46,7 @@ def __init__(self, simpleDisplay = True, **kwargs):
offset = (4*0x00),
bitSize = 8,
mode = 'RW',
hidden = simpleDisplay,
))

self.add(pr.RemoteVariable(
Expand Down

0 comments on commit 240ed88

Please sign in to comment.