您的位置 首页 分销

STM32中关于Contex-M3寄存器阐明

在STM32中用到了Cortex-M3定义的三组寄存器,有关这三组寄存器的说明不在STM32的技术手册中,需要参考ARM公司发布的Cortex-M3T…

STM32顶用到了Cortex-M3界说的三组寄存器,有关这三组寄存器的阐明不在STM32的技能手册中,需求参阅ARM公司发布的Cortex-M3 Technical Reference Manual (r2p0)。

在STM32的固件库中界说了三个结构体与这三个寄存器组相对应,这三个结构体与ARM手册中寄存器的对应联系如下:

一、NVIC寄存器组
STM32的固件库中有如下界说:
typedef struct
{
vu32 ISER[2];
u32 RESERVED0[30];
vu32 ICER[2];
u32 RSERVED1[30];
vu32 ISPR[2];
u32 RESERVED2[30];
vu32 ICPR[2];
u32 RESERVED3[30];
vu32 IABR[2];
u32 RESERVED4[62];
vu32 IPR[11];
} NVIC_TypeDef;

它们对应ARM手册中的名称为
ISER = Interrupt Set-Enable Registers
ICER = Interrupt Clear-Enable Registers
ISPR = Interrupt Set-Pending Register
ICPR = Interrupt Clear-Pending Register
IABR = Active Bit Register
IPR = Interrupt Priority Registers

每个寄存器有240位,以Interrupt Set-Enable Registers阐明,ISER[0]对应中止源0~31,ISER[1]对应中止源32~63,STM32只要60个中止源,所以没有ISER[2:7]。

参阅STM32技能参阅手册中的中止向量表,中止源的方位为:
方位0 – WWDG = Window Watchdog interrupt
方位1 – PVD = PVD through EXTI Line detection interrupt
方位2 – TAMPER = Tamper interrupt
……
方位58 – DMA2_Channel3 = DMA2 Channel3 global interrupt
方位59 – DMA2_Channel4_5 = DMA2 Channel4 and DMA2 Channel5 global interrupts

二、体系控制寄存器组
STM32的固件库中有如下界说:
typedef struct
{
vuc32 CPUID;
vu32 ICSR;
vu32 VTOR;
vu32 AIRCR;
vu32 SCR;
vu32 CCR;
vu32 SHPR[3];
vu32 SHCSR;
vu32 CFSR;
vu32 HFSR;
vu32 DFSR;
vu32 MMFAR;
vu32 BFAR;
vu32 AFSR;
} SCB_TypeDef; /* System Control Block Structure */

它们对应ARM手册中的名称为
CPUID = CPUID Base Register
ICSR = Interrupt Control State Register
VTOR = Vector Table Offset Register
AIRCR = Application Interrupt/Reset Control Register
SCR = System Control Register
CCR = Configuration Control Register
SHPR = System Handlers Priority Register
SHCSR = System Handler Control and State Register
CFSR = Configurable Fault Status Registers
HFSR = Hard Fault Status Register
DFSR = Debug Fault Status Register
MMFAR = Mem Manage Address Register
BFAR = Bus Fault Address Register
AFSR = Auxiliary Fault Status Register

三、体系时钟寄存器组
STM32的固件库中有如下界说:
typedef struct
{
vu32 CTRL;
vu32 LOAD;
vu32 VAL;
vuc32 CALIB;
} SysTick_TypeDef;

它们对应ARM手册中的名称为
CTRL = SysTick Control and Status Register
LOAD = SysTick Reload Value Register
VAL = SysTick Current Value Register
CALIB = SysTick Calibration Value Register

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/bandaoti/fenxiao/275098.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部