⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iic_test.c

📁 ARM7 lpc22eb06 IIC通讯源代码
💻 C
字号:
/*
***********************************************************************

       Embest Info&Tech Co., Ltd.  All rights reserved.
                     www.embedinfo.com

***********************************************************************

---------------- file information -------------------------------------

file name: IIC_test.c
version  : v0
author   : z.x.q. Embest
begin    : 2006-04-24
finish   : 2006-04-24
define   : IIC_test source file

notes    :
---------------- modify information -----------------------------------
version  :
modify   :
begin    :
finish   :
define   :
-----------------------------------------------------------------------
*/
/*-------------------------------------------------------------------*/
/*                       include files                               */
/*---------------------------------------------------------------- --*/
#include	"..\..\com\lpc_lib_IIC\lpc_lib_IIC.h"

/*-------------------------------------------------------------------*/
/*                     local  function declare                       */
/*-------------------------------------------------------------------*/
void IIC_test(void);
/*-------------------------------------------------------------------*/
/*                       function code                               */
/*-------------------------------------------------------------------*/

void Main(void)
{

     lpc_init_pll_manual();
//initialize module,it is very necessary for stability of system	
	spi_data_send(0, 0xfb);
	spi_data_send(0, 0x56);
	spi_data_send(0, 0xfb);
	spi_data_send(0, 0x56);
	
//initialize LCD,and set up some parameter	
	LCD_reset();
	LCD_init();
	LCD_BL_con(0);	
	color_set(0x0,0x07ff);						//color setup
	posi_set(0,0);								//set display position,x and y direction
	cls();										//clear screen
		
	LCD_printf("hello,world!\n");
	IIC_test();
	
	while(1);
}

void IIC_test(void)
{
	INT8U data[16];
	INT8U i;
	
	IIC_init();
	LCD_printf("wr 24c02 0 ~ f\n");
	
	for(i=0;i<16;i++)
	Wr24C02(0xa0,i,i);

	for(i=0;i<16;i++)
	{
		Rd24C02(0xa0,i,&data[i]);
		LCD_printf(" %x",data[i]);
	}

}

⌨️ 快捷键说明

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