#define    DFU_MAX             0x40


typedef struct
   { BYTE Stage;                                 // Index the next transaction
     union DWTYPE Addr;
     union DWTYPE Size;
     union WTYPE CheckSum;
     BYTE CheckSumFlg;
   } DFU;                                        // 


#define    DFU_IDLE            0x00
#define    DFU_FW_VER          0x11
#define    DFU_RD_STAGE        0x22
#define    DFU_WR_STAGE        0x33
#define    DFU_RESET           0x44

#define    IAP_START_ADDR      0x3400            // 13k
#define    IAP_SIZE            0x0400            // 1k
#define    IAP_PAGE            0x02              //

#define    ISP_ENABLE          0x80              // Set ISP Enable
#define    ISP_DISABLE         0x00              // Set ISP Disable

#define    ISP_BYTE_READ       0x01
#define    ISP_BYTE_WRITE      0x02
#define    ISP_PAGE_ERASE      0x03

#define    ISP_ACTIVITY_CMD1   0x46
#define    ISP_ACTIVITY_CMD2   0xB9