#include <I2C.bas> ' source in /Program Files/Coridium/BASIClib
I2CIN will send OUTcnt bytes from OUTlist and then receives INlist bytes as i2c serial data on CLKpin and DATApin from the i2c device at addr. OUTcnt may be -1 and OUTlist empty. If OUTcnt is 0, then the string will be sent until a 0, CR or LF character is found in OUTlist .
If INcnt is 0, then the string will be filled with bytes until a 0, CR or LF character is received. Note that no bounds checking is performed on the input, and if a 0, CR, or LF is never received then this routine will hang. As there is no bounds checking its possible to overwrite other variables, if less than 256 bytes have been allocated for the InputList string.
Data is shifted in at 280 Kbits/sec. See the #defines to change this rate.