-
Notifications
You must be signed in to change notification settings - Fork 48
/
dpcmd.h
executable file
·88 lines (80 loc) · 1.9 KB
/
dpcmd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#ifndef _DPCMD_H
#define _DPCMD_H
#include <stdbool.h>
enum ErrorCode {
EXCODE_PASS,
EXCODE_FAIL_USB,
EXCODE_FAIL_ERASE,
EXCODE_FAIL_PROG,
EXCODE_FAIL_VERIFY,
EXCODE_FAIL_LOADFILEWITHVERIFY,
EXCODE_FAIL_READ,
EXCODE_FAIL_BLANK, // 7
EXCODE_FAIL_BATCH,
EXCODE_FAIL_CHKSUM,
EXCODE_FAIL_IDENTIFY,
EXCODE_FAIL_UPDATE_FW,
EXCODE_FAIL_OTHERS,
};
enum { // value dedicated by the spec
STARTUP_APPLI_SF_1 = 0,
STARTUP_APPLI_CARD = 1,
STARTUP_APPLI_SF_2 = 2,
STARTUP_APPLI_SF_SKT = 3,
STARTUP_SPECIFY_LATER = 0xFE,
STARTUP_PREVIOUS = 0xFF
};
enum {
clk_24M = 0x00,
clk_8M = 0x01,
clk_12M = 0x02,
clk_3M = 0x03,
clk_2180K = 0x04,
clk_1500K = 0x05,
clk_750K = 0x06,
clk_375K = 0x07,
};
int Sequence();
void cli_classic_usage(bool IsShowExample);
bool InitProject(void);
void CloseProject(void);
bool DetectChip(void);
void SetVpp(int Index);
void SetSPIIOMode(int Index);
void SetSPIClock(int Index);
void SetVcc(int Index);
int SetVppVoltage(int vol,int Index);
int do_loadFile(void);
int do_loadFileWithVerify(void);
void BlinkProgrammer(void);
void ListSFSerialID(void);
void do_BlankCheck(void);
void do_Erase(void);
void do_Program(void);
void do_Read(void);
void do_DisplayOrSave(void);
void SaveProgContextChanges(void);
void do_Auto(void);
void do_Verify(void);
void do_ReadSR(int Index);
void do_RawInstructions(int Index);
void do_RawInstructinos_2(int outDLen, char* para, int Index);
void RawInstructions(int Index);
bool BlankCheck(void);
bool Erase(void);
bool Program(void);
bool Read(void);
bool Auto(void);
bool Verify(void);
bool LoadFileWithVerify(void);
bool CalChecksum(void);
int Handler();
bool ListTypes(void);
bool CheckProgrammerInfo(void);
void GetLogPath(char* path);
bool Wait(const char* strOK, const char* strFail);
void ExitProgram(void);
int FirmwareUpdate();
void sin_handler(int sig);
#endif