// For CA538A (SunplusCam_AP V1.1.0.7)

[CAMERADLL]
IC_ID=8  //"CA538A"
VendorID="04fc"
ProductID="5380"
DEBUG_DATA=0
BULK_UPLOAD_SIZE=65536
BULK_UPLOAD_SEG_SIZE=0x600000
BULK_ISP_SIZE=256
OverwriteExistFile=0
BulkTimeOut=1
BULK_UPLOAD_FDB_Delay=10
BULK_UPLOAD_FDB_Retry=5
Rawdata10Format=1 // 0:unpack rawdata, 1:pack rawdata
CutLargeRawdataToVGA=0
Bulk_CreateFile_OVERLAPPED_Flag=0  //file attributes->0:NULL, 1:FILE_FLAG_OVERLAPPED
FirstRunToCheckBulkStatus=1
BULK_FLASH_SIZE=4096

[BULKGUID]
// 0: 0xcb519fa1, 0xe908, 0x11d2, 0xaa, 0xdd, 0x0, 0x60, 0x67, 0x34, 0x87, 0xb7 -> CA504A
// 1: 0xf77cca61, 0xdd15, 0x11d5, 0xbe, 0xbf, 0x0, 0x60, 0x67, 0x33, 0xa9, 0xbe -> CA533A
// ?=62~79: 0xf77cca??, 0xdd15, 0x11d5, 0xbe, 0xbf, 0x0, 0x60, 0x67, 0x33, 0xa9, 0xbe -> Backup 23 sets
ID_NUMBER=0

[REGISTER]
reg_CamMode             =   0x0000
    CamMode_Idle            =   0
    CamMode_Preview         =   1
    CamMode_DSC             =   2
    CamMode_VideoClip       =   3
    CamMode_PcCamera        =   4
    CamMode_Playback        =   5
    CamMode_Upload          =   6

reg_PbSrc               =   0x2301
    // ---- PbSrc Value ----
    DramUsb             =   0x40

reg_AutoPbSize          =   0xFFFF  //0x2306
    AutoPbSize_None         =   0
    AutoPbSize_Auto         =   1

reg_DramType            =   0x7000
    Sdram_1M16x1            =   0
    Sdram_1M16x2            =   1
    Sdram_4M16b2            =   0xF0
    Sdram_4M16b4            =   2
    Sdram_8M16b4            =   3
    Sdram_16M16b4        =   4
    Sdram_32M16b4        =   5
    DDRSdram_8M16b4         =   8
    DDRSdram_16M16b4        =   9
    DDRSdram_32M16b4        =   10
    EDOdram_256Kx16         =   0xF1

    Sdram_Mask              =   0x07

    Sdram_4M16b4_FATaddress     =   0x3fff80
    Sdram_8M16b4_FATaddress     =   0x7fff80

    Sdram_DSC_Flag          =   0x00
    Sdram_VideoClip_Flag    =   0x08
    Sdram_Wave_Flag         =   0x04
    Sdram_ExtVideoClip_Flag =   0x80
    Sdram_ExtDSC_Flag           =   0x03

reg_ImageType           =   0x7030
    // ---- Image Type Value ----
    RawData10bit            =   0
    RawData8bit             =   0xfe
    YUV422Ncomp             =   1
    YUV422Comp              =   2
    YUV420Ncomp             =   3
    YUV420Comp              =   4
    YUV420NcompUV           =   3
    YUV420CompUV            =   4

reg_SdramSizeL          =   0x7118      // Size [7:0]
reg_SdramSizeM          =   0x7119      // Size [15:8]
reg_SdramSizeH          =   0x711A      // Size [23:16]

reg_VlcAddressL         =   0x7110      // addr [7:0]
reg_VlcAddressM         =   0x7111      // addr [15:8]
reg_VlcAddressH         =   0x7112      // addr [23:16]
reg_VlcAddressH1        =   0x7113      // addr [24] --> CA538 support

reg_MemWidthL           =   0x27B6      // not in DRAMCTRL
reg_MemWidthH           =   0x27B7      // not in DRAMCTRL

reg_MemHeightL          =   0x27B8      // not in DRAMCTRL
reg_MemHeightH          =   0x27B9      // not in DRAMCTRL

reg_Trigger             =   0x27a1      // several kinds of trigger in different register, what kind ?
    // ---- Trigger bit Value ----
    TrigDramFifo            =   2

