rt-thread 下,配置 stm32 的 sensor

以 aht10 为例

用法见 这里

注意, 由于 aht 为温湿度传感器,因此,sensor 框架会抽象出 温度和湿度两个设备

1
rt_hw_aht10_init("aaa", &cfg);

list_device 查看结果

1
2
3
4
5
6
7
device           type         ref count
-------- -------------------- ----------
humi_aaa Sensor Device 0
temp_aaa Sensor Device 0
i2c1 I2C Bus 0
uart1 Character Device 2
pin Miscellaneous Device 0