MCPcopy Create free account
hub / github.com/ARM-software/AVH / wrCONTROL

Function wrCONTROL

interface/sensor/python/vsi_sensor.py:356–374  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

354## Write CONTROL register (user register)
355# @param value value to write (32-bit)
356def wrCONTROL(value):
357 global CONTROL, STATUS, FIFO, sensor_idx
358
359 if ((value ^ CONTROL) & CONTROL_ENABLE_Msk) != 0:
360 STATUS = 0
361 Record.flush()
362 if (value & CONTROL_ENABLE_Msk) != 0:
363 logger.info("Enable Sensor")
364 if SENSOR_NAME_VALID:
365 openFile(f"{sensor_filename}.{sensor_idx}.sds")
366 if (value & CONTROL_DMA_Msk) == 0:
367 FIFO = FifoBuff(((FIFO_SIZE // SAMPLE_SIZE) * SAMPLE_SIZE), (DATA_THRESHOLD * SAMPLE_SIZE))
368 sensor_idx += 1
369 else:
370 logger.info("Disable sensor")
371 if SENSOR_NAME_VALID:
372 closeFile()
373
374 CONTROL = value
375
376
377## Read STATUS register (user register)

Callers 1

wrRegsFunction · 0.70

Calls 4

openFileFunction · 0.85
FifoBuffClass · 0.85
closeFileFunction · 0.85
flushMethod · 0.80

Tested by

no test coverage detected