reg_Control_Status      =   0x27b0      // several kinds of ready status in different register, what kind ?
    // ---- Status bit Value ----
    DramBusy                =   1           // Bit 0
    CapDone                 =   2           // Bit 1
    ClipDone                =   4           // Bit 2
    UploadDone              =   8           // Bit 3
    DnldDone                =   16          // Bit 4
    CompDone                =   32          // Bit 5
    DecoDone                =   64          // Bit 6


reg_JFIF                =   0x2884

reg_CompSizeL           =   0x7118
reg_CompSizeM           =   0x7119
reg_CompSizeH           =   0x711A

reg_I2C_wIndex          =   0x9030
reg_I2C_wValue          =   0x9031
reg_I2C_rValue          =   0x9031
reg_I2C_rStatus         =   0x90A0
reg_I2C_rPrefitch       =   0x9008
    I2C_Prefitch        =   0x11

reg_H_Subsample         =   0xFFFF
    // ---- Subsample Value ----
    H_Subsample_1X          =       0                   // No subsample
    H_Subsample_2X          =       1                   // 1/2 subsample
    H_Subsample_4X          =       2                   // 1/4 subsample
    H_Subsample_8X          =       3                   // 1/8 subsample

reg_V_Subsample         =       0xFFFF
    // ---- Subsample Value ----
    V_Subsample_1X          =       0                   // No subsample
    V_Subsample_2X          =       1                   // 1/2 subsample
    V_Subsample_4X          =       2                   // 1/4 subsample
    V_Subsample_8X          =       3                   // 1/8 subsample

reg_Thumbnail           =   0x2883
reg_TMBAddressL         =   0xFFFF
reg_TMBAddressM         =   0xFFFF
reg_TMBAddressH         =   0xFFFF

reg_DRAMdataL           =       0xFFFF
reg_DRAMdataH           =       0xFFFF

reg_DRAMaddrL           =       0xFFFF
reg_DRAMaddrM           =       0xFFFF
reg_DRAMaddrH           =       0xFFFF

reg_InitDRAM            =       0x700F
        // ---- Bit define ----
    Prefetch                   =       0xF0
    CLRmem                     =       0xF1
    INITsdram                  =       1

reg_FillDRAM            =       0x701F
    Fillmem                    =       1                // the fill triggger is changed to this register

reg_FillSizeL           =       0x7010
reg_FillSizeM           =       0x7011
reg_FillSizeH           =       0xFFFF

reg_ClrSizeL            =       0xFFFF
reg_ClrSizeM            =       0xFFFF
reg_ClrSizeH            =       0xFFFF

reg_ClrDataL            =       0x7012
reg_ClrDataH            =       0x7013

reg_FrameBufferA_AddressL   = 0x7080     // addr[7:0]
reg_FrameBufferA_AddressM   = 0x7081     // addr[15:8]
reg_FrameBufferA_AddressH   = 0x7082     // addr[23:16]  
reg_FrameBufferA_AddressH1  = 0x7083     // addr[24] --> CA538 support

reg_FB_A_WidthL     =   0x7084
reg_FB_A_WidthH     =   0x7085

reg_FB_A_HeightL    =   0x7086
reg_FB_A_HeightH    =   0x7087

reg_FrameBufferB_AddressL   = 0x7088      // addr[7:0]
reg_FrameBufferB_AddressM   = 0x7089      // addr[15:8]
reg_FrameBufferB_AddressH   = 0x708A      // addr[23:16] 
reg_FrameBufferB_AddressH1  = 0x708B      // addr[24] --> CA538 support

reg_FB_B_WidthL     =   0x708C
reg_FB_B_WidthH     =   0x708D

reg_FB_B_HeightL    =   0x708E
reg_FB_B_HeightH    =   0x708F

reg_RawFrameBuffer_AddressL   =   0x70C0  // addr[7:0]
reg_RawFrameBuffer_AddressM   =   0x70C1  // addr[15:8]
reg_RawFrameBuffer_AddressH   =   0x70C2  // addr[23:16] 
reg_RawFrameBuffer_AddressH1  =   0x70C3  // addr[24] --> CA538 support

reg_RawFB_WidthL    =   0x70C4
reg_RawFB_WidthH    =   0x70C5

reg_RawFB_HeightL   =   0x70C6
reg_RawFB_HeightH   =   0x70C7

reg_RawFB_HoffsetL  =   0x70C8
reg_RawFB_HoffsetH  =   0x70C9

reg_BadPixel_PgBP   =   0x2110
    PgBP_Enable     =   6
    PgBP_Disable    =   3
reg_BadPixelInXL    =   0x2111
reg_BadPixelInXH    =   0x2112
reg_BadPixelInYL    =   0x2113
reg_BadPixelInYH    =   0x2114
reg_BadPixelAddr    =   0x2115

