![]() |
RTEMS 6.1
|
Inter-Integrated Circuit (I2C) Driver API. More...
#include <linux/i2c.h>#include <linux/i2c-dev.h>#include <rtems.h>#include <rtems/seterr.h>#include <rtems/thread.h>#include <sys/ioctl.h>#include <sys/stat.h>Go to the source code of this file.
Data Structures | |
| struct | i2c_bus |
| I2C bus control. More... | |
| struct | i2c_dev |
| I2C slave device control. More... | |
Macros | |
| #define | I2C_BUS_CLOCK_DEFAULT 100000 |
| Default I2C bus clock in Hz. | |
| #define | I2C_BUS_NOBLOCK (1u << 0) |
| I2C bus transfer flag to indicate that the task should not block if the bus is busy on a new transfer. | |
| #define | I2C_DEV_IO_CONTROL 0x900 |
| Base number for device IO control commands. | |
I2C IO Control Commands | |
| #define | I2C_BUS_OBTAIN 0x800 |
| Obtains the bus. | |
| #define | I2C_BUS_RELEASE 0x801 |
| Releases the bus. | |
| #define | I2C_BUS_GET_CONTROL 0x802 |
| Gets the bus control. | |
| #define | I2C_BUS_SET_CLOCK 0x803 |
| Sets the bus clock in Hz. | |
Typedefs | |
| typedef struct i2c_msg | i2c_msg |
| typedef struct i2c_bus | i2c_bus |
| typedef struct i2c_dev | i2c_dev |
| typedef struct i2c_rdwr_ioctl_data | i2c_rdwr_ioctl_data |
Functions | |
| int | i2c_bus_init (i2c_bus *bus) |
| Initializes a bus control. | |
| i2c_bus * | i2c_bus_alloc_and_init (size_t size) |
| Allocates a bus control from the heap and initializes it. | |
| void | i2c_bus_destroy (i2c_bus *bus) |
| Destroys a bus control. | |
| void | i2c_bus_destroy_and_free (i2c_bus *bus) |
| Destroys a bus control and frees its memory. | |
| int | i2c_bus_register (i2c_bus *bus, const char *bus_path) |
| Registers a bus control. | |
| int | i2c_bus_try_obtain (i2c_bus *bus) |
| Try to obtain the bus. | |
| void | i2c_bus_obtain (i2c_bus *bus) |
| Obtains the bus. | |
| void | i2c_bus_release (i2c_bus *bus) |
| Releases the bus. | |
| int | i2c_bus_transfer (i2c_bus *bus, i2c_msg *msgs, uint32_t msg_count) |
| Transfers I2C messages. | |
| int | i2c_bus_do_transfer (i2c_bus *bus, i2c_msg *msgs, uint32_t msg_count, uint32_t flags) |
| Transfers I2C messages with optional flags. | |
| int | i2c_dev_init (i2c_dev *dev, const char *bus_path, uint16_t address) |
| Initializes a device control. | |
| i2c_dev * | i2c_dev_alloc_and_init (size_t size, const char *bus_path, uint16_t address) |
| Allocates a device control from the heap and initializes it. | |
| void | i2c_dev_destroy (i2c_dev *dev) |
| Destroys a device control. | |
| void | i2c_dev_destroy_and_free (i2c_dev *dev) |
| Destroys a device control and frees its memory. | |
| int | i2c_dev_register (i2c_dev *dev, const char *dev_path) |
| Registers a device control. | |
Inter-Integrated Circuit (I2C) Driver API.