新手入门
- 积分
- 11
- 金钱
- 11
- 注册时间
- 2019-12-2
- 在线时间
- 6 小时
|
1金钱
配置GPIOA1-4,但是只能正确读取GPIOA1的数据,其他口读到的都是1。GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);
/* Configure PA.01-PA.04 as input in_floating DI1-DI4 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
读到的寄存器值:GPIOA->IDR=0x0000DF1E
|
|