17 #define ALLOCATED_BUFFER_BIT ((uint8)(1<<0))
18 #define FIFO_FULL_BIT ((uint8)(1<<7))
19 #define FIFO_FULL_CLR_MASK ((uint8)~FIFO_FULL_BIT)
38 if ( bufferCapacity != 0 )
40 pData = OSA_MemAllocZero(bufferCapacity * sampleSize);
73 return isf_fifo_init ( pFifo, NULL, sampleSize, bufferCapacity );
82 st = OSA_SemaWait(&pFifo->
bufferLock, OSA_WAIT_FOREVER);
105 st = OSA_SemaWait(&pFifo->
bufferLock, OSA_WAIT_FOREVER);
115 if ( currentSize == newSizeInBytes)
return ISF_SUCCESS;
120 pFifo->
pDataBuffer = OSA_MemAllocZero(newSizeInBytes);
157 st = OSA_SemaWait(&pFifo->
bufferLock, OSA_WAIT_FOREVER);
174 st = OSA_SemaWait(&pFifo->
bufferLock, OSA_WAIT_FOREVER);
187 if (st == kStatus_OSA_Success) {
#define ALLOCATED_BUFFER_BIT
isf_fifo_status_t isf_fifo_resize(isf_fifo_t *pFifo, uint16 newCapacity)
Routine to change the supported fifo depth.
#define ISF_FIFO_ERR_NO_MEM
#define ISF_FIFO_ERR_USER_BUF
uint16 isf_fifo_get_buffer_size(isf_fifo_t *pFifo)
Routine to query the current fifo buffer size (bytes)
isf_fifo_status_t isf_fifo_data_copy(isf_fifo_t *pFifo, void *samplePtr)
Routine to copy the whole sample buffer.
isf_fifo_status_t isf_fifo_init(isf_fifo_t *pFifo, void *pData, uint16 sampleSize, uint16 bufferCapacity)
Initializes a new fifo structure with a provided buffer.
isf_fifo_status_t isf_fifo_lock(isf_fifo_t *pFifo)
Lock a sample buffer for exclusive access.
#define FIFO_FULL_CLR_MASK
isf_fifo_status_t isf_fifo_free(isf_fifo_t *pFifo)
free a fifo's sample buffer.
isf_fifo_status_t isf_fifo_try_lock(isf_fifo_t *pFifo)
Attempt to lock a sample buffer for exclusive access.
isf_fifo_status_t isf_fifo_el_clear(isf_fifo_t *pFifo)
Routine to clear the fifo.
void * isf_fifo_el_get_insert_pointer(isf_fifo_t *pFifo)
Routine returns the insert pointer for direct access.
The isf_util.h file contains the utility method declarations and macros.
void isf_mem_copy(void *src, void *dest, uint32 size)
memory copy
#define ISF_FIFO_ERR_NO_INIT
#define ISF_FIFO_ERR_BUSY
Main ISF header file. Contains code common to all ISF components.
unsigned short int uint16
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
isf_fifo_status_t isf_fifo_el_traverse(isf_fifo_t *pFifo, void **pSamplePtr)
Routine to traverse a fifo To initiate the traversal set pSamplePtr to NULL. The function will set th...
#define ISF_FIFO_ERR_INVALID_PTR
isf_fifo_status_t isf_fifo_alloc(isf_fifo_t *pFifo, uint16 sampleSize, uint16 bufferCapacity)
Convenience function to initialize a fifo structure and allocate a new fifo buffer.
#define ISF_FIFO_NO_MORE_ENTRIES
isf_fifo_status_t isf_fifo_el_increment(isf_fifo_t *pFifo)
Routine increments the insert pointer after direct access.