Trailing whitespace
[bertos.git] / bertos / cpu / cortex-m3 / io / lm3s_types.h
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \brief LM3S generic hardware macros.
34  */
35
36 #ifndef LM3S_TYPES_H
37 #define LM3S_TYPES_H
38
39 #include <cfg/compiler.h>
40 #include <cpu/types.h>
41
42 /**
43  * Helper Macros for determining the particular hardware revision.
44  */
45 /*\{*/
46 #ifndef CLASS_IS_SANDSTORM
47 #define CLASS_IS_SANDSTORM                                                    \
48         (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_M) == SYSCTL_DID0_VER_0) ||   \
49          ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
50           (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_SANDSTORM)))
51 #endif
52
53 #ifndef CLASS_IS_FURY
54 #define CLASS_IS_FURY                                                        \
55         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
56          (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_FURY))
57 #endif
58
59 #ifndef CLASS_IS_DUSTDEVIL
60 #define CLASS_IS_DUSTDEVIL                                                   \
61         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
62          (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_DUSTDEVIL))
63 #endif
64
65 #ifndef CLASS_IS_TEMPEST
66 #define CLASS_IS_TEMPEST                                                     \
67         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
68          (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_TEMPEST))
69 #endif
70
71 #ifndef REVISION_IS_A0
72 #define REVISION_IS_A0                                                     \
73         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
74          (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_0))
75 #endif
76
77 #ifndef REVISION_IS_A1
78 #define REVISION_IS_A1                                                     \
79         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
80          (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_0))
81 #endif
82
83 #ifndef REVISION_IS_A2
84 #define REVISION_IS_A2                                                     \
85         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
86          (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_2))
87 #endif
88
89 #ifndef REVISION_IS_B0
90 #define REVISION_IS_B0                                                     \
91         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
92          (SYSCTL_DID0_MAJ_REVB | SYSCTL_DID0_MIN_0))
93 #endif
94
95 #ifndef REVISION_IS_B1
96 #define REVISION_IS_B1                                                     \
97         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
98          (SYSCTL_DID0_MAJ_REVB | SYSCTL_DID0_MIN_1))
99 #endif
100
101 #ifndef REVISION_IS_C0
102 #define REVISION_IS_C0                                                     \
103         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
104          (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_0))
105 #endif
106
107 #ifndef REVISION_IS_C1
108 #define REVISION_IS_C1                                                     \
109         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
110          (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_1))
111 #endif
112
113 #ifndef REVISION_IS_C2
114 #define REVISION_IS_C2                                                     \
115         ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
116          (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_2))
117 #endif
118 /*\}*/
119
120 #endif /* LM3S_TYPES_H */