21ic问答首页 - GD32H759IMK6关于中断配置字段NVIC->IP的疑问
GD32H759IMK6关于中断配置字段NVIC->IP的疑问
各位老师:
我的keil安装了GigaDevice::GD32H7xx_DFP@1.4.0这个包,看到core_cm7.h文件里使用的是 IPR 字段,如下图:

但是我在GD32官网下载的最新的GD32H7xx_Firmware_Library_V1.4.0, 里边的nvic_irq_enable 接口里使用的仍然是NVIC->IP字段,现在我的程序跑起来有问题,怀疑跟这块差异有关,请问该怎么修改下?

我的keil安装了GigaDevice::GD32H7xx_DFP@1.4.0这个包,看到core_cm7.h文件里使用的是 IPR 字段,如下图:
但是我在GD32官网下载的最新的GD32H7xx_Firmware_Library_V1.4.0, 里边的nvic_irq_enable 接口里使用的仍然是NVIC->IP字段,现在我的程序跑起来有问题,怀疑跟这块差异有关,请问该怎么修改下?
赞0
typedef struct
{
__IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
uint32_t RESERVED0[24U];
__IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
uint32_t RESERVED1[24U];
__IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
uint32_t RESERVED2[24U];
__IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
uint32_t RESERVED3[24U];
__IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
uint32_t RESERVED4[56U];
__IOM uint8_t IPR[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
uint32_t RESERVED5[644U];
__OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
} NVIC_Type;
这是 gd32h7xx_misc.c 里nvic_irq_enable 接口里的使用:
NVIC->IP[(uint8_t)nvic_irq] = (uint8_t)temp_priority;
评论
2025-05-13
您需要登录后才可以回复 登录 | 注册