Skip to content

Commit 35beea6

Browse files
committed
update README.md and version
1 parent 1afe154 commit 35beea6

File tree

2 files changed

+90
-1
lines changed

2 files changed

+90
-1
lines changed

README.md

+89
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
11
# rtt-gp2y10
22
Support the Particulate Matter sensor for GP2Y1010AU0F and GP2Y1014AU0F
3+
4+
5+
6+
## 1、介绍
7+
8+
gp2y10 软件包适用于 GP2Y10 系列光学灰尘检测传感器模块,包括 GP2Y1010AU0F 和 GP2Y1014AU0F。
9+
10+
11+
12+
### 1.1 目录结构
13+
14+
| 名称 | 说明 |
15+
| -------- | ------------------------------ |
16+
| docs | 文档目录 |
17+
| examples | 例子目录(提供两种操作示例) |
18+
| inc | 头文件目录 |
19+
| src | 源代码目录(提供两种驱动接口) |
20+
21+
驱动源代码提供两种接口,分别是自定义接口,以及 RT-Thread 设备驱动接口(open/read/control/close)。
22+
23+
24+
25+
### 1.2 许可证
26+
27+
gp2y10 软件包遵循 Apache license v2.0 许可,详见 `LICENSE` 文件。
28+
29+
30+
31+
### 1.3 依赖
32+
33+
- RT-Thread 4.0+
34+
- 使用动态创建方式需要开启动态内存管理模块
35+
- 使用 sensor 设备接口需要开启 sensor 设备驱动框架模块
36+
37+
38+
39+
## 2、获取 gp2y10 软件包
40+
41+
使用 gp2y10 package 需要在 RT-Thread 的包管理器中选择它,具体路径如下:
42+
43+
```
44+
RT-Thread online packages --->
45+
peripheral libraries and drivers --->
46+
[*] sensors drivers --->
47+
[*] GP2Y10: dust sensor by Sharp for detect air quality.
48+
```
49+
50+
然后让 RT-Thread 的包管理器自动更新,或者使用 `pkgs --update` 命令更新包到 BSP 中。
51+
52+
53+
54+
## 3、使用 gp2y10 软件包
55+
56+
### 3.1 版本说明
57+
58+
| 版本 | 说明 |
59+
| ------ | ------------------------------------------------------------ |
60+
| v0.8.0 | 支持自定义接口和 sensor 框架,已在 DHT11 和 DHT22 上完成测试 |
61+
| latest | 进一步优化 |
62+
63+
目前处于公测阶段,建议开发者使用 latest 版本。
64+
65+
66+
67+
### 3.2 配置选项
68+
69+
- 是否使用示例程序(`PKG_USING_GP2Y10_SAMPLE`
70+
- 是否使用动态内存
71+
- 是否使用 sensor 框架
72+
73+
74+
75+
## 4、注意事项
76+
77+
1. 为传感器对象提供静态创建和动态创建两种方式,如果使用动态创建,请记得在使用完毕释放对应的内存空间。
78+
2. 由于 GP2Y10 模块采用光学检测原理,因此出来需要配置 ADC 引脚,还需要指定一个 GPIO 引脚(iled_pin),用于发射光脉冲。
79+
80+
81+
82+
## 5、相关文档
83+
84+
见 docs 目录。
85+
86+
87+
88+
## 6、联系方式
89+
90+
91+
- 主页:<https://github.com/luhuadong/rtt-gp2y10>

inc/gp2y10.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <board.h>
1717
#include <sensor.h>
1818

19-
#define GP2Y10LIB_VERSION "0.0.1"
19+
#define GP2Y10LIB_VERSION "0.8.0"
2020

2121
#ifndef PKG_USING_GP2Y10_ADC_DEV_NAME
2222
#define ADC_DEV_NAME "adc1"

0 commit comments

Comments
 (0)