打印

BitAction BitVal 怎么详细操作的

[复制链接]
3560|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
山狼啸月|  楼主 | 2013-10-18 00:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
  assert_param(IS_GPIO_BIT_ACTION(BitVal));
  
  if (BitVal != Bit_RESET)
  {
    GPIOx->BSRR = GPIO_Pin;
  }
  else
  {
    GPIOx->BRR = GPIO_Pin;
  }
}
沙发
airwill| | 2013-10-18 15:40 | 只看该作者
这个函数, 一眼就能看明白在干什么, 有什么问题呢?

使用特权

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

本版积分规则

15

主题

217

帖子

1

粉丝