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

extern uchar __IPSBAR[];

/*********************************************************************
*
*
*********************************************************************/

/*
** error codes
*/
#define QSPI_OK             (0x00)
#define QSPI_UNDEF_ERROR             (QSPI_ERROR_BASE | 0x01)
#define QSPI_INVALID_ADDRESS         (QSPI_ERROR_BASE | 0x02)
#define QSPI_TRANSFER_MODE_INVALID   (QSPI_ERROR_BASE | 0x03)
#define QSPI_DEINIT_FAILED           (QSPI_ERROR_BASE | 0x04)
#define QSPI_BAUDRATE_INVALID        (QSPI_ERROR_BASE | 0x05)
#define QSPI_BRG_FAILD               (QSPI_ERROR_BASE | 0x06)
#define QSPI_CHIPSELECT_INVALID      (QSPI_ERROR_BASE | 0x07)
#define QSPI_TX_NO_DATA              (QSPI_ERROR_BASE | 0x08)
#define QSPI_TIMED_OUT               (QSPI_ERROR_BASE | 0x09)


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

/*
** MCF52XX_AD5546_INFO_STRUCT
** Run time state information for each serial channel
*/
typedef struct mcf52xx_AD5546_info_struct
{
   /* The current init values for this port */
   MCF52XX_AD5546_INIT_STRUCT          INIT;
   
   /* Interrupt code required if interrupt driven */
   uint_32                           INT_BITS;

   /* The previous interrupt handler and data */
   void       (_CODE_PTR_ OLD_ISR)(pointer);
   void       (_CODE_PTR_ OLD_ISR_EXCEPTION_HANDLER)(uint_32, uint_32, pointer, pointer);
   pointer                           OLD_ISR_DATA;

   /* Total number of bytes to read */
   uint_32                           TOTAL_SIZE;

   /* Number of bytes to read */
   uint_32                           BYTE_COUNT;

   /* Pointer to the buffer to use for Tx/Rx data */
   uchar_ptr                         BUFFER;

   /* Rx index */
   uint_32                           RX_INDEX;

   /* Current Rx buffer length */
   uint_32                           RX_BUF_LEN;

   /* Pointer to the buffer to use for current Tx data */
   uchar_ptr                         TX_BUF;

   /* Tx index */
   uint_32                           TX_INDEX;

   /* Current Tx buffer length */
   uint_32                           TX_BUF_LEN;

   /* Statistical information */
   uint_32                           INTERRUPTS;
   uint_32                           RX_PACKETS;
   uint_32                           TX_PACKETS;
   uint_32                           TX_ABORT;

} MCF52XX_AD5546_INFO_STRUCT, _PTR_ MCF52XX_AD5546_INFO_STRUCT_PTR;

/*-----------------------------------------------------------------------*/
/*                      FUNCTION PROTOTYPES                              */
/*-----------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif

extern void _mcf_qspi_int_isr(pointer);

#ifdef __cplusplus
}
#endif

#endif

/* EOF */