| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Functions
isf_fifo.h File Reference
`#include "isf.h"`
Include dependency graph for isf_fifo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | isf_fifo_t

## Macros
#define | ISF_FIFO_ERR_NO_MEM (1)
#define | ISF_FIFO_ERR_USER_BUF (2)
#define | ISF_FIFO_ERR_BUSY (3)
#define | ISF_FIFO_ERR_INVALID_PTR (4)
#define | ISF_FIFO_ERR_NO_INIT (5)
#define | ISF_FIFO_FULL (6)
#define | ISF_FIFO_NO_MORE_ENTRIES (7)

## Typedefs
typedef uint32 | isf_fifo_status_t

## Functions
isf_fifo_status_t | isf_fifo_alloc (isf_fifo_t *pFifo, uint16 sampleSize, uint16 bufferCapacity)
| Initializes a fifo structure and allocates a new fifo buffer. More...
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. More...
isf_fifo_status_t | isf_fifo_free (isf_fifo_t *pFifo)
| free a fifo's sample buffer. More...
isf_fifo_status_t | isf_fifo_resize (isf_fifo_t *pFifo, uint16 newCapacity)
| Routine to copy the whole sample buffer. More...
uint16 | isf_fifo_get_buffer_size (isf_fifo_t *pFifo)
| Routine to query the current fifo size (bytes) More...
isf_fifo_status_t | isf_fifo_data_copy (isf_fifo_t *pFifo, void *samplePtr)
| Routine to copy the whole sample buffer. More...
isf_fifo_status_t | isf_fifo_lock (isf_fifo_t *pFifo)
| Lock a sample buffer for exclusive access. More...
isf_fifo_status_t | isf_fifo_try_lock (isf_fifo_t *pFifo)
| Attempt to lock a sample buffer for exclusive access. More...
isf_fifo_status_t | isf_fifo_unlock (isf_fifo_t *pFifo)
| Release the exclusive access lock on a sample buffer. More...
void * | isf_fifo_el_get_insert_pointer (isf_fifo_t *pFifo)
| Routine returns the insert pointer for direct access. More...
isf_fifo_status_t | isf_fifo_el_increment (isf_fifo_t *pFifo)
| Routine increments the insert pointer after direct access. More...
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 the pointer to the first available sample and returns ISF_SUCCESS. Subsequent calls will increment the pointer to each available sample and return ISF_SUCCESS. When ISF_SUCCESS is returned, pSamplePtr may be dereferenced to obtain a fifo entry. When no more samples are available, the function returns ISF_FIFO_NO_MORE_ENTRIES. More...
isf_fifo_status_t | isf_fifo_el_clear (isf_fifo_t *pFifo)
| Routine to clear the fifo. More...

## Macro Definition Documentation

#define ISF_FIFO_ERR_BUSY (3)

Definition at line 30 of file isf_fifo.h.

Referenced by isf_fifo_try_lock().

#define ISF_FIFO_ERR_INVALID_PTR (4)

Definition at line 31 of file isf_fifo.h.

Referenced by isf_fifo_init().

#define ISF_FIFO_ERR_NO_INIT (5)

Definition at line 32 of file isf_fifo.h.

Referenced by isf_fifo_data_copy(), isf_fifo_free(), isf_fifo_init(), isf_fifo_lock(), isf_fifo_resize(), and isf_fifo_unlock().

#define ISF_FIFO_ERR_NO_MEM (1)

Definition at line 28 of file isf_fifo.h.

Referenced by isf_fifo_init().

#define ISF_FIFO_ERR_USER_BUF (2)

Definition at line 29 of file isf_fifo.h.

Referenced by isf_fifo_resize().

#define ISF_FIFO_FULL (6)

Definition at line 33 of file isf_fifo.h.

