Skip to content

Commit 9d1903a

Browse files
committedMar 9, 2016
coredevice/i2c,ttl,spi: consistent device get
1 parent 2e4e251 commit 9d1903a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
 

Diff for: ‎artiq/coredevice/i2c.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class PCA9548:
3434
On the KC705, this chip is used for selecting the I2C buses on the two FMC
3535
connectors. HPC=1, LPC=2.
3636
"""
37-
def __init__(self, dmgr, busno=0, address=0xe8):
38-
self.core = dmgr.get("core")
37+
def __init__(self, dmgr, busno=0, address=0xe8, core_device="core"):
38+
self.core = dmgr.get(core_device)
3939
self.busno = busno
4040
self.address = address
4141

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

Diff for: ‎artiq/coredevice/spi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class SPIMaster:
4040
4141
:param channel: RTIO channel number of the SPI bus to control.
4242
"""
43-
def __init__(self, dmgr, channel):
44-
self.core = dmgr.get("core")
43+
def __init__(self, dmgr, channel, core_device="core"):
44+
self.core = dmgr.get(core_device)
4545
self.ref_period_mu = seconds_to_mu(self.core.coarse_ref_period,
4646
self.core)
4747
self.channel = channel

Diff for: ‎artiq/coredevice/ttl.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class TTLOut:
1010
1111
:param channel: channel number
1212
"""
13-
def __init__(self, dmgr, channel):
14-
self.core = dmgr.get("core")
13+
def __init__(self, dmgr, channel, core_device="core"):
14+
self.core = dmgr.get(core_device)
1515
self.channel = channel
1616

1717
# in RTIO cycles
@@ -82,8 +82,8 @@ class TTLInOut:
8282
8383
:param channel: channel number
8484
"""
85-
def __init__(self, dmgr, channel):
86-
self.core = dmgr.get("core")
85+
def __init__(self, dmgr, channel, core_device="core"):
86+
self.core = dmgr.get(core_device)
8787
self.channel = channel
8888

8989
# in RTIO cycles
@@ -232,8 +232,8 @@ class TTLClockGen:
232232
233233
:param channel: channel number
234234
"""
235-
def __init__(self, dmgr, channel):
236-
self.core = dmgr.get("core")
235+
def __init__(self, dmgr, channel, core_device="core"):
236+
self.core = dmgr.get(core_device)
237237
self.channel = channel
238238

239239
# in RTIO cycles

0 commit comments

Comments
 (0)
Please sign in to comment.