⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dec6713_gpio.c

📁 SEED TMS320C6713开发板引导程序的源代码
💻 C
字号:
/********************************************************************************\
\*  DEC6713_GPIO.c	V1.00													    *\

\*  Copyright 2004 by SEED Electronic Technology LTD.                           *\
\*  All rights reserved. SEED Electronic Technology LTD.                        *\
\*  Restricted rights to use, duplicate or disclose this code are               *\
\*  granted through contract.    											    *\
                                             
\*	Designed by: Hongshuai.Li												    *\
\********************************************************************************/
/********************************************************************************\
\*		The example introduces using technique for GPIO. It generates a certain 
	frequency pulse on pin GPIO X. LED D8 will twinkle,if the routine runs correctly.*\
\********************************************************************************/

#include <csl.h>
#include <csl_gpio.h>
#include <DEC6713.h>
/********************************************************************************/

static GPIO_Handle hGpio;
extern far void vectors();
/********************************************************************************/
/********************************************************************************/
main()
{
	/* Initialize CSL,must when using CSL. */
	CSL_init();
	
	/* Initialize DEC6713 board. */
	DEC6713_init();
	
	IRQ_setVecs(vectors);     /* point to the IRQ vector table	*/
  	IRQ_globalEnable();       /* Globally enable interrupts       */ 
  	IRQ_nmiEnable();          /* Enable NMI interrupt             */	
	/* Set GPIO. */
	hGpio = GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);
	
	GPIO_reset(hGpio);
	
	//GPIO_config(hGpio,&MyGPIOCfg);
	
	GPIO_pinEnable(hGpio,GPIO_PIN13);
	
	GPIO_pinDirection(hGpio,GPIO_PIN13,GPIO_OUTPUT);
	
	while(1)
	{
		GPIO_pinWrite(hGpio,GPIO_PIN13,0);
		DEC6713_wait(0xfffff);
		GPIO_pinWrite(hGpio,GPIO_PIN13,1);
		DEC6713_wait(0xfffff);
	}
}	
/******************************************************************************\
* End of GPIO_Test.c
\******************************************************************************/

⌨️ 快捷键说明

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