]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_M4F_M0_LPC43xx_Keil/system/type.h
Add two Cortex-M4F demo applications.
[freertos] / Demo / CORTEX_M4F_M0_LPC43xx_Keil / system / type.h
1 /***********************************************************************\r
2  * $Id: type.h 8242 2011-10-11 15:15:25Z nxp28536 $\r
3  *\r
4  * Project: LPC43xx Common\r
5  *\r
6  * Description:\r
7  *      Type definition Header file for NXP LPC4300 Family\r
8  *  Microprocessors\r
9  *\r
10  ***********************************************************************\r
11  * Software that is described herein is for illustrative purposes only\r
12  * which provides customers with programming information regarding the\r
13  * products. This software is supplied "AS IS" without any warranties.\r
14  * NXP Semiconductors assumes no responsibility or liability for the\r
15  * use of the software, conveys no license or title under any patent,\r
16  * copyright, or mask work right to the product. NXP Semiconductors\r
17  * reserves the right to make changes in the software without\r
18  * notification. NXP Semiconductors also make no representation or\r
19  * warranty that such application will be suitable for the specified\r
20  * use without further testing or modification.\r
21  **********************************************************************/\r
22 \r
23 #ifndef __TYPE_H__\r
24 #define __TYPE_H__\r
25 \r
26 #ifndef NULL\r
27 #define NULL    ((void *)0)\r
28 #endif\r
29 \r
30 #ifndef FALSE\r
31 #define FALSE   (0)\r
32 #endif\r
33 \r
34 #ifndef TRUE\r
35 #define TRUE    (1)\r
36 #endif\r
37 \r
38 #define ABS(value)      (value<0 ? -value : value)\r
39 \r
40 /**\r
41  * @brief Flag Status and Interrupt Flag Status type definition\r
42  */\r
43 typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;\r
44 #define PARAM_SETSTATE(State) ((State==RESET) || (State==SET))\r
45 \r
46 /**\r
47  * @brief Functional State Definition\r
48  */\r
49 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;\r
50 #define PARAM_FUNCTIONALSTATE(State) ((State==DISABLE) || (State==ENABLE))\r
51 \r
52 /**\r
53  * @ Status type definition\r
54  */\r
55 typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;\r
56 \r
57 typedef unsigned char  BYTE;\r
58 typedef unsigned short WORD;\r
59 typedef unsigned long  DWORD;\r
60 typedef unsigned int   BOOL;\r
61 \r
62 typedef union _BITS\r
63 {\r
64         unsigned char value;\r
65         struct _bits\r
66         {\r
67                 unsigned char bit0:1;\r
68                 unsigned char bit1:1;\r
69                 unsigned char bit2:1;\r
70                 unsigned char bit3:1;\r
71                 unsigned char bit4:1;\r
72                 unsigned char bit5:1;\r
73                 unsigned char bit6:1;\r
74                 unsigned char bit7:1;\r
75         }bits;\r
76 }BITS;\r
77 \r
78 #endif  /* __TYPE_H__ */\r