MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / to_temp

Method to_temp

libsigrokdecode4DSL/decoders/xfp/pd.py:162–166  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

160 # Convert 16-bit two's complement values, with each increment
161 # representing 1/256C, to degrees Celsius.
162 def to_temp(self, value):
163 if value & 0x8000:
164 value = -((value ^ 0xffff) + 1)
165 temp = value / 256.0
166 return "%.1f C" % temp
167
168 # TX bias current in uA. Each increment represents 0.2uA
169 def to_current(self, value):

Callers 2

alarm_warningsMethod · 0.95
ad_readoutMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected