CooCox 1.1.4 on mbed with simple blinky example

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OsArch.h Source File

OsArch.h

Go to the documentation of this file.
00001 /**
00002  *******************************************************************************
00003  * @file       OsArch.h
00004  * @version    V1.1.4    
00005  * @date       2011.04.20
00006  * @brief      Implement function declare related to Cortex-M3(ARM-v7)
00007  * @details    This header file including functions or defines related to 
00008  *             Cortex-M3(ARM-v7).           
00009  *******************************************************************************
00010  * @copy
00011  *
00012  * INTERNAL FILE,DON'T PUBLIC.
00013  * 
00014  * <h2><center>&copy; COPYRIGHT 2009 CooCox </center></h2>
00015  *******************************************************************************
00016  */ 
00017 
00018 
00019 #ifndef  _CPU_H
00020 #define  _CPU_H
00021 
00022 
00023 #define NVIC_ST_CTRL    (*((volatile U32 *)0xE000E010))
00024 #define NVIC_ST_RELOAD  (*((volatile U32 *)0xE000E014))
00025 #define RELOAD_VAL      ((U32)(( (U32)CFG_CPU_FREQ) / (U32)CFG_SYSTICK_FREQ) -1)
00026 
00027 /*!< Initial System tick.   */
00028 #define InitSysTick()   NVIC_ST_RELOAD =  RELOAD_VAL; \
00029                         NVIC_ST_CTRL   =  0x0007    
00030 
00031 #define NVIC_SYS_PRI2   (*((volatile U32 *)0xE000ED1C))
00032 #define NVIC_SYS_PRI3   (*((volatile U32 *)0xE000ED20))
00033 
00034 /*!< Initialize PendSV,SVC and SysTick interrupt priority to lowest.          */
00035 #define InitInt()       NVIC_SYS_PRI2 |=  0xFF000000;\
00036                         NVIC_SYS_PRI3 |=  0xFFFF0000
00037 
00038 
00039 /*---------------------------- Variable declare ------------------------------*/
00040 extern U64      OSTickCnt ;          /*!< Counter for current system ticks.    */                                    
00041 
00042 /*!< Initial context of task being created  */
00043 extern OS_STK  *InitTaskContext(FUNCPtr task,void *param,OS_STK *pstk);
00044 extern void    SwitchContext(void);         /*!< Switch context                   */
00045 extern void    SetEnvironment(OS_STK *pstk);/*!< Set environment for run          */
00046 extern U8      Inc8 (volatile U8 *data);
00047 extern U8      Dec8 (volatile U8 *data);
00048 extern void    IRQ_ENABLE_RESTORE(void);
00049 extern void    IRQ_DISABLE_SAVE(void);
00050 #endif