GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;//设置PA4
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //设置为推挽输出模式
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //最大输出速率设为50MHz
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_ResetBits(GPIOA,GPIO_Pin_4); //PA4清0
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5|GPIO_Pin_6; //设置PA5,PA6
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; //设置为浮空输入模式
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_SetBits(GPIOA,GPIO_Pin_5); //PA5置位
GPIO_SetBits(GPIOA,GPIO_Pin_6); //PA6置位
表示实在没时间从头学寄存器
急用,只能求助各位了 |