XBee Firmware Library  1.6.0
Functions
Inter-Integrated Circuit (I2C)

Functions

int i2c_config (uint8_t config)
 Initializes and configures the I2C interface. More...
 
ssize_t i2c_read (void *buf, size_t len)
 Reads the specified number of bytes from the I2C interface. More...
 
void i2c_set_addr (uint8_t addr)
 Sets the device (chip) i2c physical address. More...
 
ssize_t i2c_write (const void *buf, size_t len)
 Writes the specified bytes through the I2C interface. More...
 
ssize_t i2c_write_no_stop (const void *buf, size_t len)
 Writes the specified bytes through the I2C interface without sending a stop condition at the end of the transfer. More...
 

Detailed Description

Platform-specific layer provides a consistent I2C API to upper layers of the driver.

I2C API Overview

This API contains the functions to configure and control the I2C communication interface of programmable XBee devices. The inter-integrated circuit (IIC) provides a method of communication between a number of devices. The interface is designed to operate up to 100kbps with maximum bus loading and timing.

Function Documentation

int i2c_config ( uint8_t  config)

Initializes and configures the I2C interface.

Parameters
[in]configa byte containing the configuration masks for the I2C interface. At the moment this parameter is not used, it is reserved for future use.
Return values
0on success.
ssize_t i2c_read ( void *  buf,
size_t  len 
)

Reads the specified number of bytes from the I2C interface.

Parameters
[out]bufthe buffer where the read bytes will be stored.
[in]lenthe number of bytes to read.
Return values
ssize_tthe number of bytes read on success or the error code on failure.
void i2c_set_addr ( uint8_t  addr)

Sets the device (chip) i2c physical address.

Parameters
[in]addrthe slave address to be used by the I2C module expressed in 7 bits. This means, not left shifted.
Return values
None.
ssize_t i2c_write ( const void *  buf,
size_t  len 
)

Writes the specified bytes through the I2C interface.

Parameters
[in]bufbuffer containing the bytes that will be written.
[in]lenthe number of bytes to write from the buffer.
Return values
ssize_tthe number of bytes written on success or the error code on failure.
ssize_t i2c_write_no_stop ( const void *  buf,
size_t  len 
)

Writes the specified bytes through the I2C interface without sending a stop condition at the end of the transfer.

Parameters
[in]bufa buffer containing the bytes that will be written.
[in]lenthe number of bytes to write from the buffer.
Return values
ssize_tthe number of bytes written on success or the error code on failure.