Line 35... |
Line 35... |
#define _I2C_H_
|
#define _I2C_H_
|
|
|
/**
|
/**
|
* i2c read function. reads a block of data with the length len
|
* i2c read function. reads a block of data with the length len
|
*
|
*
|
* \param[in] i2c_addr device adress on the i2c bus
|
* \param[in] addr device adress on the i2c bus
|
* \param[out] buf result buffer, contains the readed data when successful
|
* \param[out] buf result buffer, contains the readed data when successful
|
* \param[in] len length of the block to read
|
* \param[in] len length of the block to read
|
* \return returns non-zero if successful, else 0
|
* \return returns non-zero if successful, else 0
|
*/
|
*/
|
unsigned char i2c_read (unsigned char addr, xdata unsigned char *buf, unsigned char len);
|
unsigned char i2c_read (unsigned char addr, xdata unsigned char *buf, unsigned char len);
|
|
|
/**
|
/**
|
* i2c write function. writes a block of data with the length len
|
* i2c write function. writes a block of data with the length len
|
*
|
*
|
* \param[in] i2c_addr device adress on the i2c bus
|
* \param[in] addr device adress on the i2c bus
|
* \param[in] buf data buffer, contains the data to be written
|
* \param[in] buf data buffer, contains the data to be written
|
* \param[in] len length of the block to write
|
* \param[in] len length of the block to write
|
* \return returns non-zero if successful, else 0
|
* \return returns non-zero if successful, else 0
|
*/
|
*/
|
unsigned char i2c_write (unsigned char addr, xdata const unsigned char *buf, unsigned char len);
|
unsigned char i2c_write (unsigned char addr, xdata const unsigned char *buf, unsigned char len);
|