51單片機(jī)—AT24C1024(帶程序解析!)—07
然后就是程序了:
main.c(先從主程序開(kāi)始嗎~~后邊還有很多的)
//------------------------------------------------------------------------------
//main.c~~~主文件
#include"reg52.h"
#include"MacroAndCOnst.h"
#include"at24c1024.h"
#include"delay.h"
#include"lcdinit.h"
//------------------------------------------------------------------------------
uchar code title[]="AT24C1024 Text: ";
uchar send_data[16]={0,1,2,3,4,5,6,7,8,9};
uchar receive_data[10];
//------------------------------------------------------------------------------
//main
void main()
{
//
}
LcdInit.c
//------------------------------------------------------------------------------
//LCD1602的初始化程序—可調(diào)用函數(shù)—C51
#include"reg52.h"
#include"MacroAndConst.h"
#include"Delay.h"
#include"Foot.h"
//------------------------------------------------------------------------------
#define
sbit lcd_en=P3^4;
sbit lcd_rs=P3^5;
sbit lcd_rw=P3^6;
//------------------------------------------------------------------------------
//LCD寫指令函數(shù)
void lcd_write_command(uchar com)
{
}
//------------------------------------------------------------------------------
//LCD寫數(shù)據(jù)函數(shù)
void lcd_write_data(uchar dat)
{
}
//------------------------------------------------------------------------------
//LCD初始化函數(shù)
void lcd_init()
{
}
//------------------------------------------------------------------------------
//LCD顯示一個(gè)字節(jié)函數(shù)
void
{
}
//------------------------------------------------------------------------------
//LCD顯示多個(gè)字節(jié)函數(shù)
void
{
}
IIC.c
//------------------------------------------------------------------------------
#include"reg52.h"
#include"MacroAndConst.h"
#include"intrins.h"
#include"Foot.h"
bit
//------------------------------------------------------------------------------
//開(kāi)始信號(hào)函數(shù)
void IIC_start()
{
}
//------------------------------------------------------------------------------
//結(jié)束信號(hào)函數(shù)
void IIC_stop()
{
}
//------------------------------------------------------------------------------
//主控器件接收應(yīng)答函數(shù)
void IIC_ack_acc()
{
}
評(píng)論