STM32F0开发笔记4: STM32CubeF0固件架构

来源:互联网 发布:netbsd源码 编辑:程序博客网 时间:2024/05/20 16:11

    本文介绍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实际上是一个快速、轻量级、专家导向层更接近与硬件。)
 

    其它的就不介绍了,理解起来应该没有什么问题。

有任何问题欢迎留言,我尽最大可能予以解答,知而获智,智达高远。
原创性文章,转载请注明出处 http://user.qzone.qq.com/2756567163 
CSDN:http://blog.csdn.net/qingwufeiyang12346   
1 0
原创粉丝点击