PCF8583+LM1602的protues仿真實例(C語言)
#include
#include
#include
#define lcdwritecmd
#define ledwritedat
sbit
sbit
char tab[2];
unsigned char year,mon,day,hour,min,sec,state,hudsec;
//============================延時函數(shù)====================================
void delay(unsigned char n)
{
}
void delayshort()
{
}
//=========================================================================
//============================1602寫指令函數(shù)===============================
void writecmd(unsigned char a)
{
}
//=========================================================================
//============================1602寫數(shù)據(jù)函數(shù)===============================
void writedata(char lcddata)
{
}
//=========================================================================
//===========================1602顯示字符串據(jù)函數(shù)==========================
void displaystring(unsigned char add,unsigned char n,char tab[])
{
}
//=========================================================================
//===========================I2C開始信號函數(shù)===============================
void start()
{
}
//=========================================================================
//===========================I2C結(jié)束信號函數(shù)===============================
void stop()
{
}
//=========================================================================
//===========================I2C從機等待應(yīng)答信號函數(shù)=======================
void waitack()
{
}
//=========================================================================
//===========================I2C主機應(yīng)答信號函數(shù)===========================
void mack()
{
}
//=========================================================================
//===========================I2C寫一個字節(jié)函數(shù)=============================
void write_byte(unsigned char a)
{
}
//=========================================================================
//===========================I2C讀一個字節(jié)函數(shù)=============================
unsigned char read_byte()
{
}
//=========================================================================
//===========================PCF8583寫函數(shù)=================================
//參數(shù)adr:寄存器地址
//參數(shù)dat:寫入得數(shù)據(jù)
void PCF8583_write(unsigned char adr,unsigned char dat)
{
}
//=========================================================================
//===========================PCF8583讀函數(shù)=================================
//連續(xù)讀區(qū)以00起始地址的7個單元的數(shù)據(jù)
void PCF8583_read()
{
}
評論