📄 dec643_gpio.c
字号:
/********************************************************************/
/* 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -