打印
[应用相关]

STM32F030 使用引脚输入

[复制链接]
352|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);

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

87

主题

1054

帖子

0

粉丝