TC264—外部中断笔记
1.中端特点
2.中断数量
3.中断操作参数
/* 获取GPIO对应 MODULE 宏定义L /
#define PIN_GetModule(GPIO_NAME) (Ifx_P)(0xF0030000u | (GPIO_NAME & 0xFF00))
/* 获取GPIO对应 管脚序列号 宏定义Q */
#define PIN_GetIndex(GPIO_NAME) (uint8)(GPIO_NAME & 0x000F)
/* GPIO模式 /
#define PIN_MODE_OUTPUT IfxPort_Mode_outputPushPullGeneral /!< 推挽输出 /
#define PIN_MODE_OUTPUT_OD IfxPort_Mode_outputOpenDrainGeneral /!< 开漏输出 /
#define PIN_MODE_INPUT IfxPort_Mode_inputNoPullDevice /!< 浮空输入 /
#define PIN_MODE_INPUT_PULLUP IfxPort_Mode_inputPullUp /!< 上拉输入 /
#define PIN_MODE_INPUT_PULLDOWN IfxPort_Mode_inputPullDown /!< 下拉输入 */
/* GPIO 中断触发模式 /
#define PIN_IRQ_MODE_RISING IfxPort_InputMode_pullDown /!< 上升沿(下拉)触发中断 /
#define PIN_IRQ_MODE_FALLING IfxPort_InputMode_pullUp /!< 下降沿(上拉)触发中断 /
#define PIN_IRQ_MODE_RISING_FALLING IfxPort_InputMode_noPullDevice /!< 双边沿(开漏)触发中断 */
/** GPIO外部中断 组0中断服务函数优先级 范围:1-255 数字越大 优先级越高 注意优先级不要重复 */
#define PIN_INT0_PRIORITY 100
4.使用中断流程
a.初始化中断
b.开启中端服务函数
c.调用中断