⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 core_cm0.h

📁 LPC11C14 CAN 代码
💻 H
📖 第 1 页 / 共 3 页
字号:
/*********************************************************************************************************
** @brief  Return the Priority Mask value
**
** @param  none
** @return uint32_t PriMask
**
** Return the state of the priority mask bit from the priority mask
** register
*********************************************************************************************************/
extern uint32_t __get_PRIMASK(void);

/*********************************************************************************************************
** @brief  Set the Priority Mask value
**
** @param  uint32_t PriMask
** @return none
**
** Set the priority mask bit in the priority mask register
*********************************************************************************************************/
extern void __set_PRIMASK(uint32_t priMask);

/*********************************************************************************************************
** @brief  Return the Control Register value
** 
** @param  none
** @return uint32_t Control value
**
** Return the content of the control register
*********************************************************************************************************/
extern uint32_t __get_CONTROL(void);

/*********************************************************************************************************
** @brief  Set the Control Register value
**
** @param  uint32_t Control value
** @return none
**
** Set the control register
*********************************************************************************************************/
extern void __set_CONTROL(uint32_t control);

#else                                                                   /* (__ARMCC_VERSION >= 400000)  */


/*********************************************************************************************************
** @brief  Return the Priority Mask value
**
** @param  none
** @return uint32_t PriMask
**
** Return the state of the priority mask bit from the priority mask
** register
*********************************************************************************************************/
static __INLINE uint32_t __get_PRIMASK(void)
{
    register uint32_t __regPriMask         __ASM("primask");
    return(__regPriMask);
}

/*********************************************************************************************************
** @brief  Set the Priority Mask value
**
** @param  uint32_t PriMask
** @return none
**
** Set the priority mask bit in the priority mask register
*********************************************************************************************************/
static __INLINE void __set_PRIMASK(uint32_t priMask)
{
    register uint32_t __regPriMask         __ASM("primask");
    __regPriMask = (priMask);
}

/*********************************************************************************************************
** @brief  Return the Control Register value
** 
** @param  none
** @return uint32_t Control value
**
** Return the content of the control register
*********************************************************************************************************/
static __INLINE uint32_t __get_CONTROL(void)
{
    register uint32_t __regControl         __ASM("control");
    return(__regControl);
}

/*********************************************************************************************************
** @brief  Set the Control Register value
**
** @param  uint32_t Control value
** @return none
**
** Set the control register
*********************************************************************************************************/
static __INLINE void __set_CONTROL(uint32_t control)
{
    register uint32_t __regControl         __ASM("control");
    __regControl = control;
}

#endif                                                                  /* __ARMCC_VERSION              */

/*
 *  ICC Compiler
 */
#elif (defined (__ICCARM__))

/*
 *  IAR iccarm specific functions
 */
#define __enable_irq                              __enable_interrupt    /*!< global Interrupt enable    */
#define __disable_irq                             __disable_interrupt   /*!< global Interrupt disable   */

static __INLINE void __enable_fault_irq()         { __ASM ("cpsie f"); }
static __INLINE void __disable_fault_irq()        { __ASM ("cpsid f"); }

#define __NOP                                     __no_operation()      /*!< no operation intrinsic in  */
                                                                        /* IAR Compiler                 */
static __INLINE  void __WFI()                     { __ASM ("wfi"); }
static __INLINE  void __WFE()                     { __ASM ("wfe"); }
static __INLINE  void __SEV()                     { __ASM ("sev"); }

/* intrinsic void __ISB(void)                                     */
/* intrinsic void __DSB(void)                                     */
/* intrinsic void __DMB(void)                                     */
/* intrinsic void __set_PRIMASK();                                */
/* intrinsic void __get_PRIMASK();                                */

/* intrinsic uint32_t __REV(uint32_t value);                      */
/* intrinsic uint32_t __REVSH(uint32_t value);                    */


/*********************************************************************************************************
** @brief  Return the Process Stack Pointer
**
** @param  none
** @return uint32_t ProcessStackPointer
**
** Return the actual process stack pointer
*********************************************************************************************************/
extern uint32_t __get_PSP(void);