reg_Subsample_HoffsetL   =  0x2A30
reg_Subsample_HoffsetH   =  0x2A31
reg_Subsample_VoffsetL   =  0x2A34
reg_Subsample_VoffsetH   =  0x2A35


[VENDORCOMMAND]

GetFWVersion_Request        =   0x20
GetFWVersion_Index          =   0x01
GetFWVersion_Value          =   0x00
GetFWVersion_Length         =   0x08

GetFDBCount_Request         =   0x54
GetFDBCount_Index           =   0x00
GetFDBCount_Value           =   0x00
GetFDBCount_Length          =   0x02

GetFDBContext_Request       =   0x54
GetFDBContext_Index         =   0x01
GetFDBContext_Value         =   0x00
GetFDBContext_Length        =   0x01

FDBGetObject_Request        =   0x54
FDBGetObject_Index          =   0x02
FDBGetObject_Value          =   0x00    //file_index
FDBGetObject_Length         =   0x00

FDBGetObjectAVI_Request         =   0x54
FDBGetObjectAVI_Index           =   0x03
FDBGetObjectAVI_Value           =   0x00    //file_index
FDBGetObjectAVI_Length          =   0x00

FDBGetObjectTMB_Request         =   0x54    //0x0c
FDBGetObjectTMB_Index           =   0x03    //0x06
FDBGetObjectTMB_Value           =   0x00
FDBGetObjectTMB_Length          =   0x00

FDBPollingDataReady_Request     =   0x21
FDBPollingDataReady_Index       =   0x00
FDBPollingDataReady_Value       =   0x00
FDBPollingDataReady_Length      =   0x01

FDBGetClusterSize_Request       =   0x23
FDBGetClusterSize_Index         =   0x64
FDBGetClusterSize_Value         =   0x00
FDBGetClusterSize_Length        =   0x02

FDBGetProductInf_Request        =   0x23
FDBGetProductInf_Index          =   0x00
FDBGetProductInf_Value          =   0x00
FDBGetProductInf_Length         =   0x40

FDBGetPartialTMB_Request    =   0x60
FDBGetPartialTMB_Index      =   0x00
FDBGetPartialTMB_Value      =   0x00
FDBGetPartialTMB_Length     =   0x40

GetFATCount_Request         =   0x44
GetFATCount_Index           =   0x00
GetFATCount_Value           =   0x00
GetFATCount_Length          =   0x08

GetFATObject_Request        =   0x44
GetFATObject_Index          =   0x01
GetFATObject_Value          =   0x00    //file_count
GetFATObject_Length         =   0x00

FATGetObject_Request        =   0x44
FATGetObject_Index          =   0x02
FATGetObject_Value          =   0x00    //file_index
FATGetObject_Length         =   0x00

FAT_Capture_DSC_Request     =   0x06
FAT_Capture_DSC_Index       =   0x03
FAT_Capture_DSC_Value       =   0x00
FAT_Capture_DSC_Length      =   0x00

GetQTable_Request           =   0x26
GetQTable_Index             =   0x00
GetQTable_Value             =   0x00
GetQTable_Length            =   0x01

BulkUpload_Request          =   0x07    // Software VendorCommand
BulkUpload_Index            =   0x03    // Short Packet
BulkUpload_Value            =   0x00
BulkUpload_Length           =   0x08

BulkDnload_Request          =   0xfd
BulkDnload_Index            =   0x04f3
BulkDnload_Value            =   0x00
BulkDnload_Length           =   0x08

BulkUploadPreSetReg_Request     =   0xfd
BulkUploadPreSetReg_Index       =   0x04f2
BulkUploadPreSetReg_Value       =   0x00
BulkUploadPreSetReg_Length      =   0x08

BulkUploadRestoreReg_Reques     =   0xff
BulkUploadRestoreReg_Index      =   0xffff
BulkUploadRestoreReg_Value      =   0x00
BulkUploadRestoreReg_Length     =   0x00

ISP_Dnload_Request          =   0xFd
ISP_Dnload_Index            =   0x04F1
ISP_Dnload_Value            =   0x00    // 256byte base
ISP_Dnload_Length           =   0x10

FDBCaptureObject_Request    =   0x51
FDBCaptureObject_Index      =   0x00
FDBCaptureObject_Value      =   0x00
FDBCaptureObject_Length     =   0x00

FDBGetCardInf_Request       =   0x23
FDBGetCardInf_Index         =   0x65
FDBGetCardInf_Value         =   0x00
FDBGetCardInf_Length        =   0x40

