Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. unsigned char readI2C(void)
  2. {
  3. unsigned char temp;
  4. RCEN = 1;
  5. while(!BF);
  6. temp = SSPBUF;
  7. I2CWait();
  8. return temp;
  9. }
  10. void I2CWait()
  11. {
  12. while ((SSPCON2 & 0x1F ) || ( SSPSTAT & 0x04 ) );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement