rt-thread/bsp/essemi/es8p508x/libraries/Library/Include/lib_iic.h

230 lines
6.8 KiB
C
Raw Normal View History

2019-11-07 10:00:14 +08:00
/***************************************************************
*Copyright (C), 2017, Shanghai Eastsoft Microelectronics Co., Ltd.
*<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> lib_iic.h
*<EFBFBD><EFBFBD> <EFBFBD>ߣ<EFBFBD> Liut
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> V1.00
*<EFBFBD><EFBFBD> <EFBFBD>ڣ<EFBFBD> 2017/07/14
*<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> I2Cģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD>
*<EFBFBD><EFBFBD> ע<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ES8P508xоƬ
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧϰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʹ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>κη<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ρ<EFBFBD>
***************************************************************/
#ifndef __LIBIIC_H__
#define __LIBIIC_H__
#include "ES8P508x.h"
#include "type.h"
#include "system_ES8P508x.h"
/* <20><><EFBFBD>ſ<EFBFBD>©<EFBFBD><C2A9><EFBFBD><EFBFBD> */
typedef enum
{
I2C_PinMode_PP = 0x0 , //<2F>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>ģʽ:<3A><><EFBFBD><EFBFBD>
I2C_PinMode_OD = 0x1 , //<2F>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>ģʽ:<3A><>©
}I2C_TYPE_PINOD;
/* <20><><EFBFBD><EFBFBD>ģʽ */
typedef enum
{
I2C_Mode_Master = 0x0 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
I2C_Mode_Slave = 0x1 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
}I2C_TYPE_MODE;
/* Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ */
typedef enum
{
I2C_AckDelay_0P5 = 0x0 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:0.5<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_1 = 0x1 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:1<><31>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_1P5 = 0x2 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:1.5<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_2 = 0x3 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:2<><32>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_2P5 = 0x4 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:2.5<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_3 = 0x5 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:3<><33>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_3P5 = 0x6 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:3.5<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_AckDelay_4 = 0x7 , //Ӧ<><D3A6><EFBFBD><EFBFBD>ʱ:4<><34>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}I2C_TYPE_ADLY;
/* <20><><EFBFBD><EFBFBD>ģʽ */
typedef enum
{
I2C_RecMode_0 = 0x0 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>ֽڣ<D6BD><DAA3><EFBFBD><EFBFBD><EFBFBD>ACK
I2C_RecMode_1 = 0x1 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD>ֽڣ<D6BD><DAA3><EFBFBD><EFBFBD><EFBFBD>NACK
I2C_RecMode_2 = 0x2 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>ֽڣ<D6BD>ÿ<EFBFBD>ֽڷ<D6BD><DAB7><EFBFBD>ACK
I2C_RecMode_3 = 0x3 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD>ֽڣ<D6BD>ǰһ<C7B0>ֽڷ<D6BD><DAB7><EFBFBD>ACK<43><4B><EFBFBD><EFBFBD>һ<EFBFBD>ֽڷ<D6BD><DAB7><EFBFBD>NACK
I2C_RecMode_4 = 0x4 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4<EFBFBD>ֽڣ<D6BD>ÿ<EFBFBD>ֽڷ<D6BD><DAB7><EFBFBD>ACK
I2C_RecMode_5 = 0x5 , //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4<EFBFBD>ֽڣ<D6BD>ǰ3<C7B0>ֽڷ<D6BD><DAB7><EFBFBD>ACK<43><4B><EFBFBD><EFBFBD>һ<EFBFBD>ֽڷ<D6BD><DAB7><EFBFBD>NACK
I2C_RecMode_6 = 0x6, //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>գ<EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ֽڷ<D6BD><DAB7><EFBFBD>ACK
I2C_RecMode_7 = 0x7, //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><C9B8>ֽڽ<D6BD><DABD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>NACK
}I2C_TYPE_RECMODE;
/* <20><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
typedef enum
{
I2C_TI_Disable = 0x0 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:0
I2C_TI_1 = 0x1 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:1
I2C_TI_2 = 0x2 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:2
I2C_TI_3 = 0x3 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:3
I2C_TI_4 = 0x4 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:4
I2C_TI_5 = 0x5 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:5
I2C_TI_6 = 0x6 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:6
I2C_TI_7 = 0x7 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:7
I2C_TI_8 = 0x8 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:8
I2C_TI_9 = 0x9 , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:9
I2C_TI_10 = 0xA , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:10
I2C_TI_11 = 0xB , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:11
I2C_TI_12 = 0xC , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:12
I2C_TI_13 = 0xD , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:13
I2C_TI_14 = 0xE , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:14
I2C_TI_15 = 0xF , //<2F><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:15
}I2C_TYPE_TIS;
/* I2C<32><43>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ýṹ<C3BD><EFBFBD><E5B6A8> */
typedef struct
{
I2C_TYPE_PINOD I2C_SclOd; //SCL<43>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>ģʽ
I2C_TYPE_PINOD I2C_SdaOd; //SDA<44>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD>ģʽ
TYPE_FUNCEN I2C_16XSamp; //<2F>˿<EFBFBD>16<31><36><EFBFBD>ٲ<EFBFBD><D9B2><EFBFBD>ʹ<EFBFBD><CAB9>
uint32_t I2C_Clk; //I2CƵ<43><C6B5>
I2C_TYPE_MODE I2C_Mode; //<2F><><EFBFBD><EFBFBD>ģʽ
TYPE_FUNCEN I2C_AutoStop; //<2F>Զ<EFBFBD>ֹͣ
TYPE_FUNCEN I2C_AutoCall; //<2F>Զ<EFBFBD>Ѱ<EFBFBD><D1B0>
}I2C_InitStruType;
/* <20><><EFBFBD>͡<EFBFBD><CDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ģʽ */
typedef enum
{
I2C_TRBIM_Byte = 0x0 , //<2F>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
I2C_TRBIM_HalfWord = 0x1 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
I2C_TRBIM_Word = 0x2 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
}I2C_TYPE_TRBIM;
/* <20><>дģʽ */
typedef enum
{
I2C_Mode_Write = 0x0 ,
I2C_Mode_Read = 0x1 ,
}I2C_TYPE_RWMODE;
/* <20>ж<EFBFBD>ʹ<EFBFBD>ܱ<EFBFBD>־λ */
typedef enum
{
I2C_IT_SR = 0x0001 , //<2F><>ʼλ
I2C_IT_SP = 0x0002 , //ֹͣλ
I2C_IT_TB = 0x0004 , //<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
I2C_IT_RB = 0x0008 , //<2F><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>
I2C_IT_TE = 0x0010 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
I2C_IT_RO = 0x0020 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_IT_NA = 0x0040 , //δӦ<CEB4><D3A6>NACK
I2C_IT_TBWE = 0x0080 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>
I2C_IT_TIDLE = 0x01000 , //<2F><><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD>ж<EFBFBD>
}I2C_TYPE_IT;
/* <20>жϱ<D0B6>־λ */
typedef enum
{
I2C_Flag_SR = 0x0001 , //<2F><>ʼλ
I2C_Flag_SP = 0x0002 , //ֹͣλ
I2C_Flag_TB = 0x0004 , //<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>
I2C_Flag_RB = 0x0008 , //<2F><><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>
I2C_Flag_TE = 0x0010 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
I2C_Flag_RO = 0x0020 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_Flag_NA = 0x0040 , //δӦ<CEB4><D3A6>NACK
I2C_Flag_TBWE = 0x0080, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>жϱ<D0B6>־λ
I2C_Flag_TIDLE= 0X1000, //I2C <20><><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD>жϱ<D0B6>־λ
}I2C_TYPE_FLAG;
/* <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD> */
typedef enum
{
I2C_Clr_SR = 0x0001 , //<2F><>ʼλ
I2C_Clr_SP = 0x0002 , //ֹͣλ
I2C_Clr_TE = 0x0010 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
I2C_Clr_RO = 0x0020 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
I2C_Clr_NA = 0x0040 , //δӦ<CEB4><D3A6>NACK
I2C_Clr_TBWE = 0x0080 , //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>
I2C_Clr_TIDLE= 0X01000, //I2C <20><><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD>
}I2C_CLR_IF;
/*************I2Cģ<43><C4A3><EFBFBD><EFBFBD><EAB6A8>************/
/* I2Cģ<43><C4A3>ʹ<EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD> */
#define I2C_Enable() (I2C0->CON.EN = 1)
#define I2C_Disable() (I2C0->CON.EN = 0)
/* I2Cģ<43>鸴λ */
#define I2C_Reset() (I2C0->CON.RST = 1)
/* I2Cʱ<43><CAB1>ʹ<EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD> */
#define I2C_TJEnable() (I2C0->CON.TJE = 1)
#define I2C_TJDisable() (I2C0->CON.TJE = 0)
/* I2C<32><43><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>д<EFBFBD><D0B4><EFBFBD><EFBFBD> */
#define I2C_Read() (I2C0->CON.RW = 1)
#define I2C_Write() (I2C0->CON.RW = 0)
/* I2Cʱ<43><CAB1><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD>ʹ<EFBFBD>ܿ<EFBFBD><DCBF>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>ӻ<EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_CSEnable() (I2C0->MOD.CSE = 1)
#define I2C_CSDisable() (I2C0->MOD.CSE = 0)
/* I2C<32>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>δӦ<CEB4><D3A6>ʹ<EFBFBD>ܿ<EFBFBD><DCBF>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>ӻ<EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_ANAEnable() (I2C0->MOD.ANAE = 1)
#define I2C_ANADisable() (I2C0->MOD.ANAE = 0)
/* I2C<32>Զ<EFBFBD>Ѱ<EFBFBD><D1B0>ʹ<EFBFBD>ܿ<EFBFBD><DCBF>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_SRAEnable() (I2C0->MOD.SRAE = 1)
#define I2C_SRADisable() (I2C0->MOD.SRAE = 0)
/* I2C<32>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ܿ<EFBFBD><DCBF>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_SPAEnable() (I2C0->MOD.SPAE = 1)
#define I2C_SPADisable() (I2C0->MOD.SPAE = 0)
/* I2C<32><43>ʼλ<CABC><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_SRTrigger() (I2C0->MOD.SRT=1)
/* I2Cֹͣλ<D6B9><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_SPTrigger() (I2C0->MOD.SPT = 1)
/* I2C<32><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_RDTrigger() (I2C0->MOD.RDT = 1)
/* I2C<32><43><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> */
#define I2C_Release() (I2C0->MOD.BLD = 1)
/* I2C<32><43><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD>ӻ<EFBFBD>ģʽ֧<CABD>֣<EFBFBD> */
#define I2C_TACK() (I2C0->MOD.TAS = 1)
#define I2C_TNACK() (I2C0->MOD.TAS = 0)
/************I2Cģ<43><EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>***********/
void I2C_Init(I2C_InitStruType* I2C_InitStruct);
void I2C_ITConfig(I2C_TYPE_IT I2C_IT,TYPE_FUNCEN NewState);
void I2C_SendAddress(uint8_t I2C_Address,I2C_TYPE_RWMODE Mode);
void I2C_SetAddress(uint8_t I2C_Address);
void I2C_RecModeConfig(I2C_TYPE_RECMODE RecType);
void I2C_TBIMConfig(I2C_TYPE_TRBIM Type);
void I2C_RBIMConfig(I2C_TYPE_TRBIM Type);
void I2C_AckDelay(I2C_TYPE_ADLY Type,TYPE_FUNCEN NewStatus);
void I2C_TISConfig(I2C_TYPE_TIS Time);
void I2C_SendByte(uint8_t Byte);
void I2C_SendHalfWord(uint16_t HalfWord);
void I2C_SendWord(uint32_t Word);
uint8_t I2C_RecByte(void);
uint16_t I2C_RecHalfWord(void);
uint32_t I2C_RecWord(void);
I2C_TYPE_RWMODE I2C_GetRWMode(void);
FlagStatus I2C_GetTBStatus(void);
FlagStatus I2C_GetFlagStatus(I2C_TYPE_FLAG I2C_Flag);
FlagStatus I2C_GetITStatus( I2C_TYPE_IT I2C_Flag);
void I2C_ClearITPendingBit(I2C_CLR_IF I2C_IT);
#endif
/*************************END OF FILE**********************/