Referenced by Analog_1_fsl_Sensor_Generic_AnalogCallback(), Custom_1_fsl_Sensor_Custom_PeriodicCallback(), fsl_fusion_virt_3D_orient_PeriodicCallback(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxlc95000_PeriodicCallback(), fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(), fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fsl_mma8491q_read_data_OneShotCallback(), fsl_mma865x_i2c_3D_accel_PeriodicCallback(), fsl_mma955x_PeriodicCallback(), fsl_mpl3115_i2c_1D_press_PeriodicCallback(), and isf_fifo_el_increment().

#define ISF_FIFO_NO_MORE_ENTRIES (7)

Definition at line 34 of file isf_fifo.h.

Referenced by fsl_fusion_virt_3D_orient_PeriodicCallback(), and isf_fifo_el_traverse().

## Typedef Documentation

typedef uint32 isf_fifo_status_t

Definition at line 16 of file isf_fifo.h.

## Function Documentation

isf_fifo_status_t isf_fifo_alloc | ( | isf_fifo_t * | pFifo,
|  | uint16 | sampleSize,
|  | uint16 | bufferCapacity
| ) |  |

Initializes a fifo structure and allocates a new fifo buffer.

Initializes a fifo structure and allocates a new fifo buffer.

Definition at line 71 of file isf_fifo.c.

References isf_fifo_init().

Here is the call graph for this function:

isf_fifo_status_t isf_fifo_data_copy | ( | isf_fifo_t * | pFifo,
|  | void * | samplePtr
| ) |  |

Routine to copy the whole sample buffer.

Definition at line 154 of file isf_fifo.c.

References isf_fifo_t::bufferLock, ISF_FIFO_ERR_NO_INIT, isf_mem_copy(), ISF_SUCCESS, isf_fifo_t::pDataBuffer, and isf_fifo_t::pLastEntry.

Here is the call graph for this function:

isf_fifo_status_t isf_fifo_el_clear | ( | isf_fifo_t * | pFifo | ) |

Routine to clear the fifo.

Definition at line 217 of file isf_fifo.c.

References FIFO_FULL_CLR_MASK, isf_fifo_t::fifoState, ISF_SUCCESS, isf_fifo_t::pDataBuffer, and isf_fifo_t::pInsertPtr.

Referenced by App1_MainTask(), BasicApp1_MainTask(), and fsl_fusion_virt_3D_orient_PeriodicCallback().

Here is the caller graph for this function:

void* isf_fifo_el_get_insert_pointer | ( | isf_fifo_t * | pFifo | ) |

Routine returns the insert pointer for direct access.

Definition at line 229 of file isf_fifo.c.

References isf_fifo_t::pInsertPtr.

Referenced by Analog_1_fsl_Sensor_Generic_AnalogCallback(), Custom_1_fsl_Sensor_Custom_PeriodicCallback(), fsl_fusion_virt_3D_orient_PeriodicCallback(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxlc95000_PeriodicCallback(), fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(), fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fsl_mma8491q_read_data_OneShotCallback(), fsl_mma865x_i2c_3D_accel_PeriodicCallback(), fsl_mma955x_PeriodicCallback(), and fsl_mpl3115_i2c_1D_press_PeriodicCallback().

Here is the caller graph for this function:

isf_fifo_status_t isf_fifo_el_increment | ( | isf_fifo_t * | pFifo | ) |

Routine increments the insert pointer after direct access.

Definition at line 237 of file isf_fifo.c.

References FIFO_FULL_BIT, isf_fifo_t::fifoState, ISF_FIFO_FULL, ISF_SUCCESS, isf_fifo_t::pInsertPtr, isf_fifo_t::pLastEntry, and isf_fifo_t::sampleSize.

Referenced by Analog_1_fsl_Sensor_Generic_AnalogCallback(), Custom_1_fsl_Sensor_Custom_PeriodicCallback(), fsl_fusion_virt_3D_orient_PeriodicCallback(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxlc95000_PeriodicCallback(), fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(), fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fsl_mma8491q_read_data_OneShotCallback(), fsl_mma865x_i2c_3D_accel_PeriodicCallback(), fsl_mma955x_PeriodicCallback(), and fsl_mpl3115_i2c_1D_press_PeriodicCallback().

Here is the caller graph for this function:

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 the pointer to the first available sample and returns ISF_SUCCESS. Subsequent calls will increment the pointer to each available sample and return ISF_SUCCESS. When ISF_SUCCESS is returned, pSamplePtr may be dereferenced to obtain a fifo entry. When no more samples are available, the function returns ISF_FIFO_NO_MORE_ENTRIES.

Definition at line 259 of file isf_fifo.c.

References FIFO_FULL_BIT, isf_fifo_t::fifoState, ISF_FIFO_NO_MORE_ENTRIES, ISF_SUCCESS, isf_fifo_t::pDataBuffer, isf_fifo_t::pInsertPtr, and isf_fifo_t::sampleSize.

Referenced by App1_MainTask(), and fsl_fusion_virt_3D_orient_PeriodicCallback().

Here is the caller graph for this function:

isf_fifo_status_t isf_fifo_free | ( | isf_fifo_t * | pFifo | ) |

free a fifo's sample buffer.

Definition at line 79 of file isf_fifo.c.

References ALLOCATED_BUFFER_BIT, isf_fifo_t::bufferLock, isf_fifo_t::fifoState, ISF_FIFO_ERR_NO_INIT, ISF_SUCCESS, isf_fifo_t::pDataBuffer, isf_fifo_t::pInsertPtr, and isf_fifo_t::pLastEntry.

uint16 isf_fifo_get_buffer_size | ( | isf_fifo_t * | pFifo | ) |

Routine to query the current fifo size (bytes)

Routine to query the current fifo size (bytes)

Definition at line 133 of file isf_fifo.c.

References isf_fifo_t::pDataBuffer, isf_fifo_t::pLastEntry, and isf_fifo_t::sampleSize.

Referenced by isf_fifo_resize().

Here is the caller graph for this function:

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.

Definition at line 24 of file isf_fifo.c.

References ALLOCATED_BUFFER_BIT, isf_fifo_t::bufferLock, isf_fifo_t::fifoState, ISF_FIFO_ERR_INVALID_PTR, ISF_FIFO_ERR_NO_INIT, ISF_FIFO_ERR_NO_MEM, ISF_SUCCESS, isf_fifo_t::pDataBuffer, isf_fifo_t::pInsertPtr, isf_fifo_t::pLastEntry, and isf_fifo_t::sampleSize.

Referenced by App1_MainTask(), BasicApp1_MainTask(), fsl_fusion_virt_3D_orient_Initialize(), and isf_fifo_alloc().

Here is the caller graph for this function:

isf_fifo_status_t isf_fifo_lock | ( | isf_fifo_t * | pFifo | ) |

Lock a sample buffer for exclusive access.

Definition at line 170 of file isf_fifo.c.

References isf_fifo_t::bufferLock, ISF_FIFO_ERR_NO_INIT, and ISF_SUCCESS.

Referenced by Analog_1_fsl_Sensor_Generic_AnalogCallback(), App1_MainTask(), BasicApp1_MainTask(), Custom_1_fsl_Sensor_Custom_PeriodicCallback(), fsl_fusion_virt_3D_orient_PeriodicCallback(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxlc95000_PeriodicCallback(), fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(), fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fsl_mma8491q_read_data_OneShotCallback(), fsl_mma865x_i2c_3D_accel_PeriodicCallback(), fsl_mma955x_PeriodicCallback(), and fsl_mpl3115_i2c_1D_press_PeriodicCallback().

Here is the caller graph for this function:

isf_fifo_status_t isf_fifo_resize | ( | isf_fifo_t * | pFifo,
|  | uint16 | newCapacity
| ) |  |

Routine to copy the whole sample buffer.

Routine to copy the whole sample buffer.

Warning: When the fifo is resized all sample data in the buffer is lost. It is suggested to resize only when empty

Definition at line 101 of file isf_fifo.c.

References ALLOCATED_BUFFER_BIT, isf_fifo_t::bufferLock, isf_fifo_t::fifoState, ISF_FIFO_ERR_NO_INIT, ISF_FIFO_ERR_USER_BUF, isf_fifo_get_buffer_size(), ISF_SUCCESS, isf_fifo_t::pDataBuffer, and isf_fifo_t::sampleSize.

Here is the call graph for this function:

isf_fifo_status_t isf_fifo_try_lock | ( | isf_fifo_t * | pFifo | ) |

Attempt to lock a sample buffer for exclusive access.

Definition at line 183 of file isf_fifo.c.

References isf_fifo_t::bufferLock, ISF_FIFO_ERR_BUSY, and ISF_SUCCESS.

isf_fifo_status_t isf_fifo_unlock | ( | isf_fifo_t * | pFifo | ) |

Release the exclusive access lock on a sample buffer.

Definition at line 199 of file isf_fifo.c.

References isf_fifo_t::bufferLock, ISF_FIFO_ERR_NO_INIT, and ISF_SUCCESS.

Referenced by Analog_1_fsl_Sensor_Generic_AnalogCallback(), App1_MainTask(), BasicApp1_MainTask(), Custom_1_fsl_Sensor_Custom_PeriodicCallback(), fsl_fusion_virt_3D_orient_PeriodicCallback(), fsl_fxas21002_i2cspi_3D_gyro_PeriodicCallback(), fsl_fxlc95000_PeriodicCallback(), fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(), fsl_fxls8952_i2c_3D_accel_PeriodicCallback(), fsl_fxos8700_i2cspi_6D_AccMag_PeriodicCallback(), fsl_mag3110_i2c_3D_mag_PeriodicCallback(), fsl_mma8491q_read_data_OneShotCallback(), fsl_mma865x_i2c_3D_accel_PeriodicCallback(), fsl_mma955x_PeriodicCallback(), and fsl_mpl3115_i2c_1D_press_PeriodicCallback().

Here is the caller graph for this function:
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.