高中生
最后登录1970-1-1
在线时间 小时
注册时间2015-10-8
|
- static void Read_FM_Data(uint8_t *Readbuf)
- {
- uint8_t i; //Ñ-»·¼Æêy
-
- while(I2C_GetFlagStatus(I2C1,I2C_FLAG_BUSY)==SET);//2éÃ|
- I2C_GenerateSTART(I2C1,ENABLE); //I2CÆeê¼DÅoÅ
-
- /*è·èÏEV5ê¼t·¢éú*/
- while(I2C_CheckEvent(I2C1,I2C_EVENT_MASTER_MODE_SELECT)==SUCCESS);
-
- I2C_Send7bitAddress(I2C1,FM_addr,I2C_Direction_Receiver);
-
- /*è·èÏEV6ê¼t·¢éú*/
- while(I2C_CheckEvent(I2C1,I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)==SUCCESS);
-
- for(i=0;i<=3;i++)
- {
- *(Readbuf+i)=I2C_ReceiveData(I2C1);
-
- /*è·èÏEV7ê¼t·¢éú*/
- while(I2C_CheckEvent(I2C1,I2C_EVENT_MASTER_BYTE_RECEIVED)==SUCCESS);
- }
-
- I2C_GenerateSTOP(I2C1,ENABLE); //I2CÖÕÖ1DÅoÅ
- }
- /********************************************************************/
复制代码
|
|