#ifndef _FILE_DRIVER_LIBRARY_H_
#define _FILE_DRIVER_LIBRARY_H_
//******************************************************************************


// ****************************************************************************
// CONDITIONAL COMPILATION DIRECTIVES: Conditional compilation control
// ****************************************************************************


// ****************************************************************************
// INCLUDE FILES: Header files of modules referenced by this module
// ****************************************************************************
#include <spi.h>
#include <sensors_universal.h>
#include <ConfigFile.h>
#include "driver_example.h"


// ****************************************************************************
// MODULE DOCUMENTATION: Detailed description of the module
// ****************************************************************************


// ****************************************************************************
// PUBLIC TYPES: Public types shared with other modules
// ****************************************************************************


// ****************************************************************************
// PUBLIC MACROS: Public #define directives shared with other modules
// ****************************************************************************
// Sensor board driver identification
#define DRIVER_EXAMPLE			 (0)		
#define NUM_SENSOR_BOARDS        (1)


// ****************************************************************************
// PUBLIC VARIABLES: Public variables shared with other modules
// ****************************************************************************


// ****************************************************************************
// PUBLIC FUNCTIONS: Public functions shared with other modules
// ****************************************************************************
//---------------------------------------------------------------------
//! @brief Initialization of sensors on specific board
//!
//! Initialization functions of sensor boards have same interface for
//! all boards. Init functions are hardcoded in the look-up table in
//! form of function pointers. Call of the init function is just call
//! of the specific item of the look-up table based on the driver
//! number.
//!
//! @param[in] sensorMemory - sensor initialization structure
//! @param[out] N/A
//! @return number of successfully initialized sensors
//---------------------------------------------------------------------
int8_t InitSensorBoard( SensorMemory_t * sensorMemory );

//---------------------------------------------------------------------
//! @brief Reads data from specific board
//!
//! Read functions of sensor boards have same interface for
//! all boards. Read functions are hardcoded in the look-up table in
//! form of function pointers. Call of the read function is just call
//! of the specific item of the look-up table based on the driver
//! number.
//!
//! @param[in]  sensorMemory - sensor initialization structure
//! @param[out] sensorData - buffer for sensor data
//! @param[out] sensorDataLength - length of sensor data stored to buffer
//! @return none
//---------------------------------------------------------------------
void ReadSensorBoard( SensorMemory_t * sensorMemory, uint32_t * sensorData, uint32_t * sensorDataLength );

//---------------------------------------------------------------------
//! @brief Clears FIFO queues for all sensors on specific board
//!
//! Clear FIFO functions of sensor boards have same interface for
//! all boards. Clear FIFO functions are hardcoded in the look-up
//! table in form of function pointers. Call of the clear FIFO function
//! is just call of the specific item of the look-up table based on the
//! driver number. FIFO clear function empties the FIFOs as fast as
//! possible in order to avoid FIFO overflows.
//!
//! @param[in]  sensorMemory - sensor initialization structure
//! @param[out] N/A
//! @return none
//---------------------------------------------------------------------
void ClearSensorBoardFifo( SensorMemory_t * sensorMemory );

void ClearSensorBoard( SensorMemory_t * sensorMemory );

#endif //_FILE_DRIVER_LIBRARY_H_