BulkUploadFlash_Request     =   0xfc
BulkUploadFlash_Index       =   0x04f4
BulkUploadFlash_Value       =   0x00
BulkUploadFlash_Length      =   0x08

BulkDnloadFlash_Request     =   0xfc
BulkDnloadFlash_Index       =   0x04f5
BulkDnloadFlash_Value       =   0x00
BulkDnloadFlash_Length      =   0x08

FAT_DeleteAll_DSC_Request   =   0xff
FAT_DeleteAll_DSC_Index     =   0xffff
FAT_DeleteAll_DSC_Value     =   0x00
FAT_DeleteAll_DSC_Length    =   0x00

CheckCardExist_Request   =   0x28
CheckCardExist_Index     =   0x02
CheckCardExist_Value     =   0x00
CheckCardExist_Length    =   0x01

Check_FW_Idle_Request   =   0x21
Check_FW_Idle_Index     =   0x00
Check_FW_Idle_Value     =   0x00
Check_FW_Idle_Length    =   0x01

FDBDeleteObject_Request    =   0x52
FDBDeleteObject_Index      =   0x00
FDBDeleteObject_Value      =   0x00
FDBDeleteObject_Length     =   0x00

CheckSDRAMExist_Request   =   0x28
CheckSDRAMExist_Index     =   0x00
CheckSDRAMExist_Value     =   0x00
CheckSDRAMExist_Length    =   0x01

CheckNFExist_Request   =   0x28
CheckNFExist_Index     =   0x01
CheckNFExist_Value     =   0x00
CheckNFExist_Length    =   0x01

Cpu_Reset_Request      =   0x01
Cpu_Reset_Index        =   0x
Cpu_Reset_Value        =   
Cpu_Reset_Length       =   

BadPixel_Dnload_Request =   0xfd
BadPixel_Dnload_Index   =   0x04f6
BadPixel_Dnload_Value   =   0x04
BadPixel_Dnload_Length  =   0x40

GetSensorSizeInf_Request       =   0x23
GetSensorSizeInf_Index         =   0x01
GetSensorSizeInf_Value         =   0x00
GetSensorSizeInf_Length        =   0x40

SyncDataTime_Request    =   0xff
SyncDataTime_Index      =   0xffff
SyncDataTime_Value      =   0x00
SyncDataTime_Length     =   0x01

GetFWVersionCustomer_Request   =   0x20
GetFWVersionCustomer_Index     =   0x02
GetFWVersionCustomer_Value     =   0x00
GetFWVersionCustomer_Length    =   0x08

GetAPVersion_Request    =   0x20
GetAPVersion_Index      =   0x00
GetAPVersion_Value      =   0x00
GetAPVersion_Length     =   0x08

GetUploadPageStatus_Request    =   0x21
GetUploadPageStatus_Index      =   0x02
GetUploadPageStatus_Value      =   0x00
GetUploadPageStatus_Length     =   0x01

ChangeStorageType_Request    =   0x5a
ChangeStorageType_Index      =   0x00
ChangeStorageType_Value      =   0x00
ChangeStorageType_Length     =   0x01

ChangeCameraMode_Request     =   0x32
ChangeCameraMode_Index       =   0x00
ChangeCameraMode_Value       =   0x00
ChangeCameraMode_Length      =   0x00

GetFWVersionL1L2_Request   =   0xff
GetFWVersionL1L2_Index     =   0xffff
GetFWVersionL1L2_Value     =   0x00
GetFWVersionL1L2_Length    =   0x08

GetFWVersionAEAWB_Request  =   0xff
GetFWVersionAEAWB_Index    =   0xffff
GetFWVersionAEAWB_Value    =   0x00
GetFWVersionAEAWB_Length   =   0x08

EEPROM_Upload_Request      =   0xff
EEPROM_Upload_Index        =   0xffff
EEPROM_Upload_Value        =   0x00
EEPROM_Upload_Length       =   0x00

EEPROM_Dnload_Request      =   0xff
EEPROM_Dnload_Index        =   0xffff
EEPROM_Dnload_Value        =   0x00
EEPROM_Dnload_Length       =   0x00

DiskCamSysInfo_Dnload_Request      =   0xff
DiskCamSysInfo_Dnload_Index        =   0xffff
DiskCamSysInfo_Dnload_Value        =   0x00
DiskCamSysInfo_Dnload_Length       =   0x00

DiskCamAETable_Dnload_Request      =   0xff
DiskCamAETable_Dnload_Index        =   0xffff
DiskCamAETable_Dnload_Value        =   0x00
DiskCamAETable_Dnload_Length       =   0x00

