📄 dec6713_esam.c
字号:
/*********************************************************************************
* DEC6713_ESAM.C v1.00 *
* Copyright 2003 by SEED Electronic Technology Ltd.
* All rights reserved. Property of SEED Electronic Technology Ltd. *
* Designed by: Hongshuai.Li *
*********************************************************************************/
/********************************************************************************\
\* The routine illustrate the using method of ESAM *\
\********************************************************************************/
#include <csl.h>
#include <csl_irq.h>
#include <csl_timer.h>
#include <csl_gpio.h>
#include <std.h>
#include <stdio.h>
#include <DEC6713.h>
#include <ESAM.h>
/********************************************************************************/
extern far void vectors();
Uint8 Buffer[100];
Uint32 ReadFlag;
GPIO_Handle hGpio;
//Uint8 regnum;
//Uint8 value;
Uint8 reciveCnt = 0;
GPIO_Config MyGPIOConfig1 = {
0x00000030, // gpgc -logic mode
0x00008000, // gpen - Enable GP15 as interrupt input.
0x00007fff, // gpdir - Set gp15 as input.
0x0000ffff, // gpval - Default values are 0.
0x00000000, // gphm - gp15hm=0.
0x00008000, // gplm - gp15lm = 1.
0x00008000 // gppol - gp15pol = 1.
};
/********************************************************************************/
main()
{
Uint32 i;
/* Initialize CSL, must when using csl. */
CSL_init();
/* Initialize DSK6713 board. */
DEC6713_init();
IRQ_setVecs(vectors); /* point to the IRQ vector table */
IRQ_globalEnable(); /* Globally enable interrupts */
IRQ_nmiEnable(); /* Enable NMI interrupt */
for(i= 0;i<100;i++)
{
Buffer[i] = 0;
}
DEC6713_EsamOpen();
DEC6713_EsamPortDirection(Input);
DEC6713_EsamReset();
/* Read ID. */
do
{
ReadFlag = DEC6713_EsamRead((Uint32)(&Buffer),(Uint32)(&reciveCnt));
}while(ReadFlag ==1);
for(i = 0;i<reciveCnt;i++)
{
printf("Receive data is : 0x%x\n",Buffer[i]);
}
printf("\nReceiving data opertion is over.");
}
/********************************************************************************\
\* End of DEC6713_ESAM.C *\
\********************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -