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  *\addtogroup xgc_portAVR
34  * @{
35  *
36  * \file
37  *\if russian_lng
38  * Файл определяющий общие макросы под архитектуру AVR
39  *\else
40  * This file is used define macroses for AVR arch
41  *
42  */
43 #ifndef _iPORT_ARCH_H_
44 #define _iPORT_ARCH_H_ 1
45 
46 #ifndef i_ARCH
47  #define i_ARCH AVR_MEGA
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 char
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 1
75 
76 /**
77  *\if russian_lng
78  * \brief Степень двойки для основного типа данных.
79  *
80  *\else
81  * \brief The power of two for iArch.
82  *
83  *\endif
84  */
85 #define iarch_power_of_two 3
86 
87 /** \if russian_lng
88  * \brief Стековый тип для данной архитектуры.
89  *
90  Для 8 битной Atmel AVR -- char
91  *\else
92  * \brief Architecture stack type.
93  *
94  * For 8 bit Atmel AVR is char
95  *\endif
96  */
97 #define iStack_t unsigned iarch
98 /**\if russian_lng
99  * \brief Направление роста стека
100  *\else
101  * \brief The architecture stack growth direction.
102  *\endif
103  */
104 #define iSTACK_DIRECTION (-1)
105 /**\if russian_lng
106  * \brief Размер изменения стека для одной операции PUSH/POP
107  *\else
108  * \brief The size of changing stack for one PUSH/POP operation
109  *\endif
110  */
111 #define iSTACK_DELTA (iSTACK_DIRECTION*sizeof(iStack_t))
112 
113 
114 
115 /**
116  *At mega 128 Clock prescalers
117  */
118 
119 #define portZERO_CLOCK_DIV0 0
120 #define portZERO_CLOCK_DIV1 (1)
121 #define portZERO_CLOCK_DIV8 (8)
122 #define portZERO_CLOCK_DIV64 (64)
123 #define portZERO_CLOCK_DIV256 (256)
124 #define portZERO_CLOCK_DIV1024 (1024)
125 /** @} end of group xgc_portAVR */
126 /*----------------------------------------------------------------------------*/
127 #define avr_mega_number __AVR_ARCH__
128 #define i_MCU_FAMILY_CHECK3(a) a##_number
129 #define i_MCU_FAMILY_CHECK2(current_fam,test_famh) (i_MCU_FAMILY_CHECK3(test_famh) == 51)
130 /*----------------------------------------------------------------------------*/
131 #define i_MCU_MODEL_CHECK2(current_model,test_model) (test_model > 0)
132 #endif /* _iPORT_ARCH_H_ */