查看: 3059|回复: 4

LPC824掉电模式的寄存器配置是什么意思? (SYST_CSR, 0xE000 E010

[复制链接]
  • TA的每日心情
    郁闷
    2019-12-18 14:21
  • 签到天数: 16 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    发表于 2017-1-18 11:36:35 | 显示全部楼层 |阅读模式
    分享到:


    __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */
      __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */
      __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */
            uint32_t RESERVED1;
      __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */
      __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */


    #define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */
    #define SysTick_BASE        (SCS_BASE +  0x0010UL)                    /*!< SysTick Base Address */
    #define NVIC_BASE           (SCS_BASE +  0x0100UL)                    /*!< NVIC Base Address */
    #define SCB_BASE            (SCS_BASE +  0x0D00UL)                    /*!< System Control Block Base Address */

    #define SCB                 ((SCB_Type       *)     SCB_BASE      )   /*!< SCB configuration struct */
    #define SysTick             ((SysTick_Type   *)     SysTick_BASE  )   /*!< SysTick configuration struct */
    #define NVIC                ((NVIC_Type      *)     NVIC_BASE     )   /*!< NVIC configuration struct */

    #define SCB_SCR_SLEEPDEEP_Pos               2U                                            /*!< SCB SCR: SLEEPDEEP Position */
    #define SCB_SCR_SLEEPDEEP_Msk              (1UL << SCB_SCR_SLEEPDEEP_Pos)                 /*!< SCB SCR: SLEEPDEEP Mask */

    下面这句什么意思呢?
    /* Configure ARM to only allow enabled IRQ's to wake us up */
        SCB->SCR &= ~(SCB_SCR_SEVONPEND_Msk);

    回复

    使用道具 举报

  • TA的每日心情
    开心
    12 小时前
  • 签到天数: 3744 天

    连续签到: 70 天

    [LV.Master]伴坛终老

    发表于 2017-1-18 12:23:06 | 显示全部楼层
    本帖最后由 toofree 于 2017-1-18 12:24 编辑

    傲游截图20170118121817.jpg
    0:只有被使能的中断或事件能够唤醒处理器,未使能的中断不包括在内(即未使能的中断不能唤醒处理器)。
    /* Configure ARM to only allow enabled IRQ's to wake us up */
    注释的就是上面的意思。配置ARM只允许被使能中断唤醒。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    郁闷
    2019-12-18 14:21
  • 签到天数: 16 天

    连续签到: 1 天

    [LV.4]偶尔看看III

     楼主| 发表于 2017-1-18 13:37:10 | 显示全部楼层
    toofree 发表于 2017-1-18 12:23
    0:只有被使能的中断或事件能够唤醒处理器,未使能的中断不包括在内(即未使能的中断不能唤醒处理器)。
    / ...

    typedef struct
    {
      __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Register */
      __IOM uint32_t ICSR;                   /*!< Offset: 0x004 (R/W)  Interrupt Control and State Register */
    #if (__VTOR_PRESENT == 1U)
      __IOM uint32_t VTOR;                   /*!< Offset: 0x008 (R/W)  Vector Table Offset Register */
    #else
            uint32_t RESERVED0;
    #endif
      __IOM uint32_t AIRCR;                  /*!< Offset: 0x00C (R/W)  Application Interrupt and Reset Control Register */
      __IOM uint32_t SCR;                    /*!< Offset: 0x010 (R/W)  System Control Register */
      __IOM uint32_t CCR;                    /*!< Offset: 0x014 (R/W)  Configuration Control Register */
            uint32_t RESERVED1;
      __IOM uint32_t SHP[2U];                /*!< Offset: 0x01C (R/W)  System Handlers Priority Registers. [0] is RESERVED */
      __IOM uint32_t SHCSR;                  /*!< Offset: 0x024 (R/W)  System Handler Control and State Register */
    } SCB_Type;

    这里的定义怎么是 0x10
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    12 小时前
  • 签到天数: 3744 天

    连续签到: 70 天

    [LV.Master]伴坛终老

    发表于 2017-1-18 15:06:33 | 显示全部楼层
    perdip 发表于 2017-1-18 13:37
    typedef struct
    {
      __IM  uint32_t CPUID;                  /*!< Offset: 0x000 (R/ )  CPUID Base Reg ...

    这不是定义,这是偏移地址,4字节一个单元。
    以SCB_Type为基地址的结构体,偏地址0x10就是对应SCR的地址,这个地址的读写,也自然就是对相应寄存器读写了。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    郁闷
    2019-12-18 14:21
  • 签到天数: 16 天

    连续签到: 1 天

    [LV.4]偶尔看看III

     楼主| 发表于 2017-1-18 19:33:57 | 显示全部楼层
    toofree 发表于 2017-1-18 12:23
    0:只有被使能的中断或事件能够唤醒处理器,未使能的中断不包括在内(即未使能的中断不能唤醒处理器)。
    / ...

    这个地址 文档上不是偏移到D10吗?
    怎么是10
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

    关闭

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



    手机版|小黑屋|与非网

    GMT+8, 2024-4-19 12:18 , Processed in 0.148021 second(s), 23 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.