单片机型号:STM32CubeF0
本文介绍STM32CubeF0固件架构。
STM32CubeF0固件架构图如下图所示。
1、Board Support Package (BSP)
This layer offers a set of APIs relative to the hardware components in the hardware boards
(such as LCD, Audio, microSD and MEMS drivers). It is composed of two parts:
• Component
This is the driver relative to the external device on the board and not to the STM32. The
component driver provide specific APIs to the BSP driver external components and could be portable on any other board.
• BSP driver
It allows linking the component driver to a specific board and provides a set of user friendly APIs. The API naming rule is BSP_FUNCT_Action().Example: BSP_LED_Init(), BSP_LED_On()
The BSP is based on a modular architecture allowing an easy porting on any hardware by just implementing the low-level routines.
(大意:BSP是板级支持包的意思,分为2个部分:组件和BSP驱动。组件是线路板上扩展器件的驱动,而非STM32,组件提供了特定的API用于BSP驱动这些外部组件并且在其它板上移植。BSP驱动用于连接组件到指定的线路板,并提供一系列用户友好的API。这些API遵循BSP_FUNCT_Action的命名规则。BSP基于模块化结构,便于移植。)
2、Hardware Abstraction Layer (HAL) and Low Layer (LL)
The STM32CubeF0 HAL and LL are complementary and cover a wide range of applications
requirements: (大意:STM32CubeF0覆盖了极广泛的用户需求)
The HAL drivers offer high-level function-oriented highly-portable APIs. They hide the
MCU and peripheral complexity to end user.The HAL drivers provide generic multi-instance feature-oriented APIs which simplify user application implementation by providing ready to use process. As example, for the communication peripherals (I2S, UART…), it provides APIs allowing initializing and configuring the peripheral, managing data transfer based on polling, interrupt or DMA process, and handling communication errors that may raise during communication. The HAL driver APIs are split in two categories:
– Generic APIs which provides common and generic functions to all the STM32Series
– Extension APIs which provides specific and customized functions for a specific family or a specific part number.
(大意:HAL提供了高层、功能导向和高便捷性的API,它对最终用户隐藏了MCU和外设的复杂性。通过使用进程的方式,HAL驱动提供了多实例、特性导向的API用于简化用户的应用程序设计。例如,I2S和UART,它提供了初始化和配置外设进程,管理数据传输(轮询、中断和DMA)进程,以及在通讯过程中降低误码率的进程。HAL驱动包含2组:一般和扩展。)
The Low Layer APIs provide low-level APIs at register level, with better optimization but
less portability. They require a deep knowledge of MCU and peripheral specifications. The LL drivers are designed to offer a fast light-weight expert-oriented layer which is closer to the hardware than the HAL. Contrary to the HAL, LL APIs are not provided for peripherals where optimized access is not a key feature, or for those requiring heavy software configuration and/or complex upper-level stack (such as USB).
The LL drivers feature:
– A set of functions to initialize peripheral main features according to the parameters
specified in data structures
– A set of functions used to fill initialization data structures with the reset values
corresponding to each field
– Function for peripheral de-initialization (peripheral registers restored to their
default values)
– A set of inline functions for direct and atomic register access
– Full independence from HAL and capability to be used in standalone mode (without HAL drivers)
– Full coverage of the supported peripheral features.
(大意:底层API提供寄存器级底层API,可以用于优化系统系能但移植性较低。他们需要对MCU和外设有一个较深的理解。LL实际上是一个快速、轻量级、专家导向层更接近与硬件。)
其它的就不介绍了,理解起来应该没有什么问题。
上一篇:STM32开发笔记10: HAL_Init函数
下一篇:STM32开发笔记8: STM32CubeF0介绍
推荐阅读最新更新时间:2024-11-09 09:53
设计资源 培训 开发板 精华推荐
- LTC3450EUD 演示板,三路输出 TFT-LCD 电源,Vin = 1.5V 至 4.6V,Vout = 5.1V/10mA、15V/500uA、-10V/500uA
- 用于维恩桥振荡器的 LMV821SQ3T2G 单路低电压运算放大器的典型应用电路
- 使用 Analog Devices 的 LT3467AES67 的参考设计
- 明日方舟 罗德岛主题装饰灯 触摸调节 USB供电 8022W
- TM1638按键数码管模块
- LM324EDR2G 多反馈带通滤波器运算放大器的典型应用
- LT6654BMPS6-2.5 八路 DAC 电压基准的典型应用
- ISD1700录放电路PCB图+原理图
- LT1634AIS8-4.096 微功率电压和电流基准的典型应用
- BMA456 4 线数字、三轴加速度传感器的典型应用