1 #ifndef STLINK_HW_H_INCLUDED
2 # define STLINK_HW_H_INCLUDED
4 // STLINK_DEBUG_RESETSYS, etc:
6 #define STLINK_FALSE 0x81
7 #define STLINK_CORE_RUNNING 0x80
8 #define STLINK_CORE_HALTED 0x81
9 #define STLINK_CORE_STAT_UNKNOWN -1
11 #define STLINK_GET_VERSION 0xf1
12 #define STLINK_GET_CURRENT_MODE 0xf5
14 #define STLINK_DEBUG_COMMAND 0xF2
15 #define STLINK_DFU_COMMAND 0xF3
16 #define STLINK_DFU_EXIT 0x07
18 // STLINK_GET_CURRENT_MODE
19 #define STLINK_DEV_DFU_MODE 0x00
20 #define STLINK_DEV_MASS_MODE 0x01
21 #define STLINK_DEV_DEBUG_MODE 0x02
22 #define STLINK_DEV_UNKNOWN_MODE -1
25 #define STLINK_DEBUG_ENTER 0x20
26 #define STLINK_DEBUG_EXIT 0x21
27 #define STLINK_DEBUG_READCOREID 0x22
28 #define STLINK_DEBUG_GETSTATUS 0x01
29 #define STLINK_DEBUG_FORCEDEBUG 0x02
30 #define STLINK_DEBUG_RESETSYS 0x03
31 #define STLINK_DEBUG_READALLREGS 0x04
32 #define STLINK_DEBUG_READREG 0x05
33 #define STLINK_DEBUG_WRITEREG 0x06
34 #define STLINK_DEBUG_READMEM_32BIT 0x07
35 #define STLINK_DEBUG_WRITEMEM_32BIT 0x08
36 #define STLINK_DEBUG_RUNCORE 0x09
37 #define STLINK_DEBUG_STEPCORE 0x0a
38 #define STLINK_DEBUG_SETFP 0x0b
39 #define STLINK_DEBUG_WRITEMEM_8BIT 0x0d
40 #define STLINK_DEBUG_CLEARFP 0x0e
41 #define STLINK_DEBUG_WRITEDEBUGREG 0x0f
42 #define STLINK_DEBUG_ENTER_SWD 0xa3
43 #define STLINK_DEBUG_ENTER_JTAG 0x00
45 #endif /* STLINK_HW_H_INCLUDED */