diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..2979e6c8e365405210c73783cc931514f0f6c9bc --- /dev/null +++ b/README.en.md @@ -0,0 +1,48 @@ +# APM32F402-R-MDK Project Description + +This project is an MDK development template based on the APM32F402 series microcontrollers. It provides complete hardware driver support and system initialization code, suitable for embedded development. + +## Project Structure + +- **APM32Libs**: Contains microcontroller peripheral driver functions, such as ADC, CAN, DMA, GPIO, I2C, SPI, USB, etc. +- **CMSIS**: ARM Cortex-M series core support files, including system control register definitions, interrupt control, system clock configuration, etc. +- **Start**: System startup files, including system initialization, clock configuration, and interrupt vector table. +- **User**: User code directory, containing the `main.c` example code to initialize LEDs and buttons and implement basic control logic. + +## Main Functional Modules + +- **Peripheral Drivers**: Provides complete peripheral driver functions supporting ADC, CAN, DMA, GPIO, I2C, SPI, USB, and more. +- **System Initialization**: Configures system clock, interrupt vector table offset, etc. +- **Hardware Abstraction Layer**: Provides a unified hardware access interface, facilitating porting and maintenance. + +## Usage Instructions + +### Development Environment + +- **Development Tools**: Keil MDK-ARM +- **Target Chip**: APM32F402 series microcontroller + +### Compilation and Download + +1. Open the `Project.uvprojx` project file. +2. Click the "Build" button to compile the project. +3. Use a debugger to download the program to the target chip. +4. Run the program and observe the behavior of the LEDs and buttons. + +### Example Code Description + +- `initLed()`: Initializes the LED pin as an output mode. +- `getLED2State()`: Gets the current state of LED2. +- `initKey()`: Initializes the button pin as an input mode. +- `getKeyState()`: Reads the button state. +- `main()`: The main function, initializes hardware, and enters the main loop to control the LED based on the button state. + +## Notes + +- When using peripheral drivers, ensure that the clock and pin multiplexing functions are correctly configured. +- When modifying system clock configurations, refer to the data manual to ensure the configuration meets chip requirements. +- Users can extend functionality in `main.c` to implement more complex application logic. + +## Copyright Information + +This project follows an open-source license. Please refer to the LICENSE file in the project for detailed information. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2c2f82df4aa9c591661f9e42b37ab92dc533aef3 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# APM32F402-R-MDK 项目说明 + +本项目是基于 APM32F402 系列微控制器的 MDK 开发模板,提供了完整的硬件驱动支持和系统初始化代码,适用于嵌入式开发。 + +## 项目结构 + +- **APM32Libs**:包含微控制器外设驱动函数,如 ADC、CAN、DMA、GPIO、I2C、SPI、USB 等。 +- **CMSIS**:ARM Cortex-M 系列内核支持文件,包括系统控制寄存器定义、中断控制、系统时钟配置等。 +- **Start**:系统启动文件,包含系统初始化、时钟配置和中断向量表。 +- **User**:用户代码目录,包含 `main.c` 示例代码,用于初始化 LED 和按键并实现基本控制逻辑。 + +## 主要功能模块 + +- **外设驱动**:提供完整的外设驱动函数,支持 ADC、CAN、DMA、GPIO、I2C、SPI、USB 等功能。 +- **系统初始化**:配置系统时钟、中断向量表偏移等。 +- **硬件抽象层**:提供统一的硬件访问接口,便于移植和维护。 + +## 使用说明 + +### 开发环境 + +- **开发工具**:Keil MDK-ARM +- **目标芯片**:APM32F402 系列微控制器 + +### 编译与下载 + +1. 打开 `Project.uvprojx` 工程文件。 +2. 点击 "Build" 按钮编译工程。 +3. 使用调试器将程序下载到目标芯片中。 +4. 运行程序并观察 LED 和按键的行为。 + +### 示例代码说明 + +- `initLed()`:初始化 LED 引脚为输出模式。 +- `getLED2State()`:获取 LED2 的当前状态。 +- `initKey()`:初始化按键引脚为输入模式。 +- `getKeyState()`:读取按键状态。 +- `main()`:主函数,初始化硬件并进入主循环,根据按键状态控制 LED。 + +## 注意事项 + +- 在使用外设驱动时,请确保已正确配置时钟和引脚复用功能。 +- 修改系统时钟配置时,请参考数据手册确保配置符合芯片要求。 +- 用户可根据需求扩展 `main.c` 中的功能,实现更复杂的应用逻辑。 + +## 版权信息 + +本项目遵循开源协议,请参考项目中的 LICENSE 文件获取详细信息。 \ No newline at end of file