main.c

来自「Lcd test demo code based on St arm mcu」· C语言 代码 · 共 34 行

C
34
字号
/******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
* File Name          : main.c
* Author             : MCD Application Team
* Date First Issued  : 04/06/2003
* Description        : Short Example, Program using the GPIO 0 port.
*                      the purpose of this program is to configure all the
*                      GPIO 0 pins port as Push-Pull output, then toggle the
*                      pins state each 300 ms. 
********************************************************************************
* History:
*  04/06/2003 : Created
*******************************************************************************/

#include "71x_lib.h"

u32 i;
int main()
{
#ifdef DEBUG
  debug();
#endif /* DEBUG */
  // Configure GPIO0.0 pin to Push Pull Output
  GPIO_Config (GPIO0,0x1,GPIO_OUT_PP);
// Set all GPIO0 pins low
  (*GPIO0).PD=0x0000;

  while(1)
  {
    for(i=0;i<0xFFFF;i++); //delay
    GPIO_BitWrite(GPIO0,0,~GPIO_BitRead(GPIO0,0)); // Toggle GPIO0.0 pin
  }
}
/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?