Page 983 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 983
void delay_us(vu32 del) {//Delay
for(;del != 0 ; del--);
}
void GPIO_Configuration(){//GPIO설정
GPIO_InitTypeDef GPIO_InitStructure;
/*LED*/
//PC 0:시작 1:wifi값 2:내부센서
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/*LED*/
/*모터*/
//PB 0,1:바퀴(A) 2,3:바퀴(B) 4,5:바퀴(C) 6:A Enable 7:B Enable 8:C Enable
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 |
GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_PinRemapConfig (GPIO_Remap_SWJ_JTAGDisable, ENABLE);
/*모터*/
//NDSocket
/*USART*/
//PA10,PA9
//RX USART1
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
//TX USART1
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- 976 -