Commit f4465178 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Updated get status reg script to account for changes in older g/w versions

The changes were done to account for changes in the bits of the status registers
between older versions, where switches and RTM lines were active-low, to the
changes in newer (conv-common-gw) versions, which have the switches and RTM
lines active-high
parent 6ed3a883
......@@ -75,6 +75,12 @@ if __name__ == "__main__":
# Strip SWITCHES and print
switches = (v & 0xff00) >> 8
print("Switches : 0x%02x" % switches)
# Negate in case g/w version is less than 3.0, or golden less than 0.2.
# Gateware versions below these two had the switches active-low.
# This negation is done to allow correct printing of ON or OFF states.
if ((maj == 0) and (min < 2)) or (maj < 3):
switches ^= 0xff
if (switches & 0x80):
print(" TTL repetition : on")
else:
......@@ -88,9 +94,14 @@ if __name__ == "__main__":
rtm = (v & 0x3f0000) >> 16
rtmm = rtm & 0x7
rtmp = (rtm & 0x3f) >> 3
if ((maj == 0) and (min < 2)) or (maj < 3):
print("-------------------------------")
print("Note: negated w.r.t. latest user guide version")
print("RTM detection : 0x%02x" % rtm)
print(" RTMM[2:0] : %s" % ("{0:#05b}".format(rtmm)[2:]))
print(" RTMP[2:0] : %s" % ("{0:#05b}".format(rtmp)[2:]))
if ((maj == 0) and (min < 2)) or (maj < 3):
print("-------------------------------")
# Strip the other status bits and print
print("I2C timeout error : %s" % ("{0:#01b}".format(int(bool(v & (1 << 22))))[2]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment