一、介绍CMISIS
什么是CMSIS(cortex microcontrol software interface standard一种软件标准接口),官网地址:https://arm-software.github.io/CMSIS_6/latest/General/index.html
包含的core、driver、RTOS、dsp、nn等部分,这些源码文件的编写有的是ARM官方编写,有的是半导体厂商编写,标准是ARM联合这些半导体厂商联合制定的。
二、CMSIS-core部分介绍
一般工程都需要包含CMSIS-core部分文件,包括启动文件,系统初始化文件还有头文件等
启动文件:
系统初始化和一些头文件:
system_stm32f10x.c
至于其作用,解释几个头文件,stm32f10x.h是stm32f10x系列单片机寄存器定义的头文件,core_cm3.h 是ARM对cortex-M3系列单片机做出的统一标准等,至此就是对CMSIS-core部分的大致介绍。
三、CMSIS RTE框架的介绍
一些重要或者有必要了解的头文件:
RTE_Device.h 管理外设驱动
RTE_Components.h 组件管理
驱动源文件,有的需要配合标准库或者HAL库来使用
里面的函数整合在ARM的CMSIS框架中
以spi为例子Driver_SPI.h中提供的框架
/**
\brief Access structure of the SPI Driver.
*/
typedef struct _ARM_DRIVER_SPI {
ARM_DRIVER_VERSION (*GetVersion) (void); ///< Pointer to \ref ARM_SPI_GetVersion : Get driver version.
ARM_SPI_CAPABILITIES (*GetCapabilities) (void); ///< Pointer to \ref ARM_SPI_GetCapabilities : Get driver capabilities.
int32_t (*Initialize) (ARM_SPI_SignalEvent_t cb_event); ///< Pointer to \ref ARM_SPI_Initialize : Initialize SPI Interface.
int32_t (*Uninitialize) (void); ///< Pointer to \ref ARM_SPI_Uninitialize : De-initialize SPI In