CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iArch.h
Go to the documentation of this file.
1 /*
2  * CMSIS2000
3  * CMSIS-like sources for LPC2xxx series MCUs
4  *
5  * (C) Copyright 2011-2012, Dmitriy Cherepanov, All Rights Reserved
6  *
7  * Version: 0.0.7
8  * Date of the Last Update: 2013-03-04
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a copy
11  * of this software and associated documentation files (the "Software"), to
12  * deal in the Software without restriction, including without limitation the
13  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14  * sell copies of the Software, and to permit persons to whom the Software is
15  * furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included in
18  * all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26  * IN THE SOFTWARE.
27  *
28  * Do not be lasy! For the latest version see http://irtos.sourceforge.net .
29  *
30  *
31 #*/
32 
33 /** \file
34  *\if russian_lng
35  * Файл определяющий общие макросы под выбранную архитектуру
36  *\else
37  * This file is used define macroses for selected arch
38  *\endif
39  */
40 #ifndef _iARCH_H_
41 #define _iARCH_H_ 1
42 #include "iArch_nums.h"
43 /*----------------------------------------------------------------------------*/
44 #ifndef i_ARCH
45  #error Wrong definition: i_ARCH should be defined \
46  usally it definded in bsp_board_def.h. or mcu_id.h
47 #endif
48 /*----------------------------------------------------------------------------*/
49 #if i_ARCH_CHECK2(i_ARCH,POSIX_GENERIC)
50  #include "posix/iArch.h"
51 #endif
52 #if i_ARCH_CHECK2(i_ARCH,AVR_MEGA)
53  #include "avr/iArch.h"
54 #endif
55 #if (i_ARCH_CHECK(ARM7) || i_ARCH_CHECK(CM0) || i_ARCH_CHECK(CM3))
56  #include "arm/iArch.h"
57 #endif
58 #if i_ARCH_CHECK2(i_ARCH,WIN_NT)
59  #include "winnt/iArch.h"
60 #endif
61 /*----------------------------------------------------------------------------*/
62 #ifndef i_MCU_FAMILY_CHECK2
63  #define i_MCU_FAMILY_CHECK2(current_fam,test_famh) \
64  ((CONCAT_iarch(current_fam,_MCU_FAMILY_NUM)) == CONCAT_iarch(test_famh,_MCU_FAMILY_NUM))
65 #endif
66 /**\def i_ARCH_CHECK()
67  *\if russian_lng
68  Используется для определения типа ядра микроконтроллеров
69 
70  Например:
71  *\else
72  Used for determine MCU core type
73 
74  For example:
75 *\endif
76 \code
77 #if (i_ARCH_CHECK(ARM7) || i_ARCH_CHECK(CM0) || i_ARCH_CHECK(CM3))
78  #include "arm/iArch.h"
79 #endif
80 \endcode
81 \see \ref config_files_auto_mcu_id
82 */
83 
84 #ifndef i_MCU_FAMILY_CHECK
85  #define i_MCU_FAMILY_CHECK(test_famh) \
86  i_MCU_FAMILY_CHECK2(i_MCU_FAMILY,test_famh)
87 #endif
88 #ifndef i_MCU_MODEL_CHECK2
89  #define i_MCU_MODEL_CHECK2(current_fam,test_model) \
90  ((CONCAT_iarch(current_fam,_MCU_FAMILY_NUM)) == CONCAT_iarch(test_famh,_MCU_FAMILY_NUM))
91 #endif
92 #ifndef i_MCU_MODEL_CHECK
93  #define i_MCU_MODEL_CHECK(test_model) \
94  i_MCU_MODEL_CHECK2(i_MCU_MODEL,test_model)
95 #endif
96 /*----------------------------------------------------------------------------*/
97 /** \addtogroup xg_bsp
98  *
99  *
100  * There is must be three defines in project i_ARCH, i_MCU_FAMILY, i_MCU_MODEL
101  *
102  for example:
103 \code
104 #define i_ARCH ARM7TDMI
105 
106 #define i_MCU_FAMILY LPC2xxx
107 
108 #define i_MCU_MODEL 2478
109 \endcode
110  * As rule it is better to define this preprocessor macroses in mcu_id.h file
111  */
112 #endif /* _iARCH_H_ */