GetDirectoryCount_Request         =   0xff
GetDirectoryCount_Index           =   0xffff
GetDirectoryCount_Value           =   0x00
GetDirectoryCount_Length          =   0x02

GetDirectoryContext_Request       =   0xff
GetDirectoryContext_Index         =   0xffff
GetDirectoryContext_Value         =   0x00
GetDirectoryContext_Length        =   0x02

GetNowDirectory_Request       =   0xff
GetNowDirectory_Index         =   0xffff
GetNowDirectory_Value         =   0x00
GetNowDirectory_Length        =   0x02

SetDirectory_Request       =   0xff
SetDirectory_Index         =   0xffff
SetDirectory_Value         =   0x00
SetDirectory_Length        =   0x02

GetFW_LibraryNumber_Request   =  0x20
GetFW_LibraryNumber_Index     =  0x80
GetFW_LibraryNumber_Value     =  0x00
GetFW_LibraryNumber_Length    =  0x04

GetFW_LibraryName_Request   =  0x20
GetFW_LibraryName_Index     =  0x81
GetFW_LibraryName_Value     =  0x00
GetFW_LibraryName_Length    =  0x10

GetFW_LibraryVersion_Request   =  0x20
GetFW_LibraryVersion_Index     =  0x82
GetFW_LibraryVersion_Value     =  0x00
GetFW_LibraryVersion_Length    =  0x10

//add for FRM
ResChangeDirectory_Request = 0x76
ResChangeDirectory_Index = 0x73
ResChangeDirectory_Value = 0x00
ResChangeDirectory_Length = 0x00

ResDeleteFile_Request = 0x76
ResDeleteFile_Index = 0x74
ResDeleteFile_Value = 0x00
ResDeleteFile_Length = 0x00

ResGetSpecifiedPath_Requset = 0x76
ResGetSpecifiedPath_Index = 0x75
ResGetSpecifiedPath_Value = 0x00
ResGetSpecifiedPath_Length = 0x00

ResItemCount_Requset = 0x77
ResItemCount_Index = 0x01
ResItemCount_Value = 0x00
ResItemCount_Length = 0x02

ResCreateDirectory_Request = 0x76
ResCreateDirectory_Index = 0x77
ResCreateDirectory_Value = 0x00
ResCreateDirectory_Length = 0x00

ResCreateAndWriteFile_Request = 0x76
ResCreateAndWriteFile_Index = 0x78
ResCreateAndWriteFile_Value = 0x00
ResCreateAndWriteFile_Length = 0x00

ResTranferInfoToPC_Request = 0x76
ResTranferInfoToPC_Index = 0x79
ResTranferInfoToPC_Value = 0x00
ResTranferInfoToPC_Length = 0x00

ResUploadToPC_Request = 0x76
ResUploadToPC_Index = 0x80
ResUploadToPC_Value = 0x00
ResUploadToPC_Length = 0x00

ResWriteFile_Request = 0x76
ResWriteFile_Index = 0x81
ResWriteFile_Value = 0x00
ResWriteFile_Length = 0x00

ResCloseFile_Requset = 0x76
ResCloseFile_Index = 0x82
ResCloseFile_Value = 0x00
ResCloseFile_Length = 0x00

WriteFileBuffer2Dram_Request = 0x76
WriteFileBuffer2Dram_Index = 0x84
WriteFileBuffer2Dram_Value = 0x00
WriteFileBuffer2Dram_Length = 0x08

DeleteResourceDirectory_Request = 0x76
DeleteResourceDirectory_Index = 0x85
DeleteResourceDirectory_Value = 0x00
DeleteResourceDirectory_Length = 0x00

GetDetailFileInfo_Request = 0x76
GetDetailFileInfo_Index = 0x86
GetDetailFileInfo_Value = 0x00
GetDetailFileInfo_Length = 0x00

GetNandFwSize_Request = 0x77
GetNandFwSize_Index = 0x02
GetNandFwSize_Value = 0x00
GetNandFwSize_Length = 0x04

ResUploadFirmwareToPC_Request = 0x76
ResUploadFirmwareToPC_Index = 0xfa
ResUploadFirmwareToPC_Value = 0x00
ResUploadFirmwareToPC_Length = 0x00

GetFreeVfsSpace_Request = 0x77
GetFreeVfsSpace_Index = 0x03
GetFreeVfsSpace_Value = 0x00
GetFreeVfsSpace_Length = 0x04

GetFileInfoBulkPackCount_Requset = 0x77
GetFileInfoBulkPackCount_Index = 0x04
GetFileInfoBulkPackCount_Value = 0x00
GetFileInfoBulkPackCount_Length = 0x04

