-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi2c_dtrd.c
20 lines (19 loc) · 818 Bytes
/
i2c_dtrd.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <p18cxxx.h>
#include "i2c.h"
/********************************************************************
* Function Name: DataRdyI2C *
* Return Value: status byte to indicate if BF = 1 *
* Parameters: void *
* Description: Determine if there is a byte to be read *
* from the SSPBUF register. *
********************************************************************/
#if defined (I2C_V1)
#undef DataRdyI2C
unsigned char DataRdyI2C( void )
{
if ( SSPSTATbits.BF ) // test if buffer full bit is set
return ( +1 ); // data in SSPBUF register
else
return ( 0 ); // no data in SSPBUF register
}
#endif