#define    SPI_MASTER_MODE                       // Remove it,if want to be a SLAVE device

#define    SPI_MAX                0x40

#define    SPI_MASTER             0x5A
#define    SPI_SLAVER             0xA5

//----- AUXIE -----//
#define    ESPI                   0x01

//----- SPCTL -----//
#define    SSIG                   0x80
#define    SPEN                   0x40
#define    DORD                   0x20
#define    MSTR                   0x10
#define    CPOL                   0x08
#define    CPHA                   0x04
#define    SPR1                   0x02
#define    SPR0                   0x01

//----- SPSTAT -----//
#define    SPIF                   0x80
#define    THRE                   0x40
#define    SPR2                   0x01


typedef struct
   { BYTE In_Addr;
     BYTE Out_Addr;
     BYTE Data_Cnt;
     BYTE Tx_Busy;
     BYTE Mode;
   } SPI;