31
D6F-PH MEMS Differential pressure Sensor User’s Manual (A288)
I2C_Send7bitAddress(I2C1,(address << 1),direct ); //write to Slave
while(!I2C_CheckEvent(I2C1, event)); // wait ACK
}
void I2C1_senddata(uint8_t data){
I2C_SendData(I2C1, data); //transmit the received
command
while(!I2C_CheckEvent(I2C1,I2C_EVENT_MASTER_BYTE_TRANSMITTED)); // wait ACK
}
uint8_t I2C1_rcvdata(void){
while(!I2C_CheckEvent(I2C1,I2C_EVENT_MASTER_BYTE_RECEIVED)); // wait ACK
return I2C_ReceiveData(I2C1); // receive 4th 8bit data
}
void I2C1_Stop(){
I2C_GenerateSTOP(I2C1, ENABLE); // put stop condition
}
void I2C1_AckEn(){
I2C_AcknowledgeConfig(I2C1, ENABLE); // ack enable
}
void I2C1_AckDis(){
I2C_AcknowledgeConfig(I2C1, DISABLE); // ack disable
}
Summary of Contents for D6F-PH
Page 35: ......