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

Function wrCONTROL

interface/video/python/vsi_video.py:287–321  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

285## Write CONTROL register (user register)
286# @param value value to write (32-bit)
287def wrCONTROL(value):
288 global CONTROL, STATUS
289
290 if ((value ^ CONTROL) & CONTROL_ENABLE_Msk) != 0:
291 STATUS &= ~STATUS_ACTIVE_Msk
292 if (value & CONTROL_ENABLE_Msk) != 0:
293 logger.info("Start video stream")
294 if Video.conn != None:
295 logger.info("Configure video stream")
296 configuration_valid = Video.configureStream(FRAME_WIDTH, FRAME_HEIGHT, COLOR_FORMAT, FRAME_RATE)
297 if configuration_valid:
298 logger.info("Enable video stream")
299 server_active = Video.enableStream(MODE)
300 if server_active:
301 STATUS |= STATUS_ACTIVE_Msk
302 STATUS &= ~(STATUS_OVERFLOW_Msk | STATUS_UNDERFLOW_Msk | STATUS_EOS_Msk)
303 else:
304 logger.error("Enable video stream failed")
305 else:
306 logger.error("Configure video stream failed")
307 else:
308 logger.error("Server not connected")
309 else:
310 logger.info("Stop video stream")
311 if Video.conn != None:
312 logger.info("Disable video stream")
313 Video.disableStream()
314 else:
315 logger.error("Server not connected")
316
317 if (value & CONTROL_BUF_FLUSH_Msk) != 0:
318 value &= ~CONTROL_BUF_FLUSH_Msk
319 flushBuffer()
320
321 CONTROL = value
322
323
324## Read STATUS register (user register)

Callers 2

timerEventFunction · 0.70
wrRegsFunction · 0.70

Calls 4

flushBufferFunction · 0.85
configureStreamMethod · 0.45
enableStreamMethod · 0.45
disableStreamMethod · 0.45

Tested by

no test coverage detected