xiaoxiaocheng_plc/users/i2c.h

37 lines
1.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******************************************************************************
文 件 名wx_i2c.h
文件说明i2c总线eeprom操作头文件
调用库版本V3.0
日 期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!!!
********************************************************************************************************/