一般来说,手动查看 CTags 文件不会很有成效(尽管我知道您可能只是想了解发生了什么)。话虽如此,这是我对您发布的各种条目的解释。
我怀疑您将看到的大部分内容都属于这些大类之一,但是当有疑问时,直接查看代码将真正帮助您弄清楚发生了什么。
结构成员
数据结构
A0 .\Drivers\CMSIS\Include\arm_math.h /^ q15_t A0; \/**< The derived gain, A0 = Kp + Ki + Kd . *\/$/;" m struct:__anon68
A0
是结构体的成员 (m struct:__anon68
)用于将数据传递到数学加速函数或从数学加速函数传递数据。
硬件寄存器
ST 以特定方式声明其硬件寄存器。我将在这里使用一个例子core_m7.h
,它声明了所有 Cortex-M7 CPU 通用的寄存器块,与供应商无关:
typedef struct
{
__IO uint32_t ISER[8]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
uint32_t RESERVED0[24];
__IO uint32_t ICER[8]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
uint32_t RSERVED1[24];
__IO uint32_t ISPR[8]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
uint32_t RESERVED2[24];
__IO uint32_t ICPR[8]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
uint32_t RESERVED3[24];
__IO uint32_t IABR[8]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
uint32_t RESERVED4[56];
__IO uint8_t IP[240]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
uint32_t RESERVED5[644];
__O uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
} NVIC_Type;
/* ... */
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
/* ... */
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
该结构确定各种配置和控制寄存器在内存中的位置,在本例中为NVIC
(嵌套向量中断控制器)块,它管理系统的异常处理。
就 CTags 而言,这与A0
多于。 (非常重要的)区别在于结构体的实例化方式——对于硬件块,结构体声明映射到必须进行特殊处理的特定内存地址。
您的许多 ctags 行将引用这些类型的声明,包括:
ABFSR .\Drivers\CMSIS\Include\core_cm7.h /^ __IOM uint32_t ABFSR; \/*!< Offset: 0x2A8 (R\/W) Auxiliary Bus Fault Status Register *\/$/;" m struct:__anon187
ABR .\Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f767xx.h /^ __IO uint32_t ABR; \/*!< QUADSPI Alternate Bytes register, Address offset: 0x1C *\/$/;" m struct:__anon39
这两个都是结构成员。在您的代码中,您可能会看到类似的内容SCB->ABFSR = ...
.
C .\Drivers\CMSIS\Include\core_cm7.h /^ uint32_t C:1; \/*!< bit: 29 Carry condition code flag *\/$/;" m struct:__anon182::__anon183
值得特殊对待,因为它是位域声明。由于它是结构成员,因此更复杂inside一个联盟(m struct:__anon182::__anon183
),但实际上这是同一类事情。根据您所查看的内容,这些匿名嵌套可能会变得相当深——跟踪这些内容是 CTag 和类似工具真正开始证明其价值的地方。
类型定义
ADC_Common_TypeDef .\Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f767xx.h /^} ADC_Common_TypeDef;$/;" t typeref:struct:__anon3
这就是 CTags 跟踪所有这些匿名结构的方式。它说 ”ADC_Common_TypeDef
是一样的struct:__anon3
"
常量(枚举)
ADC_IRQn .\Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f767xx.h /^ ADC_IRQn = 18, \/*!< ADC1, ADC2 and ADC3 global Interrupts *\/$/;" e enum:__anon1
这是一个常量(ADC 中断的中断向量号)。它被声明为匿名枚举的一部分(e enum:__anon1
).