GetStatusMkDir_Request = 0x77
GetStatusMkDir_Index = 0x05
GetStatusMkDir_Value = 0x00
GetStatusMkDir_Length = 0x01

GetStatusExistFile_Request = 0x77
GetStatusExistFile_Index = 0x07
GetStatusExistFile_Value = 0x00
GetStatusExistFile_Length = 0x01

//add by xxian and toby for FRM vendor command
Nand_Isp_Bulk_Out_Request   =  0xfd
Nand_Isp_Bulk_Out_Index     =  0xf7
Nand_Isp_Bulk_Out_Value     =  0x00
Nand_Isp_Bulk_Out_Length    =  0x00

NorTypeSelect_Request = 0x78
NorTypeSelect_Index = 0x0
NorTypeSelect_Value = 0x0
NorTypeSelect_Length = 0x4

NorISPDo_Request = 0x78
NorISPDo_Index = 0x1
NorISPDo_Value = 0x0
NorISPDo_Length = 0x0

NorChipIDTest_Request = 0x78
NorChipIDTest_Index = 0x2
NorChipIDTest_Value = 0x0
NorChipIDTest_Length = 0x0

NorChipErase_Request = 0x78
NorChipErase_Index = 0x3
NorChipErase_Value = 0x0
NorChipErase_Length = 0x0

NorSectorErase_Request = 0x78
NorSectorErase_Index = 0x4
NorSectorErase_Value = 0x0
NorSectorErase_Length = 0x8

NorByteProgram_Request = 0x78
NorByteProgram_Index = 0x5
NorByteProgram_Value = 0x0
NorByteProgram_Length = 12

//add by chenbin

GetStatusChangeDir_Request = 0x77
GetStatusChangeDir_Index = 0x06
GetStatusChangeDir_Value = 0x00
GetStatusChangeDir_Length = 0x01

CustomMode_Request = 0x78
CustomMode_Index = 0x14 //0x18   //don't know, may be wrong
CustomMode_Value = 0x00
CustomMode_Length = 0x4

CustomMethod_Request = 0x78
CustomMethod_Index = 0x16
CustomMethod_Value = 0x00
CustomMethod_Length = 0x4

CustomGpioId_Request = 0x78
CustomGpioId_Index = 0x17
CustomGpioId_Value = 0x00
CustomGpioId_Length = 0x4

CustomStatusSet_Request = 0x78
CustomStatusSet_Index = 0x18
CustomStatusSet_Value = 0x00
CustomStatusSet_Length = 0x4

StorageTypeSelect_Request = 0x78
StorageTypeSelect_Index = 0x6
StorageTypeSelect_Value = 0x0
StorageTypeSelect_Length = 0x8

NandDetect_Request = 0x78
NandDetect_Index = 0x7
NandDetect_Value = 0x0
NandDetect_Length = 0x0

NandRsvAllocate_Request = 0x78
NandRsvAllocate_Index = 0x8
NandRsvAllocate_Value = 0x0
NandRsvAllocate_Length = 16

NandRsvAFormat_Request = 0x78
NandRsvAFormat_Index = 0x9
NandRsvAFormat_Value = 0x0
NandRsvAFormat_Length = 0x0

NandRsvBFormat_Request = 0x78
NandRsvBFormat_Index = 0xa
NandRsvBFormat_Value = 0x0
NandRsvBFormat_Length = 0x0

NandLogicalFormat_Request = 0x78
NandLogicalFormat_Index = 0x0b
NandLogicalFormat_Value = 0x0
NandLogicalFormat_Length = 0x0

NandPhysicalFormat_Request = 0x78
NandPhysicalFormat_Index = 0x0c
NandPhysicalFormat_Value = 0x0
NandPhysicalFormat_Length = 0x0

NandTotalErase_Request = 0x78
NandTotalErase_Index = 0x0d
NandTotalErase_Value = 0x0
NandTotalErase_Length = 0x4

NandFWProgram_Request = 0x78
NandFWProgram_Index = 0x0e
NandFWProgram_Value = 0x0
NandFWProgram_Length = 0x8

NandFWProgram_0_Request = 0x78
NandFWProgram_0_Index = 0x0e
NandFWProgram_0_Value = 0x0
NandFWProgram_0_Length = 16   //max out length

CodeSizeSet_Request = 0x78
CodeSizeSet_Index = 0x0f
CodeSizeSet_Value = 0x0
CodeSizeSet_Length = 0x4

