📄 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 "DEC643.h"
/*********************************************************************/
/* GPIO configuration */
/*********************************************************************/
static GPIO_Handle hGpio;
extern far void vectors();
/*********************************************************************/
main()
{
/* Initialize CSL,must when using CSL. */
CSL_init();
/*Initialize interrupt vector*/
IRQ_setVecs(vectors);
IRQ_nmiEnable();
IRQ_globalEnable();
/* Set GPIO. */
hGpio = GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);
GPIO_reset(hGpio);
GPIO_pinEnable(hGpio,GPIO_PIN14);
GPIO_pinDirection(hGpio,GPIO_PIN14,GPIO_OUTPUT);
/* Blinks led D2. */
while(1)
{
GPIO_pinWrite(hGpio,GPIO_PIN14,0);
DEC643_waitusec(500000);
GPIO_pinWrite(hGpio,GPIO_PIN14,1);
DEC643_waitusec(500000);
}
}
/*********************************************************************/
/* End of DEC643_GPIO. */
/*********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -