Little-Wire
 All Classes Functions Groups Pages
I2C

Inter IC communication functions. More...

Functions

void i2c_init (littleWire *lwHandle)
 
unsigned char i2c_start (littleWire *lwHandle, unsigned char address7bit, unsigned char direction)
 
void i2c_write (littleWire *lwHandle, unsigned char *sendBuffer, unsigned char length, unsigned char endWithStop)
 
void i2c_read (littleWire *lwHandle, unsigned char *readBuffer, unsigned char length, unsigned char endWithStop)
 
void i2c_updateDelay (littleWire *lwHandle, unsigned int duration)
 

Detailed Description

Inter IC communication functions.

Function Documentation

void i2c_init ( littleWire *  lwHandle)

Initialize the I2C module on the Little-Wire

Returns
(none)

Definition at line 282 of file littleWire.c.

void i2c_read ( littleWire *  lwHandle,
unsigned char *  readBuffer,
unsigned char  length,
unsigned char  endWithStop 
)

Read byte(s) over i2c bus

Parameters
lwHandlelittleWire device pointer
readBufferReturned message array
lengthMessage length -> Max = 8
endWithStopShould we send a STOP condition after this buffer? ( END_WITH_STOP or NO_STOP )
Returns
(none)

Definition at line 303 of file littleWire.c.

unsigned char i2c_start ( littleWire *  lwHandle,
unsigned char  address7bit,
unsigned char  direction 
)

Start the i2c communication

Parameters
lwHandlelittleWire device pointer
address7 bit slave address.
direction( READ or WRITE )
Returns
1 if received ACK

Definition at line 287 of file littleWire.c.

void i2c_updateDelay ( littleWire *  lwHandle,
unsigned int  duration 
)

Update i2c signal delay amount. Tune if neccessary to fit your requirements.

Parameters
lwHandlelittleWire device pointer
durationDelay amount
Returns
(none)

Definition at line 320 of file littleWire.c.

void i2c_write ( littleWire *  lwHandle,
unsigned char *  sendBuffer,
unsigned char  length,
unsigned char  endWithStop 
)

Send byte(s) over i2c bus

Parameters
lwHandlelittleWire device pointer
sendBufferMessage array to send
lengthMessage length -> Max = 4
endWithStopShould we send a STOP condition after this buffer? ( END_WITH_STOP or NO_STOP )
Returns
(none)

Definition at line 298 of file littleWire.c.