1.1.5.3.5 DRV_I2S_ReadQueuePurge Function
bool DRV_I2S_ReadQueuePurge( const DRV_HANDLE handle )
Summary
Removes all buffer requests from the read queue.
Description
This function removes all the buffer requests from the read queue. The client can use this function to purge the queue on timeout or to remove unwanted stalled buffer requests or in any other use case.
Preconditions
DRV_I2S_Open must have been called to obtain a valid opened device handle.
Parameters
Parameters | Description |
---|---|
handle | Handle of the communication channel as returned by the DRV_I2S_Open function. |
Returns
True - Read queue purge is successful.
False - Read queue purge has failed.
Remarks
This function is thread safe when used in an RTOS environment. Avoid this function call from within the callback.
Example
_// myI2SHandle is the handle returned by the DRV_I2S_Open function._ _// Use DRV_I2S_ReadBufferAdd to queue read requests_ _// Application timeout function, where remove queued buffers._ void APP_TimeOut(void) { if(false == DRV_I2S_ReadQueuePurge(myI2Shandle)) { _//Couldn't purge the read queue, try again._ } else { _//Queue purge successful._} }
C
bool DRV_I2S_ReadQueuePurge(const DRV_HANDLE handle);