CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
reg_macros.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 #ifndef _ARCH_ARM_REG_MACROS_H_
34 #define _ARCH_ARM_REG_MACROS_H_ 1
35 
36 //#include "arch/arm/compiler.h" // for volatile
37 /*-----------Документация Doxygen -- Doxygen documentation -----------------*/
38 /** \file
39  *\if russian_lng
40  * Макрос для регистров NXP
41  *\else
42  * For NXP reg macros
43  *\endif
44  * \author Dmitriy Cherepanov
45  * \date 2010
46  * \ingroup xgportARM7_NXP
47  * \addtogroup xgportARM7_NXP
48  * @{
49  */
50 /*------ МАКРОСЫ И ОПРЕДЕЛЕНИЯ - MACROSES ------------------------------------*/
51 #define REG8 volatile unsigned char
52 #define REG16 volatile unsigned short
53 #define REG32 volatile unsigned int
54 
55 #define REG_8 REG8
56 #define REG_16 REG_16
57 #define REG_32 REG_32
58 
59 #define VBP_REG_PER_BASE_ADDRES(peripheral) LPC_##peripheral##_BASE
60 
61 #define VBP_REG(APB_peripheral,reg_name) (VBP_REG_PER_BASE_ADDRES(APB_peripheral) + reg_name##_Off)
62 
63 #define VBP_REG8(APB_peripheral,reg_name) (*(REG8*) (VBP_REG_PER_BASE_ADDRES(APB_peripheral) + reg_name##_Off))
64 
65 #define VBP_REG16(APB_peripheral,reg_name) (*(REG16*) (VBP_REG_PER_BASE_ADDRES(APB_peripheral) + reg_name##_Off))
66 
67 #define VBP_REG32(APB_peripheral,reg_name) (*(REG32*) (VBP_REG_PER_BASE_ADDRES(APB_peripheral) + reg_name##_Off))
68 
69 
70 /** @} end of group xgportARM7_NXP */
71 #endif /* _ARCH_ARM_REG_MACROS_H_ */