summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorrtthread-bot <[email protected]>2021-04-21 16:41:19 +0000
committerrtthread-bot <[email protected]>2021-04-21 16:41:19 +0000
commit8278898783501d896093cf73eb5d77c7e4395103 (patch)
tree6fcf5158d58def2892fc98e1050e8cfd22075249 /components/drivers/include
parent490b2be755f5aa7231c760f4937bf5934b59a3dd (diff)
parentce14c4aae0addead901a2367f128e03f656ea5c7 (diff)
Merge remote-tracking branch 'rtt_gitee/gitee_master'
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/i2c.h4
-rw-r--r--components/drivers/include/drivers/i2c_dev.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/i2c.h b/components/drivers/include/drivers/i2c.h
index 50ce021d53..7bf99d26cc 100644
--- a/components/drivers/include/drivers/i2c.h
+++ b/components/drivers/include/drivers/i2c.h
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2012-04-25 weety first version
+ * 2021-04-20 RiceChen added support for bus control api
*/
#ifndef __I2C_H__
@@ -74,6 +75,9 @@ struct rt_i2c_bus_device *rt_i2c_bus_device_find(const char *bus_name);
rt_size_t rt_i2c_transfer(struct rt_i2c_bus_device *bus,
struct rt_i2c_msg msgs[],
rt_uint32_t num);
+rt_err_t rt_i2c_control(struct rt_i2c_bus_device *bus,
+ rt_uint32_t cmd,
+ rt_uint32_t arg);
rt_size_t rt_i2c_master_send(struct rt_i2c_bus_device *bus,
rt_uint16_t addr,
rt_uint16_t flags,
diff --git a/components/drivers/include/drivers/i2c_dev.h b/components/drivers/include/drivers/i2c_dev.h
index 94f110c055..080ff26f87 100644
--- a/components/drivers/include/drivers/i2c_dev.h
+++ b/components/drivers/include/drivers/i2c_dev.h
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2012-04-25 weety first version
+ * 2021-04-20 RiceChen added bus clock command
*/
#ifndef __I2C_DEV_H__
@@ -21,6 +22,7 @@ extern "C" {
#define RT_I2C_DEV_CTRL_ADDR 0x21
#define RT_I2C_DEV_CTRL_TIMEOUT 0x22
#define RT_I2C_DEV_CTRL_RW 0x23
+#define RT_I2C_DEV_CTRL_CLK 0x24
struct rt_i2c_priv_data
{