stm32f4的GPIO端口配置为输出低电平,但是实际测量输出电压为1.78V。
程序如下:
void Io_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;- GPIO_Init(GPIOA &GPIO_InitStructure); GPIO_ResetBits(GPIOA GPIO_Pin_6 | GPIO_Pin_7); }
你贴出的程序有问题吧
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;-