CpuReset_Request = 0x01
CpuReset_Index = 0x0
CpuReset_Value = 0x0
CpuReset_Length = 0x0

RAWCWrite_Request = 0x78    //same with NandFWProgram
RAWCWrite_Index = 0x11
RAWCWrite_Value = 0x0
RAWCWrite_Length = 0x08

RAWCWrite_0_Request = 0x78
RAWCWrite_0_Index = 0x11
RAWCWrite_0_Value = 0x0
RAWCWrite_0_Length = 0x10

NandRsvaHeaderSet_Request = 0x78
NandRsvaHeaderSet_Index = 0x12
NandRsvaHeaderSet_Value = 0x0
NandRsvaHeaderSet_Length = 0x0c

PowerOff_Request= 0x78
PowerOff_Index= 0x13
PowerOff_Value= 0x00
PowerOff_Length= 0x00

FRM_Start_Request = 0x78
FRM_Start_Index = 0x19
FRM_Start_Value = 0x00
FRM_Start_Length = 0x00

FRM_Complete_Request = 0x78
FRM_Complete_Index = 0x1a
FRM_Complete_Value = 0x00
FRM_Complete_Length = 0x00

FRM_Rsv_AllocSize_Set_Request = 0x78
FRM_Rsv_AllocSize_Set_Index = 0x1B
FRM_Rsv_AllocSize_Set_Value = 0x00
FRM_Rsv_AllocSize_Set_Length = 0x02

DramParameterWrite_Request = 0x78
DramParameterWrite_Index = 0x1C
DramParameterWrite_Value = 0x00
DramParameterWrite_Length = 0x00

BootMethod_Request = 0x70
BootMethod_Index = 0x0
BootMethod_Value = 0x0
BootMethod_Length = 0xb

DramAddrGet_Request = 0x79
DramAddrGet_Index = 0x1
DramAddrGet_Value = 0x0
DramAddrGet_Length = 0x8

CodeBufSizeGet_Request = 0x79
CodeBufSizeGet_Index = 0x2
CodeBufSizeGet_Value = 0x0
CodeBufSizeGet_Length = 0x8

NorFWRead_Request = 0x79
NorFWRead_Index = 0x3
NorFWRead_Value = 0x0
NorFWRead_Length = 0x8

NandFWRead_Request = 0x79   //get data from fw
NandFWRead_Index = 0x4
NandFWRead_Value = 0x0
NandFWRead_Length = 12

NandFWRead_0_Request = 0x79    //Set data to fw
NandFWRead_0_Index = 0x4
NandFWRead_0_Value = 0x0
NandFWRead_0_Length = 16        //data0 = 0~2

//ISPDebugStep = 6

//ISPCoreFileName = isp.bin
//ISPCheckFwFileName = fwchk.bin
//ISPCoreAddr = 0xA0100000    //default 0xac600000
//ISPNandType = 0
//ISPNandTotalErase = 1
//ISPNandRsvAllocate_par0 = 0x200000
//ISPNandRsvAllocate_par1 = 0x100000
//ISPNandRsvAllocate_par2 = 0x80000
//ISPNandRsvAllocate_par3 = 1
//ISPCheckConAddr = 0xa0200000   //default 0xac600000
//ISPCheckFwIdleWaitCnt = 1      //default 0 : no wait

//TestFRMFlag = 0
//TestFRM_Par0 = 0x36400          // fw total size
//TestFRM_Par1 = 0xAC182278       // addr
//TestFRM_Par2 = 0x8000           // buf size
//TestFRM_Par3 = 0


NandRsvaItemGet_Request = 0x79
NandRsvaItemGet_Index = 0x5
NandRsvaItemGet_Value = 0x0
NandRsvaItemGet_Length = 0x8

NandRsvaHeaderGet_Request = 0x79
NandRsvaHeaderGet_Index = 0x6
NandRsvaHeaderGet_Value = 0x0
NandRsvaHeaderGet_Length = 256	//0x8

NandInfoItemGet_Request = 0x79
NandInfoItemGet_Index = 0x7
NandInfoItemGet_Value = 0x0
NandInfoItemGet_Length = 0x8

NandBlockInfoGet_Request = 0x79
NandBlockInfoGet_Index = 0x0c
NandBlockInfoGet_Value = 0x0
NandBlockInfoGet_Length = 0x14

ISPVersionInfoGet_Request = 0x79
ISPVersionInfoGet_Index = 0x0d
ISPVersionInfoGet_Value = 0x0
ISPVersionInfoGet_Length = 0x14

