pinint_11xx.h
Go to the documentation of this file.
1 /*
2  * @brief LPC11xx Pin Interrupt and Pattern Match Registers and driver
3  *
4  * @note
5  * Copyright(C) NXP Semiconductors, 2012
6  * All rights reserved.
7  *
8  * @par
9  * Software that is described herein is for illustrative purposes only
10  * which provides customers with programming information regarding the
11  * LPC products. This software is supplied "AS IS" without any warranties of
12  * any kind, and NXP Semiconductors and its licensor disclaim any and
13  * all warranties, express or implied, including all implied warranties of
14  * merchantability, fitness for a particular purpose and non-infringement of
15  * intellectual property rights. NXP Semiconductors assumes no responsibility
16  * or liability for the use of the software, conveys no license or rights under any
17  * patent, copyright, mask work right, or any other intellectual property rights in
18  * or to any products. NXP Semiconductors reserves the right to make changes
19  * in the software without notification. NXP Semiconductors also makes no
20  * representation or warranty that such application will be suitable for the
21  * specified use without further testing or modification.
22  *
23  * @par
24  * Permission to use, copy, modify, and distribute this software and its
25  * documentation is hereby granted, under NXP Semiconductors' and its
26  * licensor's relevant copyrights in the software, without fee, provided that it
27  * is used in conjunction with NXP Semiconductors microcontrollers. This
28  * copyright, permission, and disclaimer notice must appear in all copies of
29  * this code.
30  */
31 
32 #ifndef __PININT_11XX_H_
33 #define __PININT_11XX_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
46 #if defined(CHIP_LPC11AXX) || defined(CHIP_LPC11EXX) || defined(CHIP_LPC11UXX)
47 
51 typedef struct {
52  __IO uint32_t ISEL;
53  __IO uint32_t IENR;
54  __IO uint32_t SIENR;
55  __IO uint32_t CIENR;
56  __IO uint32_t IENF;
57  __IO uint32_t SIENF;
58  __IO uint32_t CIENF;
59  __IO uint32_t RISE;
60  __IO uint32_t FALL;
61  __IO uint32_t IST;
62 } LPC_PIN_INT_T;
63 
67 #define PININTCH0 (1 << 0)
68 #define PININTCH1 (1 << 1)
69 #define PININTCH2 (1 << 2)
70 #define PININTCH3 (1 << 3)
71 #define PININTCH4 (1 << 4)
72 #define PININTCH5 (1 << 5)
73 #define PININTCH6 (1 << 6)
74 #define PININTCH7 (1 << 7)
75 #define PININTCH(ch) (1 << (ch))
76 
83 STATIC INLINE void Chip_PININT_Init(LPC_PIN_INT_T *pPININT) {}
84 
90 STATIC INLINE void Chip_PININT_DeInit(LPC_PIN_INT_T *pPININT) {}
91 
98 STATIC INLINE void Chip_PININT_SetPinModeEdge(LPC_PIN_INT_T *pPININT, uint32_t pins)
99 {
100  pPININT->ISEL &= ~pins;
101 }
102 
109 STATIC INLINE void Chip_PININT_SetPinModeLevel(LPC_PIN_INT_T *pPININT, uint32_t pins)
110 {
111  pPININT->ISEL |= pins;
112 }
113 
122 STATIC INLINE uint32_t Chip_PININT_GetHighEnabled(LPC_PIN_INT_T *pPININT)
123 {
124  return pPININT->IENR;
125 }
126 
133 STATIC INLINE void Chip_PININT_EnableIntHigh(LPC_PIN_INT_T *pPININT, uint32_t pins)
134 {
135  pPININT->SIENR = pins;
136 }
137 
144 STATIC INLINE void Chip_PININT_DisableIntHigh(LPC_PIN_INT_T *pPININT, uint32_t pins)
145 {
146  pPININT->CIENR = pins;
147 }
148 
157 STATIC INLINE uint32_t Chip_PININT_GetLowEnabled(LPC_PIN_INT_T *pPININT)
158 {
159  return pPININT->IENF;
160 }
161 
168 STATIC INLINE void Chip_PININT_EnableIntLow(LPC_PIN_INT_T *pPININT, uint32_t pins)
169 {
170  pPININT->SIENF = pins;
171 }
172 
179 STATIC INLINE void Chip_PININT_DisableIntLow(LPC_PIN_INT_T *pPININT, uint32_t pins)
180 {
181  pPININT->CIENF = pins;
182 }
183 
189 STATIC INLINE uint32_t Chip_PININT_GetRiseStates(LPC_PIN_INT_T *pPININT)
190 {
191  return pPININT->RISE;
192 }
193 
200 STATIC INLINE void Chip_PININT_ClearRiseStates(LPC_PIN_INT_T *pPININT, uint32_t pins)
201 {
202  pPININT->RISE = pins;
203 }
204 
210 STATIC INLINE uint32_t Chip_PININT_GetFallStates(LPC_PIN_INT_T *pPININT)
211 {
212  return pPININT->FALL;
213 }
214 
221 STATIC INLINE void Chip_PININT_ClearFallStates(LPC_PIN_INT_T *pPININT, uint32_t pins)
222 {
223  pPININT->FALL = pins;
224 }
225 
231 STATIC INLINE uint32_t Chip_PININT_GetIntStatus(LPC_PIN_INT_T *pPININT)
232 {
233  return pPININT->IST;
234 }
235 
242 STATIC INLINE void Chip_PININT_ClearIntStatus(LPC_PIN_INT_T *pPININT, uint32_t pins)
243 {
244  pPININT->IST = pins;
245 }
246 
247 #endif /* defined(CHIP_LPC11AXX) || defined(CHIP_LPC11EXX) || defined(CHIP_LPC11UXX) */
248 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #endif /* __PININT_11XX_H_ */
uavcan::uint32_t
std::uint32_t uint32_t
Definition: std.hpp:26
__IO
#define __IO
Definition: core_cm0.h:154
INLINE
#define INLINE
Definition: lpc_types.h:205
STATIC
#define STATIC
Definition: lpc_types.h:140


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:02