Skip to content

Commit

Permalink
coredevice/i2c,ttl,spi: consistent device get
Browse files Browse the repository at this point in the history
sbourdeauducq committed Mar 9, 2016
1 parent 2e4e251 commit 9d1903a
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions artiq/coredevice/i2c.py
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ class PCA9548:
On the KC705, this chip is used for selecting the I2C buses on the two FMC
connectors. HPC=1, LPC=2.
"""
def __init__(self, dmgr, busno=0, address=0xe8):
self.core = dmgr.get("core")
def __init__(self, dmgr, busno=0, address=0xe8, core_device="core"):
self.core = dmgr.get(core_device)
self.busno = busno
self.address = address

@@ -77,8 +77,8 @@ class TCA6424A:
On the NIST QC2 hardware, this chip is used for switching the directions
of TTL buffers."""
def __init__(self, dmgr, busno=0, address=0x44):
self.core = dmgr.get("core")
def __init__(self, dmgr, busno=0, address=0x44, core_device="core"):
self.core = dmgr.get(core_device)
self.busno = busno
self.address = address

4 changes: 2 additions & 2 deletions artiq/coredevice/spi.py
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ class SPIMaster:
:param channel: RTIO channel number of the SPI bus to control.
"""
def __init__(self, dmgr, channel):
self.core = dmgr.get("core")
def __init__(self, dmgr, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.ref_period_mu = seconds_to_mu(self.core.coarse_ref_period,
self.core)
self.channel = channel
12 changes: 6 additions & 6 deletions artiq/coredevice/ttl.py
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ class TTLOut:
:param channel: channel number
"""
def __init__(self, dmgr, channel):
self.core = dmgr.get("core")
def __init__(self, dmgr, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.channel = channel

# in RTIO cycles
@@ -82,8 +82,8 @@ class TTLInOut:
:param channel: channel number
"""
def __init__(self, dmgr, channel):
self.core = dmgr.get("core")
def __init__(self, dmgr, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.channel = channel

# in RTIO cycles
@@ -232,8 +232,8 @@ class TTLClockGen:
:param channel: channel number
"""
def __init__(self, dmgr, channel):
self.core = dmgr.get("core")
def __init__(self, dmgr, channel, core_device="core"):
self.core = dmgr.get(core_device)
self.channel = channel

# in RTIO cycles

0 comments on commit 9d1903a

Please sign in to comment.