📄 asc0.lst
字号:
C166 COMPILER V6.04, ASC0 04/06/2009 22:15:29 PAGE 1
C166 COMPILER V6.04, COMPILATION OF MODULE ASC0
OBJECT MODULE PLACED IN ASC0.OBJ
COMPILER INVOKED BY: C:\Keil\C166\BIN\C166.EXE ASC0.C MODV2 BROWSE MODV2 DEBUG
stmt lvl source
1 //****************************************************************************
2 // @Module Asynchronous/Synchronous Serial Interface 0 (ASC0)
3 // @Filename ASC0.C
4 // @Project can_configure.dav
5 //----------------------------------------------------------------------------
6 // @Controller Infineon XC164CS-16F20
7 //
8 // @Compiler Keil
9 //
10 // @Codegenerator 2.8
11 //
12 // @Description This file contains functions that use the ASC0 module.
13 //
14 //----------------------------------------------------------------------------
15 // @Date 2009-4-4 17:03:46
16 //
17 //****************************************************************************
18
19 // USER CODE BEGIN (ASC0_General,1)
20
21 // USER CODE END
22
23
24
25 //****************************************************************************
26 // @Project Includes
27 //****************************************************************************
28
29 #include "MAIN.H"
30
31 // USER CODE BEGIN (ASC0_General,2)
32
33 // USER CODE END
34
35
36 //****************************************************************************
37 // @Macros
38 //****************************************************************************
39
40 // USER CODE BEGIN (ASC0_General,3)
41
42 // USER CODE END
43
44
45 //****************************************************************************
46 // @Defines
47 //****************************************************************************
48
49 // USER CODE BEGIN (ASC0_General,4)
50
51 // USER CODE END
52
53
54 //****************************************************************************
55 // @Typedefs
C166 COMPILER V6.04, ASC0 04/06/2009 22:15:29 PAGE 2
56 //****************************************************************************
57
58 // USER CODE BEGIN (ASC0_General,5)
59
60 // USER CODE END
61
62
63 //****************************************************************************
64 // @Imported Global Variables
65 //****************************************************************************
66
67 // USER CODE BEGIN (ASC0_General,6)
68
69 // USER CODE END
70
71
72 //****************************************************************************
73 // @Global Variables
74 //****************************************************************************
75
76 // USER CODE BEGIN (ASC0_General,7)
77
78 // USER CODE END
79
80
81 //****************************************************************************
82 // @External Prototypes
83 //****************************************************************************
84
85 // USER CODE BEGIN (ASC0_General,8)
86
87 // USER CODE END
88
89
90 //****************************************************************************
91 // @Prototypes Of Local Functions
92 //****************************************************************************
93
94 // USER CODE BEGIN (ASC0_General,9)
95
96 // USER CODE END
97
98
99 //****************************************************************************
100 // @Function void ASC0_vInit(void)
101 //
102 //----------------------------------------------------------------------------
103 // @Description This is the initialization function of the ASC0 function
104 // library. It is assumed that the SFRs used by this library
105 // are in its reset state.
106 //
107 //----------------------------------------------------------------------------
108 // @Returnvalue None
109 //
110 //----------------------------------------------------------------------------
111 // @Parameters None
112 //
113 //----------------------------------------------------------------------------
114 // @Date 2009-4-4
115 //
116 //****************************************************************************
117
C166 COMPILER V6.04, ASC0 04/06/2009 22:15:29 PAGE 3
118 // USER CODE BEGIN (Init,1)
119
120 // USER CODE END
121
122 void ASC0_vInit(void)
123 {
124 1 // USER CODE BEGIN (Init,2)
125 1
126 1 // USER CODE END
127 1
128 1 /// -----------------------------------------------------------------------
129 1 /// Configuration of the ASC0 Baudrate Generator:
130 1 /// -----------------------------------------------------------------------
131 1 /// - additionally reduce serial clock to 2
132 1 /// - required baud rate = 19.200 kbaud
133 1 /// - real baud rate = 18.939 kbaud
134 1 /// - deviation = -1.357 %
135 1
136 1 ASC0_BG = 0x0020; // load ASC0 baud rate time reload register
137 1
138 1 /// -----------------------------------------------------------------------
139 1 /// Configuration of the ASC0 Operation Mode:
140 1 /// -----------------------------------------------------------------------
141 1 /// - 8-bit data asychronous operation with one stop bit
142 1 /// - receiver is enabled
143 1
144 1 ASC0_CON = 0x0011; // load ASC0 control register
145 1
146 1 /// -----------------------------------------------------------------------
147 1 /// FIFO Configuration:
148 1 /// -----------------------------------------------------------------------
149 1 /// - receive FIFO is disabled
150 1 /// - transmit FIFO is disabled
151 1
152 1 ASC0_RXFCON = 0x0102; // load ASC0 receive FIFO control register
153 1 ASC0_TXFCON = 0x0102; // load ASC0 transmit FIFO control register
154 1
155 1 /// -----------------------------------------------------------------------
156 1 /// Configuration of the used ASC0 Port Pins:
157 1 /// -----------------------------------------------------------------------
158 1 /// - P3.10 is used for ASC0 Transmit Data Output (TxDA0)
159 1 /// - P3.11 is used for ASC0 Receive data Input (RxDA0)
160 1
161 1 ALTSEL0P3 |= 0x0400; // select alternate output function
162 1 P3 = (P3 & ~(uword)0x0400) | 0x0400; //set data register
163 1 DP3 = (DP3 & ~(uword)0x0400) | 0x0400; //set direction register
164 1
165 1 /// -----------------------------------------------------------------------
166 1 /// Configuration of the used ASC0 Interrupts:
167 1 /// -----------------------------------------------------------------------
168 1 /// Rx service request node configuration:
169 1 /// - Rx interrupt priority level (ILVL) = 12
170 1 /// - Rx interrupt group level (GLVL) = 1
171 1 /// - Rx group priority extension (GPX) = 0
172 1
173 1 ASC0_RIC = 0x0071;
174 1
175 1
176 1 // -----------------------------------------------------------------------
177 1 // Default Settings for Service Request Flags:
178 1 // -----------------------------------------------------------------------
179 1 ASC0_TIC_IR = 1; // indicates that the transmit register is
C166 COMPILER V6.04, ASC0 04/06/2009 22:15:29 PAGE 4
180 1 // empty
181 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -