aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2018-10-15 12:16:16 -0700
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-07 18:26:13 -0800
commit5c991d82f718c2f51c2f4b2cb183aeb3c910de3e (patch)
treef9223bab1644b3756539296c63891b03d03e1b95 /mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py
parent738b9ec102cdb307413cab23fdcf7fb2522f9895 (diff)
downloaduhd-5c991d82f718c2f51c2f4b2cb183aeb3c910de3e.tar.gz
uhd-5c991d82f718c2f51c2f4b2cb183aeb3c910de3e.tar.bz2
uhd-5c991d82f718c2f51c2f4b2cb183aeb3c910de3e.zip
mpm: Add basic driver for QSFP board's retimer
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py b/mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py
index 5622285f6..cb6c237c2 100644
--- a/mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py
+++ b/mpm/python/usrp_mpm/periph_manager/n3xx_periphs.py
@@ -8,8 +8,11 @@ N3xx peripherals
"""
import datetime
+from usrp_mpm import lib
from usrp_mpm.sys_utils.sysfs_gpio import SysFSGPIO, GPIOBank
from usrp_mpm.sys_utils.uio import UIO
+from usrp_mpm.sys_utils import i2c_dev
+from usrp_mpm.chips.ds125df410 import DS125DF410
# Map register values to SFP transport types
N3XX_SFP_TYPES = {
@@ -417,3 +420,17 @@ class MboardRegsControl(object):
"Get the RFNoC crossbar base port"
with self.regs:
return self.peek32(self.MB_XBAR_BASEPORT)
+
+class RetimerQSFP(DS125DF410):
+ # (deemphasis, swing)
+ DRIVER_PRESETS = { '1m': (0x00, 0x07), '3m': (0x41, 0x06), 'Optical': (0x41, 0x04) }
+
+ def __init__(self, i2c_bus):
+ regs_iface = lib.i2c.make_i2cdev_regs_iface(
+ i2c_bus,
+ 0x18,
+ False,
+ 100,
+ 1
+ )
+ super(RetimerQSFP, self).__init__(regs_iface)