1 |
581 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// hw_types.h - Common types and macros.
|
4 |
|
|
//
|
5 |
|
|
// Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// Software License Agreement
|
8 |
|
|
//
|
9 |
|
|
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
|
10 |
|
|
// exclusively on LMI's Stellaris Family of microcontroller products.
|
11 |
|
|
//
|
12 |
|
|
// The software is owned by LMI and/or its suppliers, and is protected under
|
13 |
|
|
// applicable copyright laws. All rights are reserved. Any use in violation
|
14 |
|
|
// of the foregoing restrictions may subject the user to criminal sanctions
|
15 |
|
|
// under applicable laws, as well as to civil liability for the breach of the
|
16 |
|
|
// terms and conditions of this license.
|
17 |
|
|
//
|
18 |
|
|
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
|
19 |
|
|
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
|
20 |
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
|
21 |
|
|
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
|
22 |
|
|
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
23 |
|
|
//
|
24 |
|
|
// This is part of revision 523 of the Stellaris Driver Library.
|
25 |
|
|
//
|
26 |
|
|
//*****************************************************************************
|
27 |
|
|
|
28 |
|
|
#ifndef __HW_TYPES_H__
|
29 |
|
|
#define __HW_TYPES_H__
|
30 |
|
|
|
31 |
|
|
//*****************************************************************************
|
32 |
|
|
//
|
33 |
|
|
// Define a boolean type, and values for true and false.
|
34 |
|
|
//
|
35 |
|
|
//*****************************************************************************
|
36 |
|
|
typedef unsigned char tBoolean;
|
37 |
|
|
|
38 |
|
|
#ifndef true
|
39 |
|
|
#define true 1
|
40 |
|
|
#endif
|
41 |
|
|
|
42 |
|
|
#ifndef false
|
43 |
|
|
#define false 0
|
44 |
|
|
#endif
|
45 |
|
|
|
46 |
|
|
//*****************************************************************************
|
47 |
|
|
//
|
48 |
|
|
// Macros for hardware access, both direct and via the bit-band region.
|
49 |
|
|
//
|
50 |
|
|
//*****************************************************************************
|
51 |
|
|
#define HWREG(x) \
|
52 |
|
|
(*((volatile unsigned long *)(x)))
|
53 |
|
|
#define HWREGBITW(x, b) \
|
54 |
|
|
HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
|
55 |
|
|
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
|
56 |
|
|
#define HWREGBITH(x, b) \
|
57 |
|
|
HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
|
58 |
|
|
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
|
59 |
|
|
#define HWREGBITB(x, b) \
|
60 |
|
|
HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
|
61 |
|
|
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
|
62 |
|
|
|
63 |
|
|
#endif // __HW_TYPES_H__
|