aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm
diff options
context:
space:
mode:
authorTrung N Tran <trung.tran@ettus.com>2017-10-08 14:45:54 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:02 -0800
commit894d1a1a0ae3442ad75b3c20056bd9ea0626309e (patch)
tree8516cfbc2bd0ddba7c76ea71868ef5eb3681f5b1 /mpm/python/usrp_mpm
parentc8094c0e51bfc104f173a78206dc92a595880034 (diff)
downloaduhd-894d1a1a0ae3442ad75b3c20056bd9ea0626309e.tar.gz
uhd-894d1a1a0ae3442ad75b3c20056bd9ea0626309e.tar.bz2
uhd-894d1a1a0ae3442ad75b3c20056bd9ea0626309e.zip
mpm: n3xx: Add GPS locked sensor
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index f2aa43a84..703ce0cf8 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -216,6 +216,7 @@ class n310(PeriphManagerBase):
mboard_max_rev = 3 # 3 == RevD
mboard_sensor_callback_map = {
'ref_locked': 'get_ref_lock_sensor',
+ 'gps_locked': 'get_gps_lock_sensor',
}
dboard_eeprom_addr = "e0004000.i2c"
dboard_eeprom_max_len = 64
@@ -511,6 +512,18 @@ class n310(PeriphManagerBase):
'value': str(lock_status).lower(),
}
+ def get_gps_lock_sensor(self):
+ """
+ Get lock status of GPS as a sensor dict
+ """
+ self.log.trace("Reading status GPS lock pin from port expander")
+ gps_locked = bool(self._gpios.get("GPS-LOCKOK"))
+ return {
+ 'name': 'gps_lock',
+ 'type': 'BOOLEAN',
+ 'unit': 'locked' if gps_locked else 'unlocked',
+ 'value': str(gps_locked).lower(),
+ }
###########################################################################
# EEPROMs
###########################################################################