| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cmp_17xx_40xx.h
Go to the documentation of this file.
1 /*
2 * @brief LPC17xx/40xx Analog Comparator 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 licenser 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 __CMP_17XX_40XX_H_
33 #define __CMP_17XX_40XX_H_
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #if defined(CHIP_LPC407X_8X)
40
50 void Chip_CMP_Init(void);
51
56 void Chip_CMP_DeInit(void);
57
63 STATIC INLINE void Chip_CMP_EnableCurrentSrc(IP_CMP_ENCTRL_T en)
64 {
65 IP_CMP_EnableCurrentSrc(LPC_CMP, en);
66 }
67
73 STATIC INLINE void Chip_CMP_EnableBandGap(IP_CMP_ENCTRL_T en)
74 {
75 IP_CMP_EnableBandGap(LPC_CMP, en);
76 }
77
83 STATIC INLINE void Chip_CMP_ControlROSC(uint32_t flag)
84 {
85 IP_CMP_ControlROSC(LPC_CMP, flag);
86 }
87
93 STATIC INLINE void Chip_CMP_SetTimerCapInput(uint32_t flag)
94 {
95 IP_CMP_SetTimerCapInput(LPC_CMP, flag);
96 }
97
106 STATIC INLINE void Chip_CMP_SetupVoltLadder(uint8_t id,
107 uint16_t ladSel, uint32_t flag)
108 {
109 IP_CMP_SetupVoltLadder(LPC_CMP, id, ladSel, flag);
110 }
111
117 STATIC INLINE void Chip_CMP_EnableVoltLadder(uint8_t id, IP_CMP_ENCTRL_T en)
118 {
119 IP_CMP_EnableVoltLadder(LPC_CMP, id, en);
120 }
121
128 STATIC INLINE void Chip_CMP_SetPosVoltRef(uint8_t id, IP_CMP_INPUT_T input)
129 {
130 IP_CMP_SetPosVoltRef(LPC_CMP, id, input);
131 }
132
139 STATIC INLINE void Chip_CMP_SetNegVoltRef(uint8_t id, IP_CMP_INPUT_T input)
140 {
141 IP_CMP_SetNegVoltRef(LPC_CMP, id, input);
142 }
143
150 STATIC INLINE void Chip_CMP_SetHysteresis(uint8_t id, IP_CMP_HYS_T hys)
151 {
152 IP_CMP_SetHysteresis(LPC_CMP, id, hys);
153 }
154
161 STATIC INLINE void Chip_CMP_Enable(uint8_t id, IP_CMP_ENCTRL_T en)
162 {
163 IP_CMP_Enable(LPC_CMP, id, en);
164 }
165
171 STATIC INLINE FlagStatus Chip_CMP_GetCmpStatus(uint8_t id)
172 {
173 return IP_CMP_GetCmpStatus(LPC_CMP, id);
174 }
175
181 STATIC INLINE void Chip_CMP_EnableOuput(uint8_t id)
182 {
183 IP_CMP_EnableOuput(LPC_CMP, id);
184 }
185
191 STATIC INLINE void Chip_CMP_DisableOutput(uint8_t id)
192 {
193 IP_CMP_DisableOutput(LPC_CMP, id);
194 }
195
201 STATIC INLINE void Chip_CMP_EnableSyncCmpOut(uint8_t id)
202 {
203 IP_CMP_EnableSyncCmpOut(LPC_CMP, id);
204 }
205
211 STATIC INLINE void Chip_CMP_DisableSyncCmpOut(uint8_t id)
212 {
213 IP_CMP_DisableSyncCmpOut(LPC_CMP, id);
214 }
215
223 STATIC INLINE void Chip_CMP_ConfigInt(uint8_t id,
224 uint32_t intFlag,
225 IP_CMP_INTEDGE_T edgeSel)
226 {
227 IP_CMP_ConfigInt(LPC_CMP, id, intFlag, edgeSel);
228 }
229
235 STATIC INLINE FlagStatus Chip_CMP_GetIntStatus(uint8_t id)
236 {
237 return IP_CMP_GetIntStatus(LPC_CMP, id);
238 }
239
245 STATIC INLINE void Chip_CMP_ClearIntStatus(uint8_t id)
246 {
247 IP_CMP_CMP_ClearIntStatus(LPC_CMP, id);
248 }
249
250 #endif /*defined(CHIP_LPC407X_8X)*/
251
256 #ifdef __cplusplus
257 }
258 #endif
259
260 #endif /* __CMP_17XX_40XX_H_ */