-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename STM32.md to STM32.rst
- Loading branch information
Showing
2 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
Embassy STM32 硬件抽象层 | ||
========================== | ||
|
||
.. seealso:: https://embassy.dev/book/dev/stm32.html | ||
|
||
`Embassy_STM32_硬件抽象层 <https://github.com/embassy-rs/embassy/tree/master/embassy-stm32>`_ 建立于 ``stm32-metapac`` 基础之上。 | ||
|
||
芯片系列与版本繁多的问题 | ||
--------------------- | ||
|
||
STM32 微控制器有很多系列,支持所有系列是一项艰巨的任务。STM32 不同芯片系列的外设版本是相同的,Embassy 充分利用了的这个特征。Embassy 没有为每个 STM32 芯片系列都去实现一个外设接口,对于外设版本相同的 STM32 系列,会被代码生成相同的寄存器类型,Embassy 只针对不同寄存器类型,有一个单独的 SPI 实现。 | ||
|
||
外设的元信息 | ||
--------------------- | ||
|
||
``stm32-metapac`` 模块生成寄存器类型时,使用了 STM32 芯片系列预先生成的芯片和寄存器定义。这是在编译时根据 Cargo 功能标志完成的。 | ||
|
||
芯片和寄存器定义位于单独的 ``stm32-data`` 模块中,每当定义中发现错误,或添加对新芯片系列的支持时,就会对其进行修改。 | ||
|
||
硬件抽象层(HAL) | ||
--------------------- | ||
``embassy-stm32`` 模块包含了 STM32 全系列的硬件层抽象实现。对于给定芯片系列和外设版本,该实现使用自动派生出的特性标记,来支持相对应的版本。 | ||
|
||
定时器的驱动程序 | ||
--------------------- | ||
|
||
STM32 定时器驱动程序默认工作频率为 32768 Hz。 |