提交 6339c394 编写于 作者: mysterywolf's avatar mysterywolf

[sensor] use arg to replace user_data

上级 1537544f
...@@ -19,7 +19,7 @@ int sensor_init(void) ...@@ -19,7 +19,7 @@ int sensor_init(void)
cfg.intf.type = RT_SENSOR_INTF_I2C; cfg.intf.type = RT_SENSOR_INTF_I2C;
cfg.intf.dev_name = "i2c3"; cfg.intf.dev_name = "i2c3";
cfg.intf.user_data = (void *)MPU6XXX_ADDR_DEFAULT; cfg.intf.arg = (void *)MPU6XXX_ADDR_DEFAULT;
cfg.irq_pin.pin = RT_PIN_NONE; cfg.irq_pin.pin = RT_PIN_NONE;
rt_hw_mpu6xxx_init("icm", &cfg); rt_hw_mpu6xxx_init("icm", &cfg);
...@@ -40,7 +40,7 @@ int rt_hw_aht10_port(void) ...@@ -40,7 +40,7 @@ int rt_hw_aht10_port(void)
struct rt_sensor_config cfg; struct rt_sensor_config cfg;
cfg.intf.dev_name = AHT10_I2C_BUS; cfg.intf.dev_name = AHT10_I2C_BUS;
cfg.intf.user_data = (void *)AHT10_I2C_ADDR; cfg.intf.arg = (void *)AHT10_I2C_ADDR;
rt_hw_aht10_init("aht10", &cfg); rt_hw_aht10_init("aht10", &cfg);
......
...@@ -144,9 +144,9 @@ struct rt_sensor_info ...@@ -144,9 +144,9 @@ struct rt_sensor_info
struct rt_sensor_intf struct rt_sensor_intf
{ {
char *dev_name; /* The name of the communication device */ char *dev_name; /* The name of the communication device */
rt_uint8_t type; /* Communication interface type */ rt_uint8_t type; /* Communication interface type */
void *user_data; /* Private data for the sensor. ex. i2c addr,spi cs,control I/O */ void *arg; /* Interface argument for the sensor. ex. i2c addr,spi cs,control I/O */
}; };
struct rt_sensor_config struct rt_sensor_config
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册