1.1.5.3.6 DRV_I2S_WriteQueuePurge Function

bool DRV_I2S_WriteQueuePurge( const DRV_HANDLE handle )

Summary

Removes all buffer requests from the write queue.

Description

This function removes all the buffer requests from the write 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

ParametersDescription
handleHandle of the communication channel as returned by the DRV_I2S_Open function.

Returns

True - Write queue purge is successful.

False - Write 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_WriteBufferAdd to queue write requests_

_// Application timeout function, where remove queued buffers._

void APP_TimeOut(void) {

if(false == DRV_I2S_WriteQueuePurge(myI2Shandle)) { _//Couldn't purge the write queue, try again._ } else { _//Queue purge successful._}

}

C

bool DRV_I2S_WriteQueuePurge(const DRV_HANDLE handle);