rt-thread/bsp/swm320-lq100/Libraries/SWM320_StdPeriph_Driver/SWM320_i2c.h

28 lines
802 B
C
Raw Normal View History

2018-12-24 17:17:27 +08:00
#ifndef __SWM320_I2C_H__
#define __SWM320_I2C_H__
typedef struct
{
uint8_t Master; //1 <20><><EFBFBD><EFBFBD>ģʽ
uint8_t Addr7b; //1 7λ<37><CEBB>ַ 0 10λ<30><CEBB>ַ
uint32_t MstClk; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ƶ<EFBFBD><C6B5>
uint8_t MstIEn; //<2F><><EFBFBD><EFBFBD>ģʽ<C4A3>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint16_t SlvAddr; //<2F>ӻ<EFBFBD><D3BB><EFBFBD>ַ
uint8_t SlvRxEndIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint8_t SlvTxEndIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint8_t SlvSTADetIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><E2B5BD>ʼ<EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint8_t SlvSTODetIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><E2B5BD>ֹ<EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint8_t SlvRdReqIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
uint8_t SlvWrReqIEn; //<2F>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD>յ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>ʹ<EFBFBD><CAB9>
} I2C_InitStructure;
void I2C_Init(I2C_TypeDef *I2Cx, I2C_InitStructure *initStruct);
void I2C_Open(I2C_TypeDef *I2Cx);
void I2C_Close(I2C_TypeDef *I2Cx);
#endif //__SWM320_I2C_H__