| 
 
初级会员 
 
	积分172金钱172 注册时间2014-6-4在线时间19 小时 | 
 
 
 楼主|
发表于 2023-4-12 13:23:15
|
显示全部楼层 
| GPIO_InitTypeDef GPIO_InitStructure; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);//使能PA口时钟
 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
 
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
 //GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
 //GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7; //REST
 GPIO_Init(GPIOA, &GPIO_InitStructure);
 
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
 //GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
 //GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;//SCLK
 GPIO_Init(GPIOA, &GPIO_InitStructure);
 
 /*GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_0);//
 GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
 GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
 GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;//DATA
 GPIO_Init(GPIOA, &GPIO_InitStruct);*/
 
 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
 GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;//DATA
 GPIO_Init(GPIOA, &GPIO_InitStructure);
 
 PA7输出低是低电平  而PA9/PA10一个2.9  一个2.5  应该是哪里设置不对?输不出低电平
 | 
 |