[应用相关] STM32F030 使用引脚输入

[复制链接]
435|0
 楼主| 梅花香自123 发表于 2021-3-22 23:12 | 显示全部楼层 |阅读模式
STM32F030 使用引脚输入-2019-5-28



  GPIO_InitTypeDef GPIO_InitStructure;


  /* Enable the BUTTON Clock */
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
  /* Configure Button pin as input */
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_9 | GPIO_Pin_10;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

您需要登录后才可以回帖 登录 | 注册

本版积分规则

102

主题

1216

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部