dec643_gpio.c

来自「根据摄像头数据分析计算目标距离与方向 并驱动机械进行跟踪 采用合众达DEC643」· C语言 代码 · 共 60 行

C
60
字号
/********************************************************************/
/*  Copyright 2004 by SEED Incorporated.							*/
/*  All rights reserved. Property of SEED Incorporated.				*/
/*  Restricted rights to use, duplicate or disclose this code are	*/
/*  granted through contract.									    */
/*  															    */
/********************************************************************/
/*
	Designed by: Hongshai.Li
	Build:	06.21.2005
	Modify:
	Discription:The routine blinks led D2.
*/
/********************************************************************/

#include <csl.h>
#include <stdio.h>
#include <csl_irq.h>
#include <csl_gpio.h>
#include <csl_timer.h>

#include "DEC643.h"
/*********************************************************************/
	/* GPIO configuration */

/*********************************************************************/
static TIMER_Handle hTimer;
extern far void vectors();
/*********************************************************************/
main()
{
	/* Initialize CSL,must when using CSL. */
	CSL_init();
	
	/*Initialize interrupt vector*/
    IRQ_setVecs(vectors); 
    IRQ_nmiEnable();
    IRQ_globalEnable();
	hTimer=TIMER_open(TIMER_DEV1,0);
	TIMER_setPeriod(hTimer,10000);
	TIMER_start(hTimer);
	
	
 
    while(1)
	{
		TIMER_setDatOut(hTimer,0);
		DEC643_waitusec(15700);
		TIMER_setDatOut(hTimer,1);
		DEC643_waitusec(1609);
	}
	//55Hz

}
/*********************************************************************/
/*	End of DEC643_GPIO. */
/*********************************************************************/


⌨️ 快捷键说明

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