/*
 *******************************************************************************
 *  Copyright (c) 2010-2022 VATICS(KNERON) Inc. All rights reserved.
 *
 *  +-----------------------------------------------------------------+
 *  | THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED |
 *  | AND COPIED IN ACCORDANCE WITH THE TERMS AND CONDITIONS OF SUCH  |
 *  | A LICENSE AND WITH THE INCLUSION OF THE THIS COPY RIGHT NOTICE. |
 *  | THIS SOFTWARE OR ANY OTHER COPIES OF THIS SOFTWARE MAY NOT BE   |
 *  | PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON. THE   |
 *  | OWNERSHIP AND TITLE OF THIS SOFTWARE IS NOT TRANSFERRED.        |
 *  |                                                                 |
 *  | THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT   |
 *  | ANY PRIOR NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY |
 *  | VATICS(KNERON) INC.                                             |
 *  +-----------------------------------------------------------------+
 *
 *******************************************************************************
 */
#ifndef GYRO_DAEMON_H
#define GYRO_DAEMON_H

#ifdef __cplusplus
extern "C" {
#endif

/*
 * A data structure for gyro daemon
 */
typedef struct
{
	//! A data for device number (1: Default value)
	unsigned long ulDeviceNum;

	//! A data for speed of getting gyro data from iio (per second), default = 30.
	//! This setting works while no video source is opening.
	unsigned int dwSpeed;

	//! A data for frequency for iio to get data. (Please check gyro spec for correct number, default: 200)
	unsigned int dwFrequency;

	//! A data for gyro full scale range. (-1: do nothing, should be 250, 500, 1000 or 2000)
	int sdwGyroFsr;

    //! A data for accel full scall range. (-1: do nothing)
	int sdwAccelFsr;

	//! A data for sample count in gyro buffer. (Suggest equal to dwFrequency, default: 200)
	unsigned int dwSampleCount;

	//! A data for output SCM pin name.
	char* pszPinName;
} VMF_VSRC_GYRO_CONFIG_T;

/**
 * @brief Function to open Gyro daemon. If video source is using EIS feature, this daemon will open automatically.
 *        No need to use this API.
 *
 * @return Success: 0  Fail: negative integer.
 */
int VMF_GYRO_Open(VMF_VSRC_GYRO_CONFIG_T* ptGyroConfig);

/**
 * @brief Function to close Gyro daemon. If video source is using EIS feature, this daemon will close automatically.
 *        No need to use this API.
 *
 */
void VMF_GYRO_Close();

#ifdef __cplusplus
}
#endif

#endif
