/********************************************************************************\ \* 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 \******************************************************************************/
- 粉丝: 1
- 资源: 3
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助