/******************************************************************************

Copyright (c) 2005 Analog Devices.  All Rights Reserved.

This software is proprietary and confidential.  By using this software you agree
to the terms of the associated Analog Devices License Agreement.

******************************************************************************/



/******************************************************************************

$File:		device.h $
$Revision: 1.1 $
$Date: 2007/05/22 18:24:44 $

Description:
	Device include for sensor capture application

References:

Note:

Modification History:
-------------------------------------------------------------------------------
Revision 1.0 - BJ 2006/07/02
	- Created file

******************************************************************************/

#ifndef __DEVICE_H__
#define __DEVICE_H__


/******************************************************************************

Include files

******************************************************************************/

#include <ada_gfx/gfx.h>
#include <drivers/adi_dev.h>




/******************************************************************************

Definitions

******************************************************************************/

#define DEVICE_TYPE_MASK	0x000000FF
#define DEVICE_MODE_MASK	0x0000FF00
#define DEVICE_DIR_MASK		0x80000000

#define DEVICE_INPUT		0
#define DEVICE_OUTPUT		1

#define DEVICE(Type,Dir,Mode) ((Dir?DEVICE_DIR_MASK:0)|((Mode<<8)&DEVICE_MODE_MASK)|(Type&DEVICE_TYPE_MASK))


typedef enum
{
	DEVICE_MT9V022M,
	DEVICE_OV7648,
	DEVICE_ADV7179,
	DEVICE_NL6448BC33,
	DEVICE_NUMBER,
	DEVICE_UNKNOWN
} DEVICE_TYPE;


enum {
	ENCODER_CMD_SET_MODE,
};


enum
{
	MICRON_SCALE_1X,
	MICRON_SCALE_2X,
	MICRON_SCALE_4X,
};

enum {
	MICRON_CMD_SET_SCALE,
	MICRON_CMD_SET_MODE,
};


enum
{
	OMNIVISION_SCALE_1X,
	OMNIVISION_SCALE_2X,
};

enum {
	OMNIVISION_CMD_SET_SCALE,
	OMNIVISION_CMD_SET_MODE,
};




/******************************************************************************

Function definitions

******************************************************************************/

u32 device_init(ADI_DEV_MANAGER_HANDLE, ADI_DMA_MANAGER_HANDLE, ADI_DCB_HANDLE);
u32 device_detect(DEVICE_TYPE);
ADI_DEV_DEVICE_HANDLE device_open(DEVICE_TYPE, u32, u16 *, u8, ADI_DCB_CALLBACK_FN, ADI_DEV_CMD_VALUE_PAIR *);
u32 device_close(ADI_DEV_DEVICE_HANDLE);




#endif

/*****************************************************************************/
