dft1.c

来自「在KEIL环境下,取反p0.26口」· C语言 代码 · 共 37 行

C
37
字号
#include "lpc2103.h"
#include "config.h"
#include "I2CINT.c"

delay(int32 a)
{
	while(a--);
}

main()
{	//uint8 b=0;
uint8 a[]={"78"};
	PINSEL0=0x50;
	IODIR=0xffffffff;
	IOPIN=0X0;
	I2CONCLR = 0x6C;                            /* 清除控制寄存器 */
    I2SCLH = (11059200 / 100000 + 1) / 2;            /* 设置高电平时间 */
    I2SCLL = (11059200 / 100000) / 2;
	VICIntSelect=0x20;
//	VICDefVectAddr=(uint32)IRQ_I2C;
	 VICVectAddr15=(uint32)IRQ_I2C;
	VICVectCntl15=0x29;     //VICVectCntl0为第0级中断,VICVectCntl15为第15级中断,VICVectCntl必需与VICVectAddr对应

	VICIntEnable |= 1<<9;
	while(1)
	{
	I2C_WriteNByte(0xa0, 1, 0, a, 2);
	delay(8000);
	a[0]=0;
	a[1]=0;
	I2C_ReadNByte (0xa0, 1, 0, a, 2);

	
	}
	
}

⌨️ 快捷键说明

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