![]() |
i2c
1.4.2
RoadNarrows Robotics I2C Package
|
I2C python C interface header. More...
#include "rnr/rnrconfig.h"Go to the source code of this file.
Functions | |
| int | i2ccore_open (const char *device) |
| Open a I2C bus device. More... | |
| int | i2ccore_close (int fd) |
| Close an open I2C bus device. More... | |
| int | i2ccore_read (int fd, unsigned short cur_addr, unsigned short addr, byte_t buf[], unsigned int len) |
| Read data from an attached device connected to the open I2C bus. More... | |
| int | i2ccore_write (int fd, unsigned short cur_addr, unsigned short addr, byte_t buf[], unsigned int len) |
| Write data to an attached device connected to the open I2C bus. More... | |
| int | i2ccore_transfer (int fd, unsigned short cur_addr, unsigned short addr, byte_t wbuf[], unsigned int wcount, byte_t rbuf[], unsigned int rcount) |
| Transfer data to an attached device connected to the open I2C bus reead back. More... | |
| int | i2ccore_check (int fd, unsigned short cur_addr, unsigned short addr) |
| Test for the existence of a device with the given address. More... | |
I2C python C interface header.
Definition in file i2ccore.h.
| int i2ccore_check | ( | int | fd, |
| unsigned short | cur_addr, | ||
| unsigned short | addr | ||
| ) |
Test for the existence of a device with the given address.
| fd | File descriptor. |
| cur_addr | I2C address of last I/O operation. |
| addr | I2C device address to read. |
Definition at line 3414 of file i2ccore_wrap.c.
References i2c_struct::addr, i2c_struct::fd, i2c_exists(), i2ccore_close(), i2ccore_open(), i2ccore_read(), i2ccore_transfer(), and i2ccore_write().
| int i2ccore_close | ( | int | fd | ) |
Close an open I2C bus device.
Definition at line 3309 of file i2ccore_wrap.c.
References i2c_struct::fd, and i2c_close().
Referenced by i2ccore_check().
| int i2ccore_open | ( | const char * | device | ) |
Open a I2C bus device.
| device | Device name. |
Definition at line 3292 of file i2ccore_wrap.c.
References i2c_struct::fd, and i2c_open().
Referenced by i2ccore_check().
| int i2ccore_read | ( | int | fd, |
| unsigned short | cur_addr, | ||
| unsigned short | addr, | ||
| byte_t | buf[], | ||
| unsigned int | count | ||
| ) |
Read data from an attached device connected to the open I2C bus.
| fd | File descriptor. | |
| cur_addr | I2C address of last I/O operation. | |
| addr | I2C device address to read. | |
| [out] | buf | Output buffer. |
| count | Number of byte to read. |
Definition at line 3333 of file i2ccore_wrap.c.
References i2c_struct::addr, i2c_struct::fd, and i2c_read().
Referenced by i2ccore_check().
| int i2ccore_transfer | ( | int | fd, |
| unsigned short | cur_addr, | ||
| unsigned short | addr, | ||
| byte_t | wbuf[], | ||
| unsigned int | wcount, | ||
| byte_t | rbuf[], | ||
| unsigned int | rcount | ||
| ) |
Transfer data to an attached device connected to the open I2C bus reead back.
| fd | File descriptor. | |
| cur_addr | I2C address of last I/O operation. | |
| addr | I2C device address to read. | |
| [in] | wbuf | Input buffer. |
| wcount | Number of byte to write. | |
| [out] | rbuf | Output buffer. |
| rcount | Number of byte to read. |
Definition at line 3390 of file i2ccore_wrap.c.
References i2c_struct::addr, i2c_struct::fd, and i2c_transfer().
Referenced by i2ccore_check().
| int i2ccore_write | ( | int | fd, |
| unsigned short | cur_addr, | ||
| unsigned short | addr, | ||
| byte_t | buf[], | ||
| unsigned int | count | ||
| ) |
Write data to an attached device connected to the open I2C bus.
| fd | File descriptor. | |
| cur_addr | I2C address of last I/O operation. | |
| addr | I2C device address to read. | |
| [in] | buf | Input buffer. |
| count | Number of byte to write. |
Definition at line 3360 of file i2ccore_wrap.c.
References i2c_struct::addr, i2c_struct::fd, and i2c_write().
Referenced by i2ccore_check().