📄 probe_rs232.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 26/Dec/2008 18:22:04 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communicatio #
# n\Generic\RS-232\Source\probe_rs232.c #
# Command line = F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communicatio #
# n\Generic\RS-232\Source\probe_rs232.c -lCN #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\List\ -o #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll --no_inline #
# --no_tbaa --no_scheduling --debug --cpu_mode thumb #
# --endian little --cpu cortex-M3 --stack_align 4 -e #
# --fpu None --dlib_config "E:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 #
# Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ #
# ST\STM3210E-EVAL\IAR\OS-Probe\..\BSP\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\CPU\ST\STM32\inc\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-CPU\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-CPU\ARM-Cortex-M3\IAR #
# \ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E- #
# EVAL\IAR\OS-Probe\..\..\..\..\..\uC-LCD\Source\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-LIB\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uCOS-II\Ports\ARM-Cortex #
# -M3\Generic\IAR\ -I F:\PROJECT\STM32_UCOSII\EvalBoar #
# ds\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uCOS #
# -II\Source\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST #
# \STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uC-Probe\ #
# Target\Communication\Generic\RS-232\Source\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
# ation\Generic\RS-232\Ports\ST\STM32\ -I #
# F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
# ation\Generic\Source\ -I F:\PROJECT\STM32_UCOSII\Eva #
# lBoards\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\.. #
# \uC-Probe\Target\Plugins\uCOS-II\ -I "E:\Program #
# Files\IAR Systems\Embedded Workbench 4.0 #
# Kickstart\arm\INC\" #
# List file = F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\List\probe_rs232.lst #
# Object file = F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
# IAR\OS-Probe\Flash\Obj\probe_rs232.r79 #
# #
# #
##############################################################################
F:\PROJECT\STM32_UCOSII\uC-Probe\Target\Communication\Generic\RS-232\Source\probe_rs232.c
1 /*
2 *********************************************************************************************************
3 * uC/Probe Communication
4 *
5 * (c) Copyright 2007; Micrium, Inc.; Weston, FL
6 *
7 * All rights reserved. Protected by international copyright laws.
8 * Knowledge of the source code may NOT be used to develop a similar product.
9 * Please help us continue to provide the Embedded community with the finest
10 * software available. Your honesty is greatly appreciated.
11 *********************************************************************************************************
12 */
13
14 /*
15 *********************************************************************************************************
16 *
17 * uC/Probe
18 *
19 * Communication: RS-232
20 *
21 * Filename : probe_rs232.c
22 * Version : V2.00
23 * Programmer(s) : BAN
24 * Note(s) : (1) The abbreviations RX and TX refer to communication from the target's perspective.
25 *
26 * (2) The abbreviations RD and WR refer to reading data from the target memory and
27 * writing data to the target memory, respectively.
28 *********************************************************************************************************
29 */
30
31 /*
32 *********************************************************************************************************
33 * INCLUDE FILES
34 *********************************************************************************************************
35 */
36
37 #define PROBE_RS232_MODULE
38 #include <probe_com.h>
39 #include <probe_rs232.h>
\ In segment DATA_Z, align 4, align-sorted
40
41 #if (PROBE_COM_METHOD_RS232 == DEF_ENABLED)
42
43 /*
44 *********************************************************************************************************
45 * LOCAL DEFINES
46 *********************************************************************************************************
47 */
48
49 /*
50 *********************************************************************************************************
51 * RS-232 PACKET FORMAT
52 *
53 * Note(s): (1) All packets include the following parts:
54 *
55 * (A) 4 1-byte start delimiters, forming the ASCII representation of "uCPr". These
56 * are the constants PROBE_RS232_PROTOCOL_RX_SD0-PROBE_RS232_PROTOCOL_?X_SD4;
57 * (B) 1 2-byte length, the length of the data segment;
58 * (C) 1 2-byte padding, unused;
59 * (D) n bytes of data; and
60 * (E) 1 1-byte checksum; and
61 * (F) 1 1-byte end delimiter, the character '/', which is the constant PROBE_RS232_PROTOCOL_?X_ED.
62 *
63 * +-------------------+-------------------+
64 * | 'u' | 'C' | 'P' | 'r' |
65 * +-------------------+-------------------+
66 * | Length | Padding |
67 * +-------------------+-------------------+
68 * | Data | The data segment does not need to end on
69 * | . | a four-byte boundary, as might be inferred
70 * | . | from this diagram.
71 * | . |
72 * +-------------------+-------------------+
73 * | Checksum| '/' |
74 * +-------------------+
75 *********************************************************************************************************
76 */
77
78 /* ------------- INBOUND PACKET DELIMITERS ------------ */
79 #define PROBE_RS232_PROTOCOL_RX_SD0 0x75 /* Start delimiters. */
80 #define PROBE_RS232_PROTOCOL_RX_SD1 0x43
81 #define PROBE_RS232_PROTOCOL_RX_SD2 0x50
82 #define PROBE_RS232_PROTOCOL_RX_SD3 0x72
83 #define PROBE_RS232_PROTOCOL_RX_ED 0x2F /* End delimiter. */
84
85 /* ------------ OUTBOUND PACKET DELIMITERS ------------ */
86 #define PROBE_RS232_PROTOCOL_TX_SD0 0x75 /* Start delimiters. */
87 #define PROBE_RS232_PROTOCOL_TX_SD1 0x43
88 #define PROBE_RS232_PROTOCOL_TX_SD2 0x50
89 #define PROBE_RS232_PROTOCOL_TX_SD3 0x72
90 #define PROBE_RS232_PROTOCOL_TX_ED 0x2F /* End delimiter. */
91
92 /* ----------- RECEIVE STATE MACHINE STATES ----------- */
93 #define PROBE_RS232_RX_STATE_SD0 0 /* Waiting for start first start delimiter (SD0). */
94 #define PROBE_RS232_RX_STATE_SD1 1 /* Waiting for start second start delimiter (SD1). */
95 #define PROBE_RS232_RX_STATE_SD2 2 /* Waiting for start third start delimiter (SD2). */
96 #define PROBE_RS232_RX_STATE_SD3 3 /* Waiting for start fourth start delimiter (SD3). */
97 #define PROBE_RS232_RX_STATE_LEN1 4 /* Waiting for length, first byte. */
98 #define PROBE_RS232_RX_STATE_LEN2 5 /* Waiting for length, second byte. */
99 #define PROBE_RS232_RX_STATE_PAD1 6 /* Waiting for padding, first byte. */
100 #define PROBE_RS232_RX_STATE_PAD2 7 /* Waiting for padding, second byte. */
101 #define PROBE_RS232_RX_STATE_DATA 8 /* Waiting for data. */
102 #define PROBE_RS232_RX_STATE_CHKSUM 9 /* Waiting for checksum. */
103 #define PROBE_RS232_RX_STATE_ED 10 /* Waiting for end delimiter. */
104
105 /* ---------- TRANSMIT STATE MACHINE STATES ----------- */
106 #define PROBE_RS232_TX_STATE_SD0 0 /* Waiting to send start first start delim. (SD0). */
107 #define PROBE_RS232_TX_STATE_SD1 1 /* Waiting to send start second start delim. (SD1). */
108 #define PROBE_RS232_TX_STATE_SD2 2 /* Waiting to send start third start delim. (SD2). */
109 #define PROBE_RS232_TX_STATE_SD3 3 /* Waiting to send start fourth start delim. (SD3). */
110 #define PROBE_RS232_TX_STATE_LEN1 4 /* Waiting to send length, first byte. */
111 #define PROBE_RS232_TX_STATE_LEN2 5 /* Waiting to send length, second byte. */
112 #define PROBE_RS232_TX_STATE_PAD1 6 /* Waiting to send padding, first byte. */
113 #define PROBE_RS232_TX_STATE_PAD2 7 /* Waiting to send padding, second byte. */
114 #define PROBE_RS232_TX_STATE_DATA 8 /* Waiting to send data. */
115 #define PROBE_RS232_TX_STATE_CHKSUM 9 /* Waiting to send checksum. */
116 #define PROBE_RS232_TX_STATE_ED 10 /* Waiting to send end delimiter. */
117
118 #define PROBE_RS232_USE_CHECKSUM DEF_FALSE /* DO NOT CHANGE */
119
120 /*
121 *********************************************************************************************************
122 * LOCAL CONSTANTS
123 *********************************************************************************************************
124 */
125
126
127 /*
128 *********************************************************************************************************
129 * LOCAL DATA TYPES
130 *********************************************************************************************************
131 */
132
133
134 /*
135 *********************************************************************************************************
136 * LOCAL TABLES
137 *********************************************************************************************************
138 */
139
140
141 /*
142 *********************************************************************************************************
143 * LOCAL GLOBAL VARIABLES
144 *********************************************************************************************************
145 */
146
147 /* ---------------- RX STATE VARIABLES ---------------- */
148 static CPU_INT08U ProbeRS232_RxState; /* Current state of RX state machine. */
\ ProbeRS232_RxState:
\ 00000000 DS8 1
\ 00000001 DS8 1
\ 00000002 DS8 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -