Eric Ebert
/
CoOS
CoOS Demonstrator adapted to mbed Hardware.
OsArch.h@0:57690853989a, 2010-12-03 (annotated)
- Committer:
- ericebert
- Date:
- Fri Dec 03 19:45:30 2010 +0000
- Revision:
- 0:57690853989a
Some basic LED-Flashing works in the CoOS-RTOS using Tasks
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ericebert | 0:57690853989a | 1 | /** |
ericebert | 0:57690853989a | 2 | ******************************************************************************* |
ericebert | 0:57690853989a | 3 | * @file OsArch.h |
ericebert | 0:57690853989a | 4 | * @version V1.1.3 |
ericebert | 0:57690853989a | 5 | * @date 2010.04.26 |
ericebert | 0:57690853989a | 6 | * @brief Implement function declare related to Cortex-M3(ARM-v7) |
ericebert | 0:57690853989a | 7 | * @details This header file including functions or defines related to |
ericebert | 0:57690853989a | 8 | * Cortex-M3(ARM-v7). |
ericebert | 0:57690853989a | 9 | ******************************************************************************* |
ericebert | 0:57690853989a | 10 | * @copy |
ericebert | 0:57690853989a | 11 | * |
ericebert | 0:57690853989a | 12 | * INTERNAL FILE,DON'T PUBLIC. |
ericebert | 0:57690853989a | 13 | * |
ericebert | 0:57690853989a | 14 | * <h2><center>© COPYRIGHT 2009 CooCox </center></h2> |
ericebert | 0:57690853989a | 15 | ******************************************************************************* |
ericebert | 0:57690853989a | 16 | */ |
ericebert | 0:57690853989a | 17 | |
ericebert | 0:57690853989a | 18 | |
ericebert | 0:57690853989a | 19 | #ifndef _CPU_H |
ericebert | 0:57690853989a | 20 | #define _CPU_H |
ericebert | 0:57690853989a | 21 | |
ericebert | 0:57690853989a | 22 | |
ericebert | 0:57690853989a | 23 | #define NVIC_ST_CTRL (*((volatile U32 *)0xE000E010)) |
ericebert | 0:57690853989a | 24 | #define NVIC_ST_RELOAD (*((volatile U32 *)0xE000E014)) |
ericebert | 0:57690853989a | 25 | #define RELOAD_VAL ((U32)(( (U32)CFG_CPU_FREQ) / (U32)CFG_SYSTICK_FREQ) -1) |
ericebert | 0:57690853989a | 26 | |
ericebert | 0:57690853989a | 27 | /*!< Initial System tick. */ |
ericebert | 0:57690853989a | 28 | #define InitSysTick() NVIC_ST_RELOAD = RELOAD_VAL; \ |
ericebert | 0:57690853989a | 29 | NVIC_ST_CTRL = 0x0007 |
ericebert | 0:57690853989a | 30 | |
ericebert | 0:57690853989a | 31 | #define NVIC_SYS_PRI2 (*((volatile U32 *)0xE000ED1C)) |
ericebert | 0:57690853989a | 32 | #define NVIC_SYS_PRI3 (*((volatile U32 *)0xE000ED20)) |
ericebert | 0:57690853989a | 33 | |
ericebert | 0:57690853989a | 34 | /*!< Initialize PendSV,SVC and SysTick interrupt priority to lowest. */ |
ericebert | 0:57690853989a | 35 | #define InitInt() NVIC_SYS_PRI2 |= 0xFF000000;\ |
ericebert | 0:57690853989a | 36 | NVIC_SYS_PRI3 |= 0xFFFF0000 |
ericebert | 0:57690853989a | 37 | |
ericebert | 0:57690853989a | 38 | |
ericebert | 0:57690853989a | 39 | /*---------------------------- Variable declare ------------------------------*/ |
ericebert | 0:57690853989a | 40 | extern U64 OSTickCnt; /*!< Counter for current system ticks. */ |
ericebert | 0:57690853989a | 41 | |
ericebert | 0:57690853989a | 42 | /*!< Initial context of task being created */ |
ericebert | 0:57690853989a | 43 | extern OS_STK *InitTaskContext(FUNCPtr task,void *param,OS_STK *pstk); |
ericebert | 0:57690853989a | 44 | extern void SwitchContext(void); /*!< Switch context */ |
ericebert | 0:57690853989a | 45 | extern void SetEnvironment(OS_STK *pstk);/*!< Set environment for run */ |
ericebert | 0:57690853989a | 46 | extern U8 Inc8 (volatile U8 *data); |
ericebert | 0:57690853989a | 47 | extern U8 Dec8 (volatile U8 *data); |
ericebert | 0:57690853989a | 48 | extern void IRQ_ENABLE_RESTORE(void); |
ericebert | 0:57690853989a | 49 | extern void IRQ_DISABLE_SAVE(void); |
ericebert | 0:57690853989a | 50 | #endif |