main.c

来自「ucLinux ported to STR71.」· C语言 代码 · 共 43 行

C
43
字号
/******************** (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  the
*                      GPIO 0 pins port, then toggle the  pins state .
********************************************************************************
* History:
*  04/06/2003 : Created
*******************************************************************************/
#include "71x_map.h"

void delay(void)
{
  u16 i;
  for(i=0; i<0xFFFF; i++);
}

int main(void)
{ u16 a;
  
  GPIO0->PC0 |= 0x000F;
  GPIO0->PC1 &= 0xFFF0;
  GPIO0->PC2 |= 0x000F;

  
  GPIO0->PD |= 0x000F;
  
  


 while(1) // infinite loop
  { 
    delay();
    a= 0x000F;    
    GPIO0->PD = GPIO0->PD ^ a; // Toggle GPIO 0 pins
   
  }
}

/******************* (C) COPYRIGHT 2003 STMicroelectronics *****END OF FILE****/

⌨️ 快捷键说明

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