1.1.2.5.4 DRV_AK4954_ReadQueuePurge Function

bool DRV_AK4954_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

ParametersDescription
handleHandle of the communication channel as returned by the DRV_AK4954_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

_\/\/ myCodecHandle is the handle returned by the DRV_AK4954_Open function._

_\/\/ Use DRV_AK4954_BufferAddRead to queue read requests_

_\/\/ Application timeout function, where remove queued buffers._ void APP_TimeOut(void) { if(false == DRV_AK4954_ReadQueuePurge(myCodecHandle)) { _\/\/Couldn't purge the read queue, try again._ } else { _\/\/Queue purge successful._}

}

C

bool DRV_AK4954_ReadQueuePurge(const DRV_HANDLE handle);