Rev 195 | Rev 308 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 196 | ||
---|---|---|---|
Line 84... | Line 84... | ||
84 | /*Configure UART2_Rx pin GPIO5.2*/ |
84 | /*Configure UART2_Rx pin GPIO5.2*/ |
85 | GPIO_StructInit(&GPIO_InitStructure); |
85 | GPIO_StructInit(&GPIO_InitStructure); |
86 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
86 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
87 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
87 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
88 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
88 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
89 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable; |
89 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable; |
90 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; // UART2_RxD |
90 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; // UART2_RxD |
91 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
91 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
Line 92... | Line 92... | ||
92 | 92 | ||
93 | SCU_APBPeriphClockConfig(__GPIO3, ENABLE); // Enable the GPIO3 Clock |
93 | SCU_APBPeriphClockConfig(__GPIO3, ENABLE); // Enable the GPIO3 Clock |
Line 151... | Line 151... | ||
151 | // set port pin 5.2 (serial data from FC) to input and disconnect from IP |
151 | // set port pin 5.2 (serial data from FC) to input and disconnect from IP |
152 | GPIO_StructInit(&GPIO_InitStructure); |
152 | GPIO_StructInit(&GPIO_InitStructure); |
153 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
153 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
154 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
154 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
155 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
155 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
156 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
156 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
157 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
157 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
158 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
158 | GPIO_Init(GPIO5, &GPIO_InitStructure); |
Line 159... | Line 159... | ||
159 | 159 | ||
160 | SCU_APBPeriphClockConfig(__GPIO3, ENABLE); |
160 | SCU_APBPeriphClockConfig(__GPIO3, ENABLE); |
161 | // set port pin 3.0 (serial data to FC) to input and disconnect from IP |
161 | // set port pin 3.0 (serial data to FC) to input and disconnect from IP |
162 | GPIO_StructInit(&GPIO_InitStructure); |
162 | GPIO_StructInit(&GPIO_InitStructure); |
163 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
163 | GPIO_InitStructure.GPIO_Direction = GPIO_PinInput; |
164 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
164 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
165 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
165 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
166 | GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Disable; |
166 | GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable; |
167 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
167 | GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
Line 168... | Line 168... | ||
168 | GPIO_Init(GPIO3, &GPIO_InitStructure); |
168 | GPIO_Init(GPIO3, &GPIO_InitStructure); |
169 | 169 |