//#ifndef __IICSETUP_H__
//#define __IICSETUP_H__
/*--------------------------------------------------------------------------------------
*  @file     IICSetup.h
*  @author   ZhangJing
*  @version  base on stm32f0x   
*  @date     2015.09.11
*  @brief    模拟IIC驱动
---------------------------------------------------------------------------------------*/

#define TWI2_SCL_0 GPIOA->BRR=GPIO_Pin_9//SCL低 PINA09
#define TWI2_SCL_1 GPIOA->BSRR=GPIO_Pin_9//SCL高 PINA09
#define TWI2_SDA_0 GPIOA->BRR=GPIO_Pin_10//SDA低 PINA10
#define TWI2_SDA_1 GPIOA->BSRR=GPIO_Pin_10//SDA高 PINA10
#define TWI2_SDA_STATE (GPIOA->IDR&GPIO_Pin_10)//SDA状态


//#define TWI_RETRY_COUNT 3 //重试次数

#define TWI2_NOP TWI2_Delay()




void TWI2_Delay(void);
void IIC2Init( void );
unsigned char TWI2_START(void);
void TWI2_STOP(void);
void TWI2_SendACK(void);
void TWI2_SendNACK(void);
unsigned char  TWI2_WaitAck(void);
unsigned char  TWI2_SendByte(unsigned char Data);
unsigned char  TWI2_ReceiveByte(void);



//#endif
