summaryrefslogtreecommitdiff
path: root/bsp/nv32f100x/lib/inc/common.h
blob: f943e6f8fcee4e45e45cd8cc89a6d4a53efe35e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/******************************************************************************
*
* @brief provide header files to be included by all project files. 
*
*******************************************************************************/


#ifndef _COMMON_H_
#define _COMMON_H_

#define swap_bytes(ptrWord)   *ptrWord = (*ptrWord >>8) | (*ptrWord<<8)
typedef unsigned long   dword;
typedef unsigned short  word;

/********************************************************************/

/*
 * Debug prints ON (#define) or OFF (#undef)
 */

#define DEBUG
#define DEBUG_PRINT

/* 
 * Include the generic CPU header file 
 */
#include "arm_cm0.h"

/* 
 * Include the platform specific header file 
 */
#if (defined(NV32))
 #include  "NV32_config.h"
#elif (defined(FRDM_NV32M3))
 #include  "NV32M3_config.h"
#elif (defined(FRDM_NV32M4))
 #include  "NV32M4_config.h"
#else
  #error "No valid board defined"
#endif

/* 
 * Include the cpu specific header file 
*/
#if (defined(CPU_NV32))
 #include "NV32.h"
#elif (defined(CPU_NV32M3))
 #include "NV32M3.h"
#elif (defined(CPU_NV32M4))
 #include "NV32M4.h"
#else
  #error "No valid CPU defined"
#endif


/* 
 * Include any toolchain specfic header files 
 */
#if (defined(__MWERKS__))
  #include "mwerks.h"
#elif (defined(__DCC__))
  #include "build/wrs/diab.h"
#elif (defined(__ghs__))
  #include "build/ghs/ghs.h"
#elif (defined(__GNUC__))
  #if (defined(IAR))
    #include "build/gnu/gnu.h"
  #endif
#elif (defined(IAR))
  #include "iar.h"
#elif (defined(KEIL))
  
#else
#warning "No toolchain specific header included"
#endif

/* 
 * Include common utilities
 */

#define ASSERT(x)

#if (defined(IAR))
#include "intrinsics.h"
#endif
/********************************************************************/

#endif /* _COMMON_H_ */