]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/ThirdParty/CMSISv2p10_LPC18xx_DriverLib/inc/lpc18xx_evrt.h
Slight modification to license blub text in header comments.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / ThirdParty / CMSISv2p10_LPC18xx_DriverLib / inc / lpc18xx_evrt.h
1 /**********************************************************************\r
2 * $Id$          lpc18xx_evrt.h                  2011-06-02\r
3 *//**\r
4 * @file         lpc18xx_evrt.h\r
5 * @brief        Contains all macro definitions and function prototypes\r
6 *                       support for Event Router firmware library on LPC18xx\r
7 * @version      1.0\r
8 * @date         02. June. 2011\r
9 * @author       NXP MCU SW Application Team\r
10 *\r
11 * Copyright(C) 2011, NXP Semiconductor\r
12 * All rights reserved.\r
13 *\r
14 ***********************************************************************\r
15 * Software that is described herein is for illustrative purposes only\r
16 * which provides customers with programming information regarding the\r
17 * products. This software is supplied "AS IS" without any warranties.\r
18 * NXP Semiconductors assumes no responsibility or liability for the\r
19 * use of the software, conveys no license or title under any patent,\r
20 * copyright, or mask work right to the product. NXP Semiconductors\r
21 * reserves the right to make changes in the software without\r
22 * notification. NXP Semiconductors also make no representation or\r
23 * warranty that such application will be suitable for the specified\r
24 * use without further testing or modification.\r
25 **********************************************************************/\r
26 \r
27 /* Peripheral group ----------------------------------------------------------- */\r
28 /** @defgroup EVRT EVRT (Event Router)\r
29  * @ingroup LPC1800CMSIS_FwLib_Drivers\r
30  * @{\r
31  */\r
32 \r
33 #ifndef LPC18XX_EVRT_H_\r
34 #define LPC18XX_EVRT_H_\r
35 \r
36 /* Includes ------------------------------------------------------------------- */\r
37 #include "LPC18xx.h"\r
38 #include "lpc_types.h"\r
39 \r
40 \r
41 #ifdef __cplusplus\r
42 extern "C"\r
43 {\r
44 #endif\r
45 \r
46 \r
47 /* Private Macros ------------------------------------------------------------- */\r
48 /** @defgroup EVRT_Private_Macros EVRT Private Macros\r
49  * @{\r
50  */\r
51 \r
52 /* ---------------- CHECK PARAMETER DEFINITIONS ---------------------------- */\r
53 /** Macro to determine if it is valid EVRT peripheral */\r
54 #define PARAM_EVRTx(x)  (((uint32_t *)x)==((uint32_t *)LPC_EVENTROUTER))\r
55 \r
56 /* Macro check EVRT source */\r
57 #define PARAM_EVRT_SOURCE(n)    ((n==EVRT_SRC_WAKEUP0) || (n==EVRT_SRC_WAKEUP1) \\r
58 || (n==EVRT_SRC_WAKEUP2) || (n==EVRT_SRC_WAKEUP3) \\r
59 || (n==EVRT_SRC_ATIMER) || (n==EVRT_SRC_RTC) \\r
60 || (n==EVRT_SRC_BOD1) || (n==EVRT_SRC_WWDT) \\r
61 || (n==EVRT_SRC_ETHERNET) || (n==EVRT_SRC_USB0) \\r
62 || (n==EVRT_SRC_USB1) || (n==EVRT_SRC_CCAN) || (n==EVRT_SRC_SDIO) \\r
63 || (n==EVRT_SRC_COMBINE_TIMER2) || (n==EVRT_SRC_COMBINE_TIMER6) \\r
64 || (n==EVRT_SRC_QEI) || (n==EVRT_SRC_COMBINE_TIMER14) \\r
65 || (n==EVRT_SRC_RESET)) \\r
66 \r
67 /* Macro check EVRT source active type*/\r
68 #define PARAM_EVRT_SOURCE_ACTIVE_TYPE(n) ((n==EVRT_SRC_ACTIVE_LOW_LEVEL) || (n==EVRT_SRC_ACTIVE_HIGH_LEVEL) \\r
69                  || (n==EVRT_SRC_ACTIVE_FALLING_EDGE) || (n==EVRT_SRC_ACTIVE_RISING_EDGE))\r
70 \r
71 /**\r
72  * @}\r
73  */\r
74 \r
75 \r
76 /* Public Types --------------------------------------------------------------- */\r
77 /** @defgroup EVRT_Public_Types EVRT Public Types\r
78  * @{\r
79  */\r
80 \r
81 /** @brief EVRT input sources */\r
82 typedef enum {\r
83         EVRT_SRC_WAKEUP0,                               /**< WAKEUP0 event router source                */\r
84         EVRT_SRC_WAKEUP1,                               /**< WAKEUP1 event router source                */\r
85         EVRT_SRC_WAKEUP2,                               /**< WAKEUP2 event router source                */\r
86         EVRT_SRC_WAKEUP3,                               /**< WAKEUP3 event router source                */\r
87         EVRT_SRC_ATIMER,                                /**< Alarm timer event router source    */\r
88         EVRT_SRC_RTC,                                   /**< RTC event router source                    */\r
89         EVRT_SRC_BOD1,                                  /**< BOD event router source                    */\r
90         EVRT_SRC_WWDT,                                  /**< WWDT event router source                   */\r
91         EVRT_SRC_ETHERNET,                              /**< Ethernet event router source               */\r
92         EVRT_SRC_USB0,                                  /**< USB0 event router source                   */\r
93         EVRT_SRC_USB1,                                  /**< USB1 event router source                   */\r
94         EVRT_SRC_SDIO,                                  /**< Reserved                                                   */\r
95         EVRT_SRC_CCAN,                                  /**< C_CAN event router source                  */\r
96         EVRT_SRC_COMBINE_TIMER2,                /**< Combined timer 2 event router source       */\r
97         EVRT_SRC_COMBINE_TIMER6,                /**< Combined timer 6 event router source       */\r
98         EVRT_SRC_QEI,                                   /**< QEI event router source                    */\r
99         EVRT_SRC_COMBINE_TIMER14,               /**< Combined timer 14 event router source      */\r
100         EVRT_SRC_RESERVED1,                             /**< Reserved                                                   */\r
101         EVRT_SRC_RESERVED2,                             /**< Reserved                                                   */\r
102         EVRT_SRC_RESET                                  /**< Reset event router source                  */\r
103 } EVRT_SRC_ENUM;\r
104 \r
105 \r
106 /** @brief EVRT input sources detecting type */\r
107 typedef enum {\r
108         EVRT_SRC_ACTIVE_LOW_LEVEL,              /**< Active low level           */\r
109         EVRT_SRC_ACTIVE_HIGH_LEVEL,             /**< Active high level          */\r
110         EVRT_SRC_ACTIVE_FALLING_EDGE,   /**< Active falling edge        */\r
111         EVRT_SRC_ACTIVE_RISING_EDGE     /**< Active rising edge         */\r
112 }EVRT_SRC_ACTIVE_TYPE;\r
113 /**\r
114  * @}\r
115  */\r
116 \r
117 \r
118 \r
119 /* Public Functions ----------------------------------------------------------- */\r
120 /** @defgroup EVRT_Public_Functions EVRT Public Functions\r
121  * @{\r
122  */\r
123 \r
124 void EVRT_Init (LPC_EVENTROUTER_Type *EVRTx);\r
125 void EVRT_DeInit(LPC_EVENTROUTER_Type *EVRTx);\r
126 \r
127 void EVRT_ConfigIntSrcActiveType(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, EVRT_SRC_ACTIVE_TYPE type);\r
128 void EVRT_SetUpIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src, FunctionalState state);\r
129 Bool EVRT_IsSourceInterrupting(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src);\r
130 void EVRT_ClrPendIntSrc(LPC_EVENTROUTER_Type *EVRTx, EVRT_SRC_ENUM EVRT_Src);\r
131 \r
132 /**\r
133  * @}\r
134  */\r
135 \r
136 #ifdef __cplusplus\r
137 }\r
138 #endif\r
139 \r
140 #endif /* LPC18XX_EVRT_H_ */\r
141 \r
142 /**\r
143  * @}\r
144  */\r
145 \r
146 /* --------------------------------- End Of File ------------------------------ */\r