初级会员

- 积分
- 57
- 金钱
- 57
- 注册时间
- 2018-8-2
- 在线时间
- 10 小时
|
1金钱
void OLED_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); //使能A端口时钟
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_7|GPIO_Pin_4|GPIO_Pin_5;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//速度50MHz
GPIO_Init(GPIOA, &GPIO_InitStructure); //初始化GPIOD3,6
GPIO_SetBits(GPIOA,GPIO_Pin_5|GPIO_Pin_7|GPIO_Pin_4|GPIO_Pin_4|GPIO_Pin_5); |
最会两句这个配置的什么?
大佬 请指教下 谢谢---------
|
最佳答案
查看完整内容[请看2#楼]
GPIO_Init(GPIOA, &GPIO_InitStructure);把刚才给结构体GPIO_InitStructure的赋值写进寄存器。GPIO_SetBits(GPIOA,GPIO_Pin_5|GPIO_Pin_7|GPIO_Pin_4|GPIO_Pin_4|GPIO_Pin_5); 拉高PA4,PA5,PA7
|