xiaoxiaocheng_plc/users/i2c.h

37 lines
1.0 KiB
C
Raw Permalink Normal View History

2018-11-13 22:25:34 +08:00
/******************************************************************************
<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>wx_i2c.h
<EFBFBD>ļ<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>i2c<EFBFBD><EFBFBD><EFBFBD><EFBFBD>eeprom<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>
<EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>V3.0
<EFBFBD><EFBFBD> <EFBFBD>ڣ<EFBFBD>11-5-30
******************************************************************************/
#ifndef _I2C_H
#define _I2C_H
#include "stm32f10x.h"
#define IIC_Write_Address 0xa0 //Write Address
#define IIC_Read_Address 0xa1 //Read Address
void delay_5us(u16 num);
void IIC_Init(void);
void IIC_Start(void);
void IIC_Stop(void);
void IIC_Wait_ack(void);
void IIC_Send_noack(void);
void IIC_Writebyte(u8 Data);
u8 IIC_Readbyte(void);
void IIC_Write(u16 Address,u8 Data);
void IIC_Write_Array(u8 *Data,u16 Address,u16 Num);
u8 IIC_Read(u16 Address);
void IIC_Read_Array(u8 *Data,u16 Address,u16 Num);
void IIC_Clear(u16 Address,u16 Num);
#endif
/*******************************************************************************************************
endfile!!!
********************************************************************************************************/