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

Function rdDataDMA

interface/vstream/python/vsi_audio.py:300–325  ·  view source on GitHub ↗

Read data from the server (simulate DMA peripheral-to-memory transfer). This method is called when VSI Timer overflow occurs. Args: size: Number of bytes to read (multiple of 4). Returns: data: Bytearray of audio data.

(size)

Source from the content-addressed store, hash-verified

298
299
300def rdDataDMA(size):
301 """
302 Read data from the server (simulate DMA peripheral-to-memory transfer).
303
304 This method is called when VSI Timer overflow occurs.
305 Args:
306 size: Number of bytes to read (multiple of 4).
307 Returns:
308 data: Bytearray of audio data.
309 """
310 global STATUS
311
312 if (STATUS & STATUS_ACTIVE_Msk) != 0:
313
314 data, eos = Audio.readAudio(size)
315 if eos:
316 STATUS |= STATUS_EOS_Msk
317 logger.debug("rdDataDMA: STATUS register updated: EOS bit set")
318 else:
319 data = bytearray()
320
321 # Set DATA bit after the block of data is read
322 STATUS |= STATUS_DATA_Msk
323 logger.debug("rdDataDMA: STATUS register updated: DATA bit set")
324
325 return data
326
327
328def wrDataDMA(data, size):

Callers

nothing calls this directly

Calls 1

readAudioMethod · 0.45

Tested by

no test coverage detected