[STM32F4] 【STM32F469I试用】+试运行点亮LED灯

[复制链接]
591|0
 楼主| caoqing 发表于 2015-12-18 18:33 | 显示全部楼层 |阅读模式
int main(void)
{
  HAL_Init();

  /* Configure the system clock to 180 MHz */
  SystemClock_Config();
  
  /* -1- Enable GPIO Clock (to be able to program the configuration registers) */
  __HAL_RCC_GPIOK_CLK_ENABLE();

  /* -2- Configure IO in output push-pull mode to drive external LEDs */
  GPIO_InitStruct.Mode  = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull  = GPIO_PULLUP;
  GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;

  GPIO_InitStruct.Pin = GPIO_PIN_3;
  HAL_GPIO_Init(GPIOK, &GPIO_InitStruct);

  /* -3- Toggle IO in an infinite loop */
  while (1)
  {
    HAL_GPIO_TogglePin(GPIOK, GPIO_PIN_3);
    /* Insert delay 100 ms */
    HAL_Delay(100);
  }
}
IMG_20151218_183108.jpg
您需要登录后才可以回帖 登录 | 注册

本版积分规则

77

主题

491

帖子

6

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