/*********************************************************************************************************
** @brief  Set the Process Stack Pointer
**
** @param  uint32_t Process Stack Pointer
** @return none
**
** Assign the value ProcessStackPointer to the MSP 
** (process stack pointer) Cortex processor register
*********************************************************************************************************/
extern void __set_PSP(uint32_t topOfProcStack);

/*********************************************************************************************************
** @brief  Return the Main Stack Pointer
**
** @param  none
** @return uint32_t Main Stack Pointer
**
** Return the current value of the MSP (main stack pointer)
** Cortex processor register
*********************************************************************************************************/
extern uint32_t __get_MSP(void);

/*********************************************************************************************************
** @brief  Set the Main Stack Pointer
**
** @param  uint32_t Main Stack Pointer
** @return none
**
** Assign the value mainStackPointer to the MSP 
** (main stack pointer) Cortex processor register
*********************************************************************************************************/
extern void __set_MSP(uint32_t topOfMainStack);

/*********************************************************************************************************
** @brief  Reverse byte order in unsigned short value
**
** @param  uint16_t value to reverse
** @return uint32_t reversed value
**
** Reverse byte order in unsigned short value
*********************************************************************************************************/
extern uint32_t __REV16(uint16_t value);


/*
 *  GNU Compiler
 */
#elif (defined (__GNUC__))

/*
 *  GNU gcc specific functions
 */
static __INLINE void __enable_irq()               { __ASM volatile ("cpsie i"); }
static __INLINE void __disable_irq()              { __ASM volatile ("cpsid i"); }

static __INLINE void __enable_fault_irq()         { __ASM volatile ("cpsie f"); }
static __INLINE void __disable_fault_irq()        { __ASM volatile ("cpsid f"); }

static __INLINE void __NOP()                      { __ASM volatile ("nop"); }
static __INLINE void __WFI()                      { __ASM volatile ("wfi"); }
static __INLINE void __WFE()                      { __ASM volatile ("wfe"); }
static __INLINE void __SEV()                      { __ASM volatile ("sev"); }
static __INLINE void __ISB()                      { __ASM volatile ("isb"); }
static __INLINE void __DSB()                      { __ASM volatile ("dsb"); }
static __INLINE void __DMB()                      { __ASM volatile ("dmb"); }


/*********************************************************************************************************
** @brief  Return the Process Stack Pointer
**
** @param  none
** @return uint32_t ProcessStackPointer
**
** Return the actual process stack pointer
*********************************************************************************************************/
extern uint32_t __get_PSP(void);

/*********************************************************************************************************
** @brief  Set the Process Stack Pointer
**
** @param  uint32_t Process Stack Pointer
** @return none
**
** Assign the value ProcessStackPointer to the MSP 
** (process stack pointer) Cortex processor register
*********************************************************************************************************/
extern void __set_PSP(uint32_t topOfProcStack);

/*********************************************************************************************************
** @brief  Return the Main Stack Pointer
**
** @param  none
** @return uint32_t Main Stack Pointer
**
** Return the current value of the MSP (main stack pointer)
** Cortex processor register
*********************************************************************************************************/
extern uint32_t __get_MSP(void);

/*********************************************************************************************************
** @brief  Set the Main Stack Pointer
**
** @param  uint32_t Main Stack Pointer
** @return none
**
** Assign the value mainStackPointer to the MSP 
** (main stack pointer) Cortex processor register
*********************************************************************************************************/
extern void __set_MSP(uint32_t topOfMainStack);

/*********************************************************************************************************
** @brief  Return the Priority Mask value
**
** @param  none
** @return uint32_t PriMask
**
** Return the state of the priority mask bit from the priority mask
** register
*********************************************************************************************************/
extern uint32_t  __get_PRIMASK(void);

/*********************************************************************************************************
** @brief  Set the Priority Mask value
**
** @param  uint32_t PriMask
** @return none
**
** Set the priority mask bit in the priority mask register
*********************************************************************************************************/
extern void __set_PRIMASK(uint32_t priMask);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -