MSPM0L系列使用过程中的几个汇编嵌入宏定义解析

[复制链接]
 楼主| xyz549040622 发表于 2023-4-26 15:08 | 显示全部楼层 |阅读模式
本帖最后由 xyz549040622 于 2023-4-26 15:14 编辑
  1. /**
  2.   \brief   No Operation
  3.   \details No Operation does nothing. This instruction can be used for code alignment purposes.
  4. */
  5. #define __NOP()                             __ASM volatile ("nop")

  6. /**
  7.   \brief   Wait For Interrupt
  8.   \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
  9. */
  10. #define __WFI()                             __ASM volatile ("wfi":::"memory")


  11. /**
  12.   \brief   Wait For Event
  13.   \details Wait For Event is a hint instruction that permits the processor to enter
  14.            a low-power state until one of a number of events occurs.
  15. */
  16. #define __WFE()                             __ASM volatile ("wfe":::"memory")


  17. /**
  18.   \brief   Send Event
  19.   \details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
  20. */
  21. #define __SEV()                             __ASM volatile ("sev")
__NOP()  //空延时
__WFI()  //等待中断

__WFE()  //等待事件
__SEV()  //发送事件




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

本版积分规则

个人签名:qq群: 嵌入式系统arm初学者 224636155←← +→→点击-->小 i 精品课全集,21ic公开课~~←←→→点击-->小 i 精品课全集,给你全方位的技能策划~~←←

2841

主题

19330

帖子

110

粉丝
快速回复 在线客服 返回列表 返回顶部