[STM32F1] 有关GPIO的问题

[复制链接]
 楼主| 启航xin 发表于 2014-5-2 19:09 | 显示全部楼层 |阅读模式
GPIO_Write(GPIOA, 0x1101);
GPIOA不是16位的吗?,那这个0x1101设置的是GPIOA的哪几个管脚啊?
wangch_sh 发表于 2014-5-2 19:22 | 显示全部楼层
应该是GPIOA13吧。
 楼主| 启航xin 发表于 2014-5-2 19:30 | 显示全部楼层
wangch_sh 发表于 2014-5-2 19:22
应该是GPIOA13吧。

刚刚**了,知道了,谢谢
mmuuss586 发表于 2014-5-2 19:47 | 显示全部楼层
这个是写16位端口的函数
mmuuss586 发表于 2014-5-2 19:49 | 显示全部楼层
看下函数原型就明白了
/**
  * @brief  Writes data to the specified GPIO data port.
  * @param  GPIOx: where x can be (A, B, C, D or F) to select the GPIO peripheral.
  * @param  PortVal: specifies the value to be written to the port output data register.
  * @retval None
  */
void GPIO_Write(GPIO_TypeDef* GPIOx, uint16_t PortVal)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

  GPIOx->ODR = PortVal;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

17

帖子

0

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