CoX Peripheral Interface V2.1
API Reference
xhw_types.h
Go to the documentation of this file.
00001 //*****************************************************************************
00002 //
00037 //
00038 //*****************************************************************************
00039 
00040 #ifndef __XHW_TYPES_H__
00041 #define __XHW_TYPES_H__
00042 
00043 //*****************************************************************************
00044 //
00047 //
00048 //*****************************************************************************
00049 
00050 //*****************************************************************************
00051 //
00054 //
00055 //*****************************************************************************
00056 
00057 //*****************************************************************************
00058 //
00061 //
00062 //*****************************************************************************
00063 
00064 //*****************************************************************************
00065 //
00069 //
00070 //*****************************************************************************
00071 
00072 //*****************************************************************************
00073 //
00075 //
00076 //*****************************************************************************
00077 typedef unsigned char xtBoolean;
00078 
00079 #ifndef xtrue
00080 #define xtrue 1
00081 #endif
00082 
00083 #ifndef xfalse
00084 #define xfalse 0
00085 #endif
00086 
00087 //*****************************************************************************
00088 //
00104 //
00105 //*****************************************************************************
00106 typedef unsigned long (* xtEventCallback)(void *pvCBData, 
00107                                        unsigned long ulEvent,
00108                                        unsigned long ulMsgParam,
00109                                        void *pvMsgData);
00110 
00111 //*****************************************************************************
00112 //
00114 //
00115 //*****************************************************************************
00116 
00117 //*****************************************************************************
00118 //
00123 //
00124 //*****************************************************************************
00125 #define xHWREG(x)                                                             \
00126         (*((volatile unsigned long *)(x)))
00127 #define xHWREGH(x)                                                            \
00128         (*((volatile unsigned short *)(x)))
00129 #define xHWREGB(x)                                                            \
00130         (*((volatile unsigned char *)(x)))
00131 #define xHWREGBITW(x, b)                                                      \
00132         xHWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 |               \
00133               (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
00134 #define xHWREGBITH(x, b)                                                      \
00135         xHWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 |              \
00136                (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
00137 #define xHWREGBITB(x, b)                                                      \
00138         xHWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 |              \
00139                (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
00140 
00141 //*****************************************************************************
00142 //
00144 //
00145 //*****************************************************************************
00146 
00147 //*****************************************************************************
00148 //
00150 //
00151 //*****************************************************************************
00152 
00153 //*****************************************************************************
00154 //
00156 //
00157 //*****************************************************************************
00158 
00159 //*****************************************************************************
00160 //
00162 //
00163 //*****************************************************************************
00164 
00165 #endif // __XHW_TYPES_H__
00166