Rev 195 | Rev 245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 196 | ||
---|---|---|---|
Line 110... | Line 110... | ||
110 | // set port pin 5.1 (serial data from compass) to input and disconnect from IP |
110 | // set port pin 5.1 (serial data from compass) to input and disconnect from IP |
111 | GPIO_StructInit(&GPIO_InitStructure); |
111 | GPIO_StructInit(&GPIO_InitStructure); |
112 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
112 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
113 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; |
113 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; |
114 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
114 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
115 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
115 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
116 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
116 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
117 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
117 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
118 | // set port pin 5.0 (serial data to compass) to input |
118 | // set port pin 5.0 (serial data to compass) to input |
119 | GPIO_StructInit(&GPIO_InitStructure); |
119 | GPIO_StructInit(&GPIO_InitStructure); |
120 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
120 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
121 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
121 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
122 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
122 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
123 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
123 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
124 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
124 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
125 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
125 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
126 | // map UART0 to GPS |
126 | // map UART0 to GPS |
127 | // set port pin 6.6 (serial data from gps) to input and connect to IP |
127 | // set port pin 6.6 (serial data from gps) to input and connect to IP |
128 | GPIO_StructInit(&GPIO_InitStructure); |
128 | GPIO_StructInit(&GPIO_InitStructure); |
129 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
129 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
130 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; |
130 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; |
131 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
131 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
132 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
132 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
133 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; //UART0_RxD |
133 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; //UART0_RxD |
134 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
134 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
135 | // set port pin 6.7 (serial data to gps) to output |
135 | // set port pin 6.7 (serial data to gps) to output |
136 | GPIO_StructInit(&GPIO_InitStructure); |
136 | GPIO_StructInit(&GPIO_InitStructure); |
137 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
137 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
138 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; |
138 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; |
139 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
139 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
140 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
140 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
141 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3; //UART0_TX |
141 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3; //UART0_TX |
142 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
142 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
Line 143... | Line 143... | ||
143 | 143 | ||
144 | UART0_Muxer = UART0_MKGPS; |
144 | UART0_Muxer = UART0_MKGPS; |
Line 158... | Line 158... | ||
158 | // set port pin 6.6 (serial data from gps) to input and disconnect from IP |
158 | // set port pin 6.6 (serial data from gps) to input and disconnect from IP |
159 | GPIO_StructInit(&GPIO_InitStructure); |
159 | GPIO_StructInit(&GPIO_InitStructure); |
160 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
160 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
161 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; |
161 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6; |
162 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
162 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
163 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
163 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
164 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
164 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
165 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
165 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
166 | // set port pin 6.7 (serial data to gps) to input |
166 | // set port pin 6.7 (serial data to gps) to input |
167 | GPIO_StructInit(&GPIO_InitStructure); |
167 | GPIO_StructInit(&GPIO_InitStructure); |
168 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
168 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
169 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; |
169 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; |
170 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
170 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
171 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
171 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
172 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
172 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
173 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
173 | GPIO_Init(GPIO6, &GPIO_InitStructure); |
Line 174... | Line 174... | ||
174 | 174 | ||
175 | // map UART0 to Compass |
175 | // map UART0 to Compass |
176 | // set port pin 5.1 (serial data from compass) to input and connect to IP |
176 | // set port pin 5.1 (serial data from compass) to input and connect to IP |
177 | GPIO_StructInit(&GPIO_InitStructure); |
177 | GPIO_StructInit(&GPIO_InitStructure); |
178 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
178 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
179 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; |
179 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; |
180 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
180 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; |
181 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
181 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
182 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; //UART0_RxD |
182 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; //UART0_RxD |
183 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
183 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
184 | // set port pin 5.0 (serial data to compass) to output |
184 | // set port pin 5.0 (serial data to compass) to output |
185 | GPIO_StructInit(&GPIO_InitStructure); |
185 | GPIO_StructInit(&GPIO_InitStructure); |
186 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
186 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
187 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
187 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
188 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
188 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
189 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
189 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
190 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3; //UART0_TX |
190 | GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3; //UART0_TX |
Line 191... | Line 191... | ||
191 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
191 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
192 | 192 |