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_17xx_40xx.h
Go to the documentation of this file.
1
/*
2
* @brief LPC17xx/40xx 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_17XX_40XX_H_
33
#define __TIMER_17XX_40XX_H_
34
35
#ifdef __cplusplus
36
extern
"C"
{
37
#endif
38
52
STATIC
INLINE
bool
Chip_TIMER_MatchPending
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
53
{
54
return
IP_TIMER_MatchPending
(pTMR, matchnum);
55
}
56
65
STATIC
INLINE
bool
Chip_TIMER_CapturePending
(
LPC_TIMER_T
*pTMR, int8_t capnum)
66
{
67
return
IP_TIMER_CapturePending
(pTMR, capnum);
68
}
69
77
STATIC
INLINE
void
Chip_TIMER_ClearMatch
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
78
{
79
IP_TIMER_ClearMatch
(pTMR, matchnum);
80
}
81
89
STATIC
INLINE
void
Chip_TIMER_ClearCapture
(
LPC_TIMER_T
*pTMR, int8_t capnum)
90
{
91
IP_TIMER_ClearCapture
(pTMR, capnum);
92
}
93
100
STATIC
INLINE
void
Chip_TIMER_Enable
(
LPC_TIMER_T
*pTMR)
101
{
102
IP_TIMER_Enable
(pTMR);
103
}
104
111
STATIC
INLINE
void
Chip_TIMER_Disable
(
LPC_TIMER_T
*pTMR)
112
{
113
IP_TIMER_Disable
(pTMR);
114
}
115
122
STATIC
INLINE
uint32_t
Chip_TIMER_ReadCount
(
LPC_TIMER_T
*pTMR)
123
{
124
return
IP_TIMER_ReadCount
(pTMR);
125
}
126
133
STATIC
INLINE
uint32_t
Chip_TIMER_ReadPrescale
(
LPC_TIMER_T
*pTMR)
134
{
135
return
IP_TIMER_ReadPrescale
(pTMR);
136
}
137
145
STATIC
INLINE
void
Chip_TIMER_PrescaleSet
(
LPC_TIMER_T
*pTMR,
uint32_t
prescale)
146
{
147
IP_TIMER_PrescaleSet
(pTMR, prescale);
148
}
149
158
STATIC
INLINE
void
Chip_TIMER_SetMatch
(
LPC_TIMER_T
*pTMR, int8_t matchnum,
uint32_t
matchval)
159
{
160
IP_TIMER_SetMatch
(pTMR, matchnum, matchval);
161
}
162
170
STATIC
INLINE
uint32_t
Chip_TIMER_ReadCapture
(
LPC_TIMER_T
*pTMR, int8_t capnum)
171
{
172
return
IP_TIMER_ReadCapture
(pTMR, capnum);
173
}
174
180
STATIC
INLINE
void
Chip_TIMER_Reset
(
LPC_TIMER_T
*pTMR)
181
{
182
IP_TIMER_Reset
(pTMR);
183
}
184
192
STATIC
INLINE
void
Chip_TIMER_MatchEnableInt
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
193
{
194
IP_TIMER_MatchEnableInt
(pTMR, matchnum);
195
}
196
203
STATIC
INLINE
void
Chip_TIMER_MatchDisableInt
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
204
{
205
IP_TIMER_MatchDisableInt
(pTMR, matchnum);
206
}
207
214
STATIC
INLINE
void
Chip_TIMER_ResetOnMatchEnable
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
215
{
216
IP_TIMER_ResetOnMatchEnable
(pTMR, matchnum);
217
}
218
225
STATIC
INLINE
void
Chip_TIMER_ResetOnMatchDisable
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
226
{
227
IP_TIMER_ResetOnMatchDisable
(pTMR, matchnum);
228
}
229
236
STATIC
INLINE
void
Chip_TIMER_StopOnMatchEnable
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
237
{
238
IP_TIMER_StopOnMatchEnable
(pTMR, matchnum);
239
}
240
248
STATIC
INLINE
void
Chip_TIMER_StopOnMatchDisable
(
LPC_TIMER_T
*pTMR, int8_t matchnum)
249
{
250
IP_TIMER_StopOnMatchDisable
(pTMR, matchnum);
251
}
252
261
STATIC
INLINE
void
Chip_TIMER_CaptureRisingEdgeEnable
(
LPC_TIMER_T
*pTMR, int8_t capnum)
262
{
263
IP_TIMER_CaptureRisingEdgeEnable
(pTMR, capnum);
264
}
265
274
STATIC
INLINE
void
Chip_TIMER_CaptureRisingEdgeDisable
(
LPC_TIMER_T
*pTMR, int8_t capnum)
275
{
276
IP_TIMER_CaptureRisingEdgeDisable
(pTMR, capnum);
277
}
278
287
STATIC
INLINE
void
Chip_TIMER_CaptureFallingEdgeEnable
(
LPC_TIMER_T
*pTMR, int8_t capnum)
288
{
289
IP_TIMER_CaptureFallingEdgeEnable
(pTMR, capnum);
290
}
291
300
STATIC
INLINE
void
Chip_TIMER_CaptureFallingEdgeDisable
(
LPC_TIMER_T
*pTMR, int8_t capnum)
301
{
302
IP_TIMER_CaptureFallingEdgeDisable
(pTMR, capnum);
303
}
304
313
STATIC
INLINE
void
Chip_TIMER_CaptureEnableInt
(
LPC_TIMER_T
*pTMR, int8_t capnum)
314
{
315
IP_TIMER_CaptureEnableInt
(pTMR, capnum);
316
}
317
324
STATIC
INLINE
void
Chip_TIMER_CaptureDisableInt
(
LPC_TIMER_T
*pTMR, int8_t capnum)
325
{
326
IP_TIMER_CaptureDisableInt
(pTMR, capnum);
327
}
328
339
STATIC
INLINE
void
Chip_TIMER_ExtMatchControlSet
(
LPC_TIMER_T
*pTMR, int8_t initial_state,
340
IP_TIMER_PIN_MATCH_STATE_T
matchState, int8_t matchnum)
341
{
342
IP_TIMER_ExtMatchControlSet
(pTMR, initial_state, matchState, matchnum);
343
}
344
353
STATIC
INLINE
void
Chip_TIMER_TIMER_SetCountClockSrc
(
LPC_TIMER_T
*pTMR,
354
IP_TIMER_CAP_SRC_STATE_T
capSrc,
355
int8_t capnum)
356
{
357
IP_TIMER_SetCountClockSrc
(pTMR, capSrc, capnum);
358
}
359
365
void
Chip_TIMER_Init
(
LPC_TIMER_T
*pTMR);
366
372
void
Chip_TIMER_DeInit
(
LPC_TIMER_T
*pTMR);
373
378
#ifdef __cplusplus
379
}
380
#endif
381
382
#endif
/* __TIMER_17XX_40XX_H_ */
software
lpc_core
lpc_chip
chip_17xx_40xx
timer_17xx_40xx.h
Generated on Fri May 10 2013 10:42:15 for LPCOpen Platform by
1.8.2