1 /**********************************************************************
\r
2 * $Id$ lpc18xx_evrt.h 2011-06-02
\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
8 * @date 02. June. 2011
\r
9 * @author NXP MCU SW Application Team
\r
11 * Copyright(C) 2011, NXP Semiconductor
\r
12 * All rights reserved.
\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
27 /* Peripheral group ----------------------------------------------------------- */
\r
28 /** @defgroup EVRT EVRT (Event Router)
\r
29 * @ingroup LPC1800CMSIS_FwLib_Drivers
\r
33 #ifndef LPC18XX_EVRT_H_
\r
34 #define LPC18XX_EVRT_H_
\r
36 /* Includes ------------------------------------------------------------------- */
\r
37 #include "LPC18xx.h"
\r
38 #include "lpc_types.h"
\r
47 /* Private Macros ------------------------------------------------------------- */
\r
48 /** @defgroup EVRT_Private_Macros EVRT Private Macros
\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
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
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
76 /* Public Types --------------------------------------------------------------- */
\r
77 /** @defgroup EVRT_Public_Types EVRT Public Types
\r
81 /** @brief EVRT input sources */
\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
106 /** @brief EVRT input sources detecting type */
\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
119 /* Public Functions ----------------------------------------------------------- */
\r
120 /** @defgroup EVRT_Public_Functions EVRT Public Functions
\r
124 void EVRT_Init (LPC_EVENTROUTER_Type *EVRTx);
\r
125 void EVRT_DeInit(LPC_EVENTROUTER_Type *EVRTx);
\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
140 #endif /* LPC18XX_EVRT_H_ */
\r
146 /* --------------------------------- End Of File ------------------------------ */
\r