| 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
timer_11xx.h
Go to the documentation of this file.
1 /*
2 * @brief 11xx 16/32-bit Timer/PWM control functions
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 __TIMER_11XX_H_
33 #define __TIMER_11XX_H_
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
49 void Chip_TIMER_Init(LPC_TIMER_T *pTMR);
50
56 void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR);
57
66 STATIC INLINE bool Chip_TIMER_MatchPending(LPC_TIMER_T *pTMR, int8_t matchnum)
67 {
68 return IP_TIMER_MatchPending(pTMR, matchnum);
69 }
70
79 STATIC INLINE bool Chip_TIMER_CapturePending(LPC_TIMER_T *pTMR, int8_t capnum)
80 {
81 return IP_TIMER_CapturePending(pTMR, capnum);
82 }
83
90 STATIC INLINE void Chip_TIMER_ClearMatch(LPC_TIMER_T *pTMR, int8_t matchnum)
91 {
92 IP_TIMER_ClearMatch(pTMR, matchnum);
93 }
94
101 STATIC INLINE void Chip_TIMER_ClearCapture(LPC_TIMER_T *pTMR, int8_t capnum)
102 {
103 IP_TIMER_ClearCapture(pTMR, capnum);
104 }
105
111 STATIC INLINE void Chip_TIMER_Enable(LPC_TIMER_T *pTMR)
112 {
113 IP_TIMER_Enable(pTMR);
114 }
115
121 STATIC INLINE void Chip_TIMER_Disable(LPC_TIMER_T *pTMR)
122 {
123 IP_TIMER_Disable(pTMR);
124 }
125
132 STATIC INLINE uint32_t Chip_TIMER_ReadCount(LPC_TIMER_T *pTMR)
133 {
134 return IP_TIMER_ReadCount(pTMR);
135 }
136
143 STATIC INLINE uint32_t Chip_TIMER_ReadPrescale(LPC_TIMER_T *pTMR)
144 {
145 return IP_TIMER_ReadPrescale(pTMR);
146 }
147
154 STATIC INLINE void Chip_TIMER_PrescaleSet(LPC_TIMER_T *pTMR, uint32_t prescale)
155 {
156 IP_TIMER_PrescaleSet(pTMR, prescale);
157 }
158
166 STATIC INLINE void Chip_TIMER_SetMatch(LPC_TIMER_T *pTMR, int8_t matchnum, uint32_t matchval)
167 {
168 IP_TIMER_SetMatch(pTMR, matchnum, matchval);
169 }
170
178 STATIC INLINE uint32_t Chip_TIMER_ReadCapture(LPC_TIMER_T *pTMR, int8_t capnum)
179 {
180 return IP_TIMER_ReadCapture(pTMR, capnum);
181 }
182
188 STATIC INLINE void Chip_TIMER_Reset(LPC_TIMER_T *pTMR)
189 {
190 IP_TIMER_Reset(pTMR);
191 }
192
200 STATIC INLINE void Chip_TIMER_MatchEnableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
201 {
202 IP_TIMER_MatchEnableInt(pTMR, matchnum);
203 }
204
211 STATIC INLINE void Chip_TIMER_MatchDisableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
212 {
213 IP_TIMER_MatchDisableInt(pTMR, matchnum);
214 }
215
222 STATIC INLINE void Chip_TIMER_ResetOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
223 {
224 IP_TIMER_ResetOnMatchEnable(pTMR, matchnum);
225 }
226
233 STATIC INLINE void Chip_TIMER_ResetOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
234 {
235 IP_TIMER_ResetOnMatchDisable(pTMR, matchnum);
236 }
237
245 STATIC INLINE void Chip_TIMER_StopOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
246 {
247 IP_TIMER_StopOnMatchEnable(pTMR, matchnum);
248 }
249
257 STATIC INLINE void Chip_TIMER_StopOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
258 {
259 IP_TIMER_StopOnMatchDisable(pTMR, matchnum);
260 }
261
270 STATIC INLINE void Chip_TIMER_CaptureRisingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
271 {
272 IP_TIMER_CaptureRisingEdgeEnable(pTMR, capnum);
273 }
274
283 STATIC INLINE void Chip_TIMER_CaptureRisingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
284 {
285 IP_TIMER_CaptureRisingEdgeDisable(pTMR, capnum);
286 }
287
296 STATIC INLINE void Chip_TIMER_CaptureFallingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
297 {
298 IP_TIMER_CaptureFallingEdgeEnable(pTMR, capnum);
299 }
300
309 STATIC INLINE void Chip_TIMER_CaptureFallingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
310 {
311 IP_TIMER_CaptureFallingEdgeDisable(pTMR, capnum);
312 }
313
322 STATIC INLINE void Chip_TIMER_CaptureEnableInt(LPC_TIMER_T *pTMR, int8_t capnum)
323 {
324 IP_TIMER_CaptureEnableInt(pTMR, capnum);
325 }
326
333 STATIC INLINE void Chip_TIMER_CaptureDisableInt(LPC_TIMER_T *pTMR, int8_t capnum)
334 {
335 IP_TIMER_CaptureDisableInt(pTMR, capnum);
336 }
337
348 STATIC INLINE void Chip_TIMER_ExtMatchControlSet(LPC_TIMER_T *pTMR, int8_t initial_state,
349 IP_TIMER_PIN_MATCH_STATE_T matchState, int8_t matchnum)
350 {
351 IP_TIMER_ExtMatchControlSet(pTMR, initial_state, matchState, matchnum);
352 }
353
362 STATIC INLINE void Chip_TIMER_TIMER_SetCountClockSrc(LPC_TIMER_T *pTMR,
363 IP_TIMER_CAP_SRC_STATE_T capSrc,
364 int8_t capnum)
365 {
366 IP_TIMER_SetCountClockSrc(pTMR, capSrc, capnum);
367 }
368
373 #ifdef __cplusplus
374 }
375 #endif
376
377 #endif /* __TIMER_11XX_H_ */