67 #ifndef NZ_APPCONFIG_H 
   68 #define NZ_APPCONFIG_H 
  202 #define CFG_BLOCK_INFO_ID           0x0100 
  203 #define CFG_BLOCK_NET_ID            0x0101 
  204 #define CFG_BLOCK_WIFI_ID           0x0102 
  205 #define CFG_BLOCK_SNMP_ID           0x0103 
  206 #define CFG_BLOCK_GENERAL_ID        0x0104 
  207 #define CFG_BLOCK_NET2_ID           0x0105 
  208 #define CFG_BLOCK_SER_0TO7_ID       0x0108 
  209 #define CFG_BLOCK_SER_8TO15_ID      0x0109 
  210 #define CFG_BLOCK_SER_16TO23_ID     0x010A 
  211 #define CFG_BLOCK_SER_24TO31_ID     0x010B 
  212 #define CFG_BLOCK_STRING_31X8_ID    0x0110   
  213 #define CFG_BLOCK_UC66_PORT_ID      0x0114   
  214 #define CFG_BLOCK_SBC66_PORT_ID     0x0115   
  215 #define CFG_BLOCK_RESERVE_ID        0xFF00   
  221 typedef struct __attribute__((__packed__))
 
  238 #define TABLE_BLOCK_UC66_PORT_ID        0x8200   
  239 #define TABLE_BLOCK_SBC66_PORT_ID       0x8220   
  245 typedef struct __attribute__((__packed__))
 
  258 #define CFG_BLOCK_SIZE(cfgBlk) (sizeof (((CFG_STRUCT*) 0)->cfgBlk) - sizeof (((CFG_STRUCT*) 0)->cfgBlk.reserve)) 
  268 typedef struct __attribute__((__packed__))
 
  285     volatile BYTE   eeConfUpdated;
 
  294 typedef struct __attribute__((__packed__))
 
  299             unsigned char bCurr : 2;     
 
  300             unsigned char bFill : 6;     
 
  305 #define CURRENT_FIRMWARE_UNKNOWN 0 
  306 #define CURRENT_FIRMWARE_A 1 
  307 #define CURRENT_FIRMWARE_B 2 
  310 #ifndef THIS_IS_NZ_APPCONFIG_C 
  316 #define XEEMEM_CFG_STRUCT_SIZE          0x0C00      //3 kBytes 
  318 #define XEEMEM_CFG_INFO_START_ADR       0x0000 
  319 #define XEEMEM_CFG_INFO_END_ADR         0x001F 
  320 #define XEEMEM_CFG_COPY_START_ADR       0x0020 
  321 #define XEEMEM_CFG_COPY_END_ADR         0x03FF 
  322 #define XEEMEM_CFG_COPY_STOP_ADR        0x0400   
  323 #define XEEMEM_CFG_COPY_BLOCKS          ((XEEMEM_CFG_COPY_END_ADR-XEEMEM_CFG_COPY_START_ADR+1)/32) 
  324 #define XEEMEM_CFG_STRUCT_START_ADR     0x0400 
  325 #define XEEMEM_CFG_STRUCT_END_ADR       (XEEMEM_CFG_STRUCT_START_ADR + XEEMEM_CFG_STRUCT_SIZE - 1) 
  326 #define XEEMEM_USER_START_ADR           (XEEMEM_CFG_STRUCT_START_ADR + XEEMEM_CFG_STRUCT_SIZE) 
  327 #define XEEMEM_USER_END_ADR             (XEEPROM_SIZE - 1) 
  332 #define cfgIncCfgCopyAdr(adr) ((adr>=(XEEMEM_CFG_COPY_STOP_ADR-32)) ? XEEMEM_CFG_COPY_START_ADR : (adr+32)) 
  338 typedef struct __attribute__((packed))
 
  340     WORD_VAL    magicNumber;    
 
  345 #define CFG_INFO_MAGIC_NUMBER  0x536A 
  346 #define CFG_VERSION_MAJOR       1 
  347 #define CFG_VERSION_MINOR       0 
  349 #define CFG_COPY_DATA_SIZE 26 
  373 typedef struct __attribute__((packed))
 
  379     BYTE        Data[CFG_COPY_DATA_SIZE];
 
  387 void cfgInit(BYTE* pCfgStructInfo);
 
  428 #define cfgGetDfltStruct(member, struc) cfgGetDfltArray(offsetof(CFG_STRUCT, member), ((BYTE*)&struc), sizeof(struc)) 
  443 BYTE 
cfgBlkGetArray(WORD cfgBlkId, WORD offset, BYTE* buf, BYTE length);
 
  456 BYTE 
cfgGetArray(WORD offset, BYTE* buf, BYTE length);
 
  466 #define cfgGetStruct(member, struc) cfgGetArray(offsetof(CFG_STRUCT, member), ((BYTE*)&struc), sizeof(struc)) 
  478 #define cfgGetByte(offset) (((BYTE*)&cfgStruct)[offset]); 
  498 void cfgSaveArray(WORD offsetCfg, BYTE* buf, WORD length);