?? iic_test.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]);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -