Imported Upstream version 2.9.0
[debian/cc1111] / device / lib / pic16 / libio / i2c / i2cwritec.c
1
2 #include <pic18fregs.h>
3
4 #include <i2c.h>
5
6 char i2c_writechar(unsigned char dat)
7 {
8   SSPBUF = dat;
9   if( SSPCON1bits.WCOL ) {
10     return -1;
11   } else {
12     while( I2C_DRDY() );
13     return 0;
14   }
15 }