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

Method ad_readout

libsigrokdecode4DSL/decoders/xfp/pd.py:246–268  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

244 self.annotate("Interrupt bits", ' '.join(out))
245
246 def ad_readout(self, data):
247 cnt_idx = self.cnt - len(data) + 1
248 idx = 0
249 while idx < 14:
250 if idx == 2:
251 # Skip over reserved field
252 idx += 2
253 value = (data[idx] << 8) | data[idx + 1]
254 name = AD_READOUTS.get(idx, "...")
255 if value != 0:
256 if idx == 0:
257 self.annotate(name, self.to_temp(value),
258 cnt_idx + idx, cnt_idx + idx + 1)
259 elif idx == 4:
260 self.annotate(name, self.to_current(value),
261 cnt_idx + idx, cnt_idx + idx + 1)
262 elif idx in (6, 8):
263 self.annotate(name, self.to_power(value),
264 cnt_idx + idx, cnt_idx + idx + 1)
265 else:
266 self.annotate(name, str(value), cnt_idx + idx,
267 cnt_idx + idx + 1)
268 idx += 2
269
270 def gcs(self, data):
271 allbits = (data[0] << 8) | data[1]

Callers

nothing calls this directly

Calls 5

annotateMethod · 0.95
to_tempMethod · 0.95
to_currentMethod · 0.95
to_powerMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected