Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
I2C Driver Backend API

Data Structures

struct  i2c_driver_api
  Driver Operations I2C driver operations More...
struct  i2c_target_driver_api
  Driver Operations I2C Target driver operations More...

Typedefs

typedef int(* i2c_api_configure_t) (const struct device *dev, uint32_t dev_config)
 Callback API to configure the I2C controller.
typedef int(* i2c_api_get_config_t) (const struct device *dev, uint32_t *dev_config)
 Callback API to get the current configuration of the I2C controller.
typedef int(* i2c_api_full_io_t) (const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr)
 Callback API to transfer messages on the I2C bus in controller mode.
typedef int(* i2c_api_target_register_t) (const struct device *dev, struct i2c_target_config *cfg)
 Callback API to register a target device on the I2C controller.
typedef int(* i2c_api_target_unregister_t) (const struct device *dev, struct i2c_target_config *cfg)
 Callback API to unregister a target device from the I2C controller.
typedef int(* i2c_api_transfer_cb_t) (const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr, i2c_callback_t cb, void *userdata)
 Callback API to transfer messages on the I2C bus asynchronously.
typedef void(* i2c_api_iodev_submit) (const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
 Callback API to submit an RTIO request to the I2C controller.
typedef int(* i2c_api_recover_bus_t) (const struct device *dev)
 Callback API to recover the I2C bus.
typedef int(* i2c_target_api_register_t) (const struct device *dev)
 Callback API to instruct the I2C target device to register itself.
typedef int(* i2c_target_api_unregister_t) (const struct device *dev)
 Callback API to instruct the I2C target device to unregister itself.

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a I2C driver.

Typedef Documentation

◆ i2c_api_configure_t

typedef int(* i2c_api_configure_t) (const struct device *dev, uint32_t dev_config)

#include <zephyr/drivers/i2c.h>

Callback API to configure the I2C controller.

See i2c_configure() for argument description.

◆ i2c_api_full_io_t

typedef int(* i2c_api_full_io_t) (const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr)

#include <zephyr/drivers/i2c.h>

Callback API to transfer messages on the I2C bus in controller mode.

See i2c_transfer() for argument description.

◆ i2c_api_get_config_t

typedef int(* i2c_api_get_config_t) (const struct device *dev, uint32_t *dev_config)

#include <zephyr/drivers/i2c.h>

Callback API to get the current configuration of the I2C controller.

See i2c_get_config() for argument description.

◆ i2c_api_iodev_submit

typedef void(* i2c_api_iodev_submit) (const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)

#include <zephyr/drivers/i2c.h>

Callback API to submit an RTIO request to the I2C controller.

See i2c_iodev_submit() for argument description.

◆ i2c_api_recover_bus_t

typedef int(* i2c_api_recover_bus_t) (const struct device *dev)

#include <zephyr/drivers/i2c.h>

Callback API to recover the I2C bus.

See i2c_recover_bus() for argument description.

◆ i2c_api_target_register_t

typedef int(* i2c_api_target_register_t) (const struct device *dev, struct i2c_target_config *cfg)

#include <zephyr/drivers/i2c.h>

Callback API to register a target device on the I2C controller.

See i2c_target_register() for argument description.

◆ i2c_api_target_unregister_t

typedef int(* i2c_api_target_unregister_t) (const struct device *dev, struct i2c_target_config *cfg)

#include <zephyr/drivers/i2c.h>

Callback API to unregister a target device from the I2C controller.

See i2c_target_unregister() for argument description.

◆ i2c_api_transfer_cb_t

typedef int(* i2c_api_transfer_cb_t) (const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr, i2c_callback_t cb, void *userdata)

#include <zephyr/drivers/i2c.h>

Callback API to transfer messages on the I2C bus asynchronously.

See i2c_transfer_cb() for argument description.

◆ i2c_target_api_register_t

typedef int(* i2c_target_api_register_t) (const struct device *dev)

#include <zephyr/drivers/i2c.h>

Callback API to instruct the I2C target device to register itself.

See i2c_target_driver_register() for argument description.

◆ i2c_target_api_unregister_t

typedef int(* i2c_target_api_unregister_t) (const struct device *dev)

#include <zephyr/drivers/i2c.h>

Callback API to instruct the I2C target device to unregister itself.

See i2c_target_driver_unregister() for argument description.