ESP8266
command.h
1 //**** ATMEL AVR - A P P L I C A T I O N N O T E ************************
2 //*
3 //* Title: AVR061 - STK500 Communication Protocol
4 //* Filename: command.h
5 //* Version: 1.0
6 //* Last updated: 09.09.2002
7 //*
8 //* Support E-mail: avr@atmel.com
9 //*
10 //**************************************************************************
11 
12 // *****************[ STK Message constants ]***************************
13 
14 #define STK_SIGN_ON_MESSAGE "AVR STK" // Sign on string for Cmnd_STK_GET_SIGN_ON
15 
16 // *****************[ STK Response constants ]***************************
17 
18 #define Resp_STK_OK 0x10 // ' '
19 #define Resp_STK_FAILED 0x11 // ' '
20 #define Resp_STK_UNKNOWN 0x12 // ' '
21 #define Resp_STK_NODEVICE 0x13 // ' '
22 #define Resp_STK_INSYNC 0x14 // ' '
23 #define Resp_STK_NOSYNC 0x15 // ' '
24 
25 #define Resp_ADC_CHANNEL_ERROR 0x16 // ' '
26 #define Resp_ADC_MEASURE_OK 0x17 // ' '
27 #define Resp_PWM_CHANNEL_ERROR 0x18 // ' '
28 #define Resp_PWM_ADJUST_OK 0x19 // ' '
29 
30 // *****************[ STK Special constants ]***************************
31 
32 #define Sync_CRC_EOP 0x20 // 'SPACE'
33 
34 // *****************[ STK Command constants ]***************************
35 
36 #define Cmnd_STK_GET_SYNC 0x30 // ' '
37 #define Cmnd_STK_GET_SIGN_ON 0x31 // ' '
38 #define Cmnd_STK_RESET 0x32 // ' '
39 #define Cmnd_STK_SINGLE_CLOCK 0x33 // ' '
40 #define Cmnd_STK_STORE_PARAMETERS 0x34 // ' '
41 
42 #define Cmnd_STK_SET_PARAMETER 0x40 // ' '
43 #define Cmnd_STK_GET_PARAMETER 0x41 // ' '
44 #define Cmnd_STK_SET_DEVICE 0x42 // ' '
45 #define Cmnd_STK_GET_DEVICE 0x43 // ' '
46 #define Cmnd_STK_GET_STATUS 0x44 // ' '
47 #define Cmnd_STK_SET_DEVICE_EXT 0x45 // ' '
48 
49 #define Cmnd_STK_ENTER_PROGMODE 0x50 // ' '
50 #define Cmnd_STK_LEAVE_PROGMODE 0x51 // ' '
51 #define Cmnd_STK_CHIP_ERASE 0x52 // ' '
52 #define Cmnd_STK_CHECK_AUTOINC 0x53 // ' '
53 #define Cmnd_STK_CHECK_DEVICE 0x54 // ' '
54 #define Cmnd_STK_LOAD_ADDRESS 0x55 // ' '
55 #define Cmnd_STK_UNIVERSAL 0x56 // ' '
56 
57 #define Cmnd_STK_PROG_FLASH 0x60 // ' '
58 #define Cmnd_STK_PROG_DATA 0x61 // ' '
59 #define Cmnd_STK_PROG_FUSE 0x62 // ' '
60 #define Cmnd_STK_PROG_LOCK 0x63 // ' '
61 #define Cmnd_STK_PROG_PAGE 0x64 // ' '
62 #define Cmnd_STK_PROG_FUSE_EXT 0x65 // ' '
63 
64 #define Cmnd_STK_READ_FLASH 0x70 // ' '
65 #define Cmnd_STK_READ_DATA 0x71 // ' '
66 #define Cmnd_STK_READ_FUSE 0x72 // ' '
67 #define Cmnd_STK_READ_LOCK 0x73 // ' '
68 #define Cmnd_STK_READ_PAGE 0x74 // ' '
69 #define Cmnd_STK_READ_SIGN 0x75 // ' '
70 #define Cmnd_STK_READ_OSCCAL 0x76 // ' '
71 #define Cmnd_STK_READ_FUSE_EXT 0x77 // ' '
72 #define Cmnd_STK_READ_OSCCAL_EXT 0x78 // ' '
73 
74 // *****************[ STK Parameter constants ]***************************
75 
76 #define Parm_STK_HW_VER 0x80 // ' ' - R
77 #define Parm_STK_SW_MAJOR 0x81 // ' ' - R
78 #define Parm_STK_SW_MINOR 0x82 // ' ' - R
79 #define Parm_STK_LEDS 0x83 // ' ' - R/W
80 #define Parm_STK_VTARGET 0x84 // ' ' - R/W
81 #define Parm_STK_VADJUST 0x85 // ' ' - R/W
82 #define Parm_STK_OSC_PSCALE 0x86 // ' ' - R/W
83 #define Parm_STK_OSC_CMATCH 0x87 // ' ' - R/W
84 #define Parm_STK_RESET_DURATION 0x88 // ' ' - R/W
85 #define Parm_STK_SCK_DURATION 0x89 // ' ' - R/W
86 
87 #define Parm_STK_BUFSIZEL 0x90 // ' ' - R/W, Range {0..255}
88 #define Parm_STK_BUFSIZEH 0x91 // ' ' - R/W, Range {0..255}
89 #define Parm_STK_DEVICE 0x92 // ' ' - R/W, Range {0..255}
90 #define Parm_STK_PROGMODE 0x93 // ' ' - 'P' or 'S'
91 #define Parm_STK_PARAMODE 0x94 // ' ' - TRUE or FALSE
92 #define Parm_STK_POLLING 0x95 // ' ' - TRUE or FALSE
93 #define Parm_STK_SELFTIMED 0x96 // ' ' - TRUE or FALSE
94 
95 
96 // *****************[ STK status bit definitions ]***************************
97 
98 #define Stat_STK_INSYNC 0x01 // INSYNC status bit, '1' - INSYNC
99 #define Stat_STK_PROGMODE 0x02 // Programming mode, '1' - PROGMODE
100 #define Stat_STK_STANDALONE 0x04 // Standalone mode, '1' - SM mode
101 #define Stat_STK_RESET 0x08 // RESET button, '1' - Pushed
102 #define Stat_STK_PROGRAM 0x10 // Program button, ' 1' - Pushed
103 #define Stat_STK_LEDG 0x20 // Green LED status, '1' - Lit
104 #define Stat_STK_LEDR 0x40 // Red LED status, '1' - Lit
105 #define Stat_STK_LEDBLINK 0x80 // LED blink ON/OFF, '1' - Blink
106 
107 
108 // *****************************[ End Of COMMAND.H ]**************************