查看: 4270|回复: 0

[分享] LPC55S69之外部中断

[复制链接]
  • TA的每日心情
    开心
    2025-7-10 13:07
  • 签到天数: 43 天

    连续签到: 1 天

    [LV.5]常住居民I

    56

    主题

    548

    帖子

    0

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    1528

    热心会员

    最后登录
    2025-7-23
    发表于 2020-4-3 12:51:57 | 显示全部楼层 |阅读模式
    LPC55S69之外部中断


    外部中断用官方的例子就可以了。


    一、引脚。
    1.png
    二、代码。
    1. <font face="微软雅黑" size="3">#include "fsl_debug_console.h"
    2. #include "board.h"
    3. #include "fsl_pint.h"
    4. #include "fsl_common.h"
    5. #include "pin_mux.h"
    6. #include "fsl_inputmux.h"

    7. void pint_intr_callback(pint_pin_int_t pintr, uint32_t pmatch_status) {
    8.     PRINTF("\r\nPINT Pin Interrupt %d event detected.", pintr);
    9. }

    10. int main(void) {
    11.     CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
    12.     BOARD_InitPins();
    13.     BOARD_BootClockPLL150M();
    14.     BOARD_InitDebugConsole();

    15.     INPUTMUX_Init(INPUTMUX);
    16.     INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt2, kINPUTMUX_GpioPort1Pin9ToPintsel); // PIO1_9
    17.     INPUTMUX_Deinit(INPUTMUX);

    18.     PINT_Init(PINT);
    19.     PINT_PinInterruptConfig(PINT, kPINT_PinInt2, kPINT_PinIntEnableFallEdge, pint_intr_callback);
    20.     PINT_EnableCallbackByIndex(PINT, kPINT_PinInt2);

    21.     PRINTF("\r\nPINT Pin Interrupt events are configured\r\n");
    22.     while (1) {
    23.         __WFI();
    24.     }
    25. }</font>
    复制代码
    三、说明。


    按下开发板中的S3,也就是USER键,可以在控制台上看到有打印信息。
    2.png
    这里的外部中断,一共可以设置10个引脚,其中8个是普通引脚,2个是安全引脚。






    文章出处:点击

    签到签到
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-9-9 12:51 , Processed in 0.084141 second(s), 20 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表