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  * Файл определяющий общие макросы под архитектуру ARM
36  *\else
37  * This file is used define macroses for ARM arch ARM
38  *\endif
39  * \addtogroup xgc_portARM7
40  * @{
41  */
42 /*----------------------------------------------------------------------------*/
43 #ifndef _iPORT_ARCH_H_
44 #define _iPORT_ARCH_H_ 1
45 /*----------------------------------------------------------------------------*/
46 #ifndef i_ARCH
47  #define i_ARCH ARM7
48 #endif
49 /**
50  *\if russian_lng
51  * \brief Тип данных соответствующий архитектуре ЦП.
52  *
53  * Самый быстрый тип данных -- int. Но
54  в 8 битных ЦП это char.
55  *\else
56  * \brief MCU Architecture type.
57  *
58  * The fastest type. The type of main CPU ALU registers.
59  * On 8 bit MCU is char.
60  * On 16 bit and 32 bit MCU is int.
61  The analog of int type in C.
62  *\endif
63  */
64 #define iarch int
65 /**
66  *\if russian_lng
67  * \brief Размер основного типа данных.
68  *
69  *\else
70  * \brief The size of main architecture type.
71  *
72  *\endif
73  */
74 #define sizeof_iarch 4
75 /** \if russian_lng
76  * \brief Стековый тип для данной архитектуры.
77  *
78  Для 32 битной ARM -- unsigned int (uint32)
79  *\else
80  * \brief Architecture stack type.
81  *
82  * For 32 bit ARM is unsigned int (uint32)
83  *\endif
84  */
85 #define iStack_t unsigned iarch
86 /**\if russian_lng
87  * \brief Направление роста стека
88  *\else
89  * \brief The architecture stack growth direction.
90  *\endif
91  */
92 #define iSTACK_DIRECTION (-1)
93 /**\if russian_lng
94  * \brief Размер изменения стека для одной операции PUSH/POP
95  *\else
96  * \brief The size of changing stack for one PUSH/POP operation
97  *\endif
98  */
99 #define iSTACK_DELTA (iSTACK_DIRECTION*sizeof(iStack_t))
100 /*----------------------------------------------------------------------------*/
101 /*----- MCU FAMALYES -----------------------------------------*/
102 /*----------------------------------------------------------------------------*/
103 /**\ingroup xgc_portARM7_NXP
104  *\if russian_lng
105  * \page arm_family_const_def константа для семейства контроллеров LPC2xxx от NXP(Philips)
106  *\else
107  * \page arm_family_const_def ARM7 TDMI constant LPC2xxx from NXP(Philips)
108  *\endif
109  * \code
110  #if i_MCU_FAMILY_CHECK2(i_MCU_FAMILY,LPC2xxx)
111  SOME CODE FOR NXP
112  #endif
113  \endcode
114  *
115  */
116 /*----------------------------------------------------------------------------*/
117 #define LPC2xxx_MCU_FAMILY_NUM 2000
118 #define LPC17xx_MCU_FAMILY_NUM 1700
119 #define LPC13xx_MCU_FAMILY_NUM 1300
120 #define LPC11xx_MCU_FAMILY_NUM 1100
121 
122 #define i_MCU_FAMILY_CHECK2(current_fam,test_famh) \
123  ((CONCAT_iarch(current_fam,_MCU_FAMILY_NUM)) == CONCAT_iarch(test_famh,_MCU_FAMILY_NUM))
124 
125 #endif /* _iPORT_ARCH_H_ */
126 /** @} end of group xgc_portARM7 */