#ifndef _AD5546prv_h_
#define _AD5546prv_h_ 1
/**HEADER********************************************************************
* 
* Copyright (c) 2010 Avnet Japan Co.,Ltd (NIKE Borad Project.)
* All Rights Reserved
*
*************************************************************************** 
*
* $FileName: AD5546_prv.h$
* $Version : 0.1.0.0$
* $Date    : Jan-29-2010$
*
* Comments:
*
*
*END************************************************************************/

/*--------------------------------------------------------------------------*/
/*
**                            DATATYPE DECLARATIONS
*/

/*---------------------------------------------------------------------
**
** IO QSPI POLLED DEVICE STRUCT
**
** This structure used to store information about an QSPI polled io device
** for the IO device table
*/
typedef struct io_AD5546_device_struct
{

   /* The I/O init function */
//   _mqx_uint (_CODE_PTR_ DEV_INIT)(pointer, pointer _PTR_, char _PTR_);
   _mqx_uint (_CODE_PTR_ DEV_INIT)(pointer, char _PTR_);

   /* The I/O deinit function */
   _mqx_uint (_CODE_PTR_ DEV_DEINIT)(pointer, pointer);
   
   /* [IN] The READ function */
   _mqx_int (_CODE_PTR_ DEV_READ)(pointer, char_ptr, _mqx_int);
      
   /* [IN] The WRITE function */
   _mqx_int (_CODE_PTR_ DEV_WRITE)(pointer, char_ptr, _mqx_int);
   
   /* The ioctl function, (change bauds etc) */
   _mqx_int (_CODE_PTR_ DEV_IOCTL)(pointer, _mqx_uint, _mqx_uint_ptr);

   /* The I/O channel initialization data */
   pointer             DEV_INIT_DATA_PTR;
   
   /* Device specific information */
   pointer             DEV_INFO_PTR;

   /* Open count for number of accessing file descriptors */
   _mqx_uint           COUNT;

   /* Open flags for this channel */
   uint_32             FLAGS;
   
   /* This is used to abort the current read or write immediately */
   boolean             ABORT;
   
   /* This is to let the upper layer know we've read the last chars */
   boolean             LAST_RX_CHARS;
   
   /* Remove this when we start using the timeout lwsem */
   boolean             OCCUPIED;
   
   /* Pointer to the buffer to use for current Rx data */
   uchar _PTR_         RX_BUFF;
   
   /* The size left in the RX_BUFF */ 
   uint_32             RX_BUFF_SIZE;
   
   /* Light weight semaphore struct */
   LWSEM_STRUCT         LWSEM;

} IO_AD5546_DEVICE_STRUCT, _PTR_ IO_AD5546_DEVICE_STRUCT_PTR;

/*--------------------------------------------------------------------------*/
/* 
**                        FUNCTION PROTOTYPES
*/

#ifdef __cplusplus
extern "C" {
#endif

extern _mqx_int _io_AD5546_open(FILE_DEVICE_STRUCT_PTR, char _PTR_, char _PTR_);
extern _mqx_int _io_AD5546_close(FILE_DEVICE_STRUCT_PTR);
extern _mqx_int	_io_AD5546_read(FILE_DEVICE_STRUCT_PTR, char_ptr, _mqx_int);
extern _mqx_int _io_AD5546_write(FILE_DEVICE_STRUCT_PTR, char_ptr, _mqx_int);
extern _mqx_int _io_AD5546_ioctl(FILE_DEVICE_STRUCT_PTR, _mqx_uint, pointer);
extern _mqx_int _io_AD5546_uninstall(IO_DEVICE_STRUCT_PTR);

#ifdef __cplusplus
}
#endif

#endif

/* EOF */
