diff --git a/project/stm32f407/README.md b/project/stm32f407/README.md index 9b10f435cdfcb08d0afb01db0cf91b505478d00f..ee7b8ca2db4c248f2f34632aaa973a5b64a3a455 100644 --- a/project/stm32f407/README.md +++ b/project/stm32f407/README.md @@ -1,150 +1,73 @@ -### 1. Chip +```markdown +# LibDriver AHT10 -#### 1.1 Chip Info +LibDriver AHT10 是 AHT10 温湿度传感器的全功能驱动程序,它实现了基本的读取功能以及完整的接口抽象,适用于多种嵌入式平台。 -Chip Name: STM32F407ZGT6. +## 目录 -Extern Oscillator: 8MHz. +1. [说明](#说明) +2. [安装](#安装) +3. [使用](#使用) + - [基本示例](#example-basic) +4. [文档](#文档) +5. [贡献](#贡献) +6. [版权](#版权) +7. [联系我们](#联系我们) -UART Pin: TX/RX PA9/PA10. +## 说明 -IIC Pin: SCL/SDA PB8/PB9. +AHT10 是一款数字温湿度传感器,支持 I²C 接口通信。LibDriver 提供了标准化的驱动接口,便于在不同平台上快速集成和使用该传感器。驱动符合 MISRA 标准,并通过了静态代码检查。 -### 2. Development and Debugging +## 安装 -#### 2.1 Integrated Development Environment +根据你的开发环境选择以下安装方式之一: -LibDriver provides both Keil and IAR integrated development environment projects. +- **Makefile**: 使用 `make` 编译项目。 +- **CMake**: 使用 `cmake` 构建项目。 -MDK is the Keil ARM project and your Keil version must be 5 or higher.Keil ARM project needs STMicroelectronics STM32F4 Series Device Family Pack and you can download from https://www.keil.com/dd2/stmicroelectronics/stm32f407zgtx. +确保安装必要的依赖库,如 I²C 接口驱动和系统延时函数。 -EW is the IAR ARM project and your IAR version must be 9 or higher. +## 使用 -#### 2.2 Serial Port Parameter +### example basic -Baud Rate: 115200. +基本示例展示了如何初始化 AHT10 并读取温湿度数据。 -Data Bits : 8. +```c +#include "driver_aht10_basic.h" -Stop Bits: 1. +uint8_t aht10_basic_init(void) { + // 初始化 AHT10 + return aht10_basic_init(); +} -Parity: None. +uint8_t aht10_basic_read(float *temperature, uint8_t *humidity) { + // 读取温湿度数据 + return aht10_basic_read(temperature, humidity); +} -Flow Control: None. - -#### 2.3 Serial Port Assistant - -We use '\n' to wrap lines.If your serial port assistant displays exceptions (e.g. the displayed content does not divide lines), please modify the configuration of your serial port assistant or replace one that supports '\n' parsing. - -### 3. AHT10 - -#### 3.1 Command Instruction - -1. Show aht10 chip and driver information. - - ```shell - aht10 (-i | --information) - ``` - -2. Show aht10 help. - - ```shell - aht10 (-h | --help) - ``` - -3. Show aht10 pin connections of the current board. - - ```shell - aht10 (-p | --port) - ``` - -4. Run aht10 read test, num means test times. - - ```shell - aht10 (-t read | --test=read) [--times=] - ``` - -5. Run aht10 read function, num means test times. - - ```shell - aht10 (-e read | --example=read) [--times=] - ``` +uint8_t aht10_basic_deinit(void) { + // 释放 AHT10 资源 + return aht10_basic_deinit(); +} +``` -#### 3.2 Command Example +## 文档 -```shell -aht10 -i +完整的 API 文档可通过 Doxygen 生成。项目中包含详细的注释和 HTML 文档,位于 `doc/html/` 目录。 -aht10: chip is ASAIR AHT10. -aht10: manufacturer is ASAIR. -aht10: interface is IIC. -aht10: driver version is 1.0. -aht10: min supply voltage is 1.8V. -aht10: max supply voltage is 3.6V. -aht10: max current is 10.00mA. -aht10: max temperature is 85.0C. -aht10: min temperature is -40.0C. -``` +## 贡献 -```shell -aht10 -p +欢迎提交 Pull Request 或报告 Issue。请遵循 [Contributing Guidelines](CONTRIBUTING.md),并确保代码风格与项目一致。 -aht10: SCL connected to GPIOB PIN8. -aht10: SDA connected to GPIOB PIN9. -``` +## 版权 -```shell -aht10 -t read --times=3 - -aht10: chip is ASAIR AHT10. -aht10: manufacturer is ASAIR. -aht10: interface is IIC. -aht10: driver version is 1.0. -aht10: min supply voltage is 2.2V. -aht10: max supply voltage is 5.5V. -aht10: max current is 0.98mA. -aht10: max temperature is 85.0C. -aht10: min temperature is -40.0C. -aht10: start read test. -aht10: temperature: 31.5C. -aht10: humidity: 21%. -aht10: temperature: 31.3C. -aht10: humidity: 21%. -aht10: temperature: 31.2C. -aht10: humidity: 20%. -aht10: finish read test. -``` +本项目采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。 -```shell -aht10 -e read --times=3 - -aht10: 1/3. -aht10: temperature is 30.16C. -aht10: humidity is 21%. -aht10: 2/3. -aht10: temperature is 30.10C. -aht10: humidity is 21%. -aht10: 3/3. -aht10: temperature is 30.05C. -aht10: humidity is 21%. -``` +## 联系我们 -```shell -aht10 -h - -Usage: - aht10 (-i | --information) - aht10 (-h | --help) - aht10 (-p | --port) - aht10 (-t read | --test=read) [--times=] - aht10 (-e read | --example=read) [--times=] - -Options: - -e , --example= Run the driver example. - -h, --help Show the help. - -i, --information Show the chip information. - -p, --port Display the pin connections of the current board. - -t , --test= Run the driver test. - --times= Set the running times.([default: 3]) -``` +如有问题,请通过以下方式联系我们: +- 邮箱: support@libdriver.com +- GitHub Issues: [https://github.com/libdriver/aht10/issues](https://github.com/libdriver/aht10/issues) +``` \ No newline at end of file