#ifndef __I2C_BRIDGE_H
#define __I2C_BRIDGE_H

/**

@file

@brief   I2C bridge module

I2C bridge module contains I2C forwarding function pointers.

*/





/**

@defgroup   I2C_BRIDGE_MODULE   I2C bridge module

One can use I2C bridge to send tuner I2C commands througth demod.
Note thate demod modules should not share the same I2C bridge module.

*/





/**

@addtogroup   I2C_BRIDGE_MODULE_STRUCTURE

*/
/// @{

/// I2C bridge module pre-definition
typedef struct I2C_BRIDGE_MODULE_TAG I2C_BRIDGE_MODULE;

/// @}





/**

@defgroup   I2C_BRIDGE_FUNCTIONS   I2C bridge functions
@ingroup    I2C_BRIDGE_MODULE

One can send tuner I2C commands through I2C bridge functions.

*/
/// @{





/**

@brief   I2C reading command forwarding function pointer

Tuner upper level functions will use I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD() to send tuner I2C reading command through
demod.


@param [in]    pI2cBridge      The I2C bridge module pointer
@param [out]   pReadingBytes   Pointer to an allocated memory for storing reading bytes
@param [in]    ByteNum         Reading byte number


@retval   FUNCTION_SUCCESS   Forwarding I2C reading command successfully.
@retval   FUNCTION_ERROR     Forwarding I2C reading command unsuccessfully.


@note \n
	-# Demod building function will set I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD() with the corresponding function.

*/
typedef int
(*I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD)(
	I2C_BRIDGE_MODULE *pI2cBridge,
	unsigned char *pReadingBytes,
	unsigned char ByteNum
	);





/**

@brief   I2C writing command forwarding function pointer

Tuner upper level functions will use I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD() to send tuner I2C writing command through
demod.


@param [in]    pI2cBridge      The I2C bridge module pointer
@param [out]   pWritingBytes   Pointer to writing bytes
@param [in]    ByteNum         Writing byte number


@retval   FUNCTION_SUCCESS   Forwarding I2C writing command successfully.
@retval   FUNCTION_ERROR     Forwarding I2C writing command unsuccessfully.


@note \n
	-# Demod building function will set I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD() with the corresponding function.

*/
typedef int
(*I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD)(
	I2C_BRIDGE_MODULE *pI2cBridge,
	const unsigned char *pWritingBytes,
	unsigned char ByteNum
	);





/// @}





/**

@defgroup   I2C_BRIDGE_MODULE_STRUCTURE   I2C bridge module structure
@ingroup    I2C_BRIDGE_MODULE

I2C bridge module structure contains manipulating functions and private variables .

*/
/// @{



/// I2C bridge module structure
struct I2C_BRIDGE_MODULE_TAG
{
	// Private variables
	void *pPrivateData;
	unsigned char *pTunerDeviceAddr;


	// I2C bridge function pointers
	I2C_BRIDGE_FP_FORWARD_I2C_READING_CMD   ForwardI2cReadingCmd;	///<   I2C reading command forwading function pointer
	I2C_BRIDGE_FP_FORWARD_I2C_WRITING_CMD   ForwardI2cWritingCmd;   ///<   I2C writing command forwading function pointer

};



/// @}

















#endif
