当前位置:网站首页>04A中断的配置

04A中断的配置

2022-06-24 19:31:00 纸带

stc_irq_signin_config_t stcIrqSigninCfg;//中断的配置//声明一个中断变量
///*来看一下内部有啥
typedef struct
{
    en_int_src_t    enIntSrc;   /*!< Peripheral interrupt number, can be any value @ref en_int_src_t    */
    IRQn_Type       enIRQn;     /*!< Peripheral IRQ type, can be Int000_IRQn~Int127_IRQn @ref IRQn_Type */
    func_ptr_t      pfnCallback;/*!< Callback function for corresponding peripheral IRQ                 */
} stc_irq_signin_config_t;
**
enIntSrc中断号
enIRQn 中断优先级
pfnCallback 回调函数
*

 紧接着要注册一个

    /* Register error IRQ handler && configure NVIC. */
    stcIrqSigninCfg.enIRQn = USART_UNIT_ERR_INT_IRQn;//中断优先级
    stcIrqSigninCfg.enIntSrc = USART_UNIT_ERR_INT_SRC;//中断号
    stcIrqSigninCfg.pfnCallback = &USART_RxErr_IrqCallback;
    InstalIrqHandler(&stcIrqSigninCfg, DDL_IRQ_PRIORITY_DEFAULT);

 关于如何明确中断号的这一个事情

1.首先和管脚相对应

2.找到相对应的事件

    INT_USART6_EI          
    INT_USART6_RI            
    INT_USART6_TI          
    INT_USART6_TCI         
    INT_USART6_RTO        

原网站

版权声明
本文为[纸带]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_39657978/article/details/125422225