i2c.c File Reference

I2C generic driver functions (implementation). More...

#include "i2c.h"
#include "cfg/cfg_i2c.h"
#include <cfg/compiler.h>

Go to the source code of this file.

Functions

bool i2c_send (const void *_buf, size_t count)
 Send a sequence of bytes in master transmitter mode to the selected slave device through the I2C bus.
bool i2c_recv (void *_buf, size_t count)
 Receive a sequence of one or more bytes from the selected slave device in master receive mode through the I2C bus.

Detailed Description

I2C generic driver functions (implementation).

Author:
Francesco Sacchi <batt@develer.com>

Definition in file i2c.c.


Function Documentation

bool i2c_recv ( void *  _buf,
size_t  count 
)

Receive a sequence of one or more bytes from the selected slave device in master receive mode through the I2C bus.

Received data is placed in buf.

Note:
a NACK is automatically given on the last received byte.
Returns:
true on success, false on error

Definition at line 70 of file i2c.c.

bool i2c_send ( const void *  _buf,
size_t  count 
)

Send a sequence of bytes in master transmitter mode to the selected slave device through the I2C bus.

Returns:
true on success, false on error.

Definition at line 46 of file i2c.c.