/********************************************************************************\
\* 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
#include
#include
/********************************************************************************/
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);
}
}
/***************************
1