ISPNandBadBlkTest_Request = 0x79
ISPNandBadBlkTest_Index = 0x0e
ISPNandBadBlkTest_Value = 0x0
ISPNandBadBlkTest_Length = 0x14

ISPNandBadBlkDataUpload_Request = 0x79
ISPNandBadBlkDataUpload_Index = 0x0f
ISPNandBadBlkDataUpload_Value = 0x0
ISPNandBadBlkDataUpload_Length = 256

ISPNandBadBlkTotalGet_Request = 0x79
ISPNandBadBlkTotalGet_Index = 0x10
ISPNandBadBlkTotalGet_Value = 0x0
ISPNandBadBlkTotalGet_Length = 0x10

NandInfoHeaderGet_Request = 0x79
NandInfoHeaderGet_Index = 0x8
NandInfoHeaderGet_Value = 0x0
NandInfoHeaderGet_Length = 256	//0x8

RAWCRead_Request = 0x79   //get data from fw
RAWCRead_Index = 0xb
RAWCRead_Value = 0x0
RAWCRead_Length = 12

RAWCRead_0_Request = 0x79    //Set data to fw
RAWCRead_0_Index = 0xb
RAWCRead_0_Value = 0x0
RAWCRead_0_Length = 16        //data0 = 0~2


//StatusGet_Request = 0x80
//StatusGet_Index = 0x0
//StatusGet_Value = 0x0
//StatusGet_Length = 0x4

//ErrorCodeGet_Request = 0x80
//ErrorCodeGet_Index = 0x1
//ErrorCodeGet_Value = 0x0
//ErrorCodeGet_Length = 0x8

//ClearErrorCode_Request = 0x80
//ClearErrorCode_Index = 0x2
//ClearErrorCode_Value = 0x0
//ClearErrorCode_Length = 0x0

FRM_BulkIn_Request = 0xfd
FRM_BulkIn_Index = 0x04f4
FRM_BulkIn_Value = 0x0
FRM_BulkIn_Length = 0x8

FRM_BulkOut_Request = 0xfd
FRM_BulkOut_Index = 0x04f5
FRM_BulkOut_Value = 0x0
FRM_BulkOut_Length = 0x8

SetSpecialData_Request    =  0x63
SetSpecialData_Index      =  0x00
SetSpecialData_Value      =  0x00
SetSpecialData_Length     =  0x01

FRMDnloadRunISP_Request          =   0xfd
FRMDnloadRunISP_Index            =   0x04f7
FRMDnloadRunISP_Value            =   0x00
FRMDnloadRunISP_Length           =   0x0c


[BadPixelTest]
ScreenWidth     =   1600
ScreenHeight        =   1200
WhitePattenLuminance    =   128
BlackPattenLuminance    =   30
DiffLuminance       =   100
DACNumber       =   10
ImageType       =   3
WhiteThresholdR     =   100
WhiteThresholdGr    =   100
WhiteThresholdB     =   100
WhiteThresholdGb    =   100
BlackThresholdR     =   100
BlackThresholdGr    =   100
BlackThresholdB     =   100
BlackThresholdGb    =   100
BadMaxNumber        =   256
XOffset         =   0
YOffset         =   0
XStart          =   0
YStart          =   0
XEnd            =   1600
YEnd            =   1200
DebugFlag       =   TRUE
CheckLuminance      =   FALSE
CheckContinue       =   1
Check3x3Edge        =   1
LogFileName     =   log.txt
GainValue1	=	63
ShutterValue1	=	200
GainValue2	=	63
ShutterValue2	=	200
SubsampleNumber     =   20000
SearchNumber        =   512
WhiteSearchMethod	=	0
WhiteSearchMethod_1	=	3
WhiteSearchMethod_2	=	10
BlockWidth     =   16
BlockHeight    =   16	;same with BlockWidth

[MASS]
DownBadPixel=1   ;0 :No Down  1: Down BadPixel.bin to Rom
BadPixelFlag=1   ;0 :disable  1: enable
TestByBlock=1   ;0 :disable  1: enable
 
SubSampleFlag=0   ;0 :disable  1: enable
MoToFlag=0   ;1 :using MoTo Test

FocusFlag=1   ;0 :disable  1: enable

SdramFlag=1   ;0 :disable  1: enable
NFlashFlag=0   ;0 :disable  1: enable
BatteryFlag=0   ;0 :disable  1: enable

ButtonFlag=0   ;0 :disable  1: enable
SnapFlag=1   ;0 :disable  1: enable
BulkFlag=1   ;0 :disable  1: enable

SysInfFlag=0   ;0 :disable  1: enable
AETableFlag=0   ;0 :disable  1: enable
