#define    TWSI_MAX                0x40
#define    RETRY_MAX               0x0A

#define    TWSI_DEVICE_ADDRESS     0x11          // For MASTER mode
#define    TWSI_SLAVE_ADDRESS      0x22          // For SLAVE mode

#define    TWSI_DEVICE_WRITE       0x00
#define    TWSI_DEVICE_READ        0x01

#define    TWSI_START              0x5A
#define    TWSI_STOP               0xA5
#define    TWSI_IDLE               0x55
#define    TWSI_ERROR              0xAA

#define    ETWSI                   0x40          // In AUXIE
#define    PTWSI                   0x40          // In AUXIP


typedef struct
   { BYTE InIndex;
     BYTE OutIndex;
     BYTE Dev;
     BYTE Size;
     BYTE Stage;
     BYTE RetryCnt;
   } TWSI;