LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
timer_18xx_43xx.h
Go to the documentation of this file.
1
/*
2
* @brief 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_18XX_43XX_H_
33
#define __TIMER_18XX_43XX_H_
34
35
#include "
chip.h
"
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
54
STATIC
INLINE
bool
Chip_TIMER_MatchPending
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
55
{
56
return
IP_TIMER_MatchPending
(TMRx, matchnum);
57
}
58
67
STATIC
INLINE
bool
Chip_TIMER_CapturePending
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
68
{
69
return
IP_TIMER_CapturePending
(TMRx, capnum);
70
}
71
79
STATIC
INLINE
void
Chip_TIMER_ClearMatch
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
80
{
81
IP_TIMER_ClearMatch
(TMRx, matchnum);
82
}
83
91
STATIC
INLINE
void
Chip_TIMER_ClearCapture
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
92
{
93
IP_TIMER_ClearCapture
(TMRx, capnum);
94
}
95
102
STATIC
INLINE
void
Chip_TIMER_Enable
(
LPC_TIMER_Type
*TMRx)
103
{
104
IP_TIMER_Enable
(TMRx);
105
}
106
113
STATIC
INLINE
void
Chip_TIMER_Disable
(
LPC_TIMER_Type
*TMRx)
114
{
115
IP_TIMER_Disable
(TMRx);
116
}
117
124
STATIC
INLINE
uint32_t
Chip_TIMER_ReadCount
(
LPC_TIMER_Type
*TMRx)
125
{
126
return
IP_TIMER_ReadCount
(TMRx);
127
}
128
135
STATIC
INLINE
uint32_t
Chip_TIMER_ReadPrescale
(
LPC_TIMER_Type
*TMRx)
136
{
137
return
IP_TIMER_ReadPrescale
(TMRx);
138
}
139
147
STATIC
INLINE
void
Chip_TIMER_PrescaleSet
(
LPC_TIMER_Type
*TMRx,
uint32_t
prescale)
148
{
149
IP_TIMER_PrescaleSet
(TMRx, prescale);
150
}
151
160
STATIC
INLINE
void
Chip_TIMER_SetMatch
(
LPC_TIMER_Type
*TMRx, int8_t matchnum,
uint32_t
matchval)
161
{
162
IP_TIMER_SetMatch
(TMRx, matchnum, matchval);
163
}
164
172
STATIC
INLINE
uint32_t
Chip_TIMER_ReadCapture
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
173
{
174
return
IP_TIMER_ReadCapture
(TMRx, capnum);
175
}
176
182
STATIC
INLINE
void
Chip_TIMER_Reset
(
LPC_TIMER_Type
*TMRx)
183
{
184
IP_TIMER_Reset
(TMRx);
185
}
186
194
STATIC
INLINE
void
Chip_TIMER_MatchEnableInt
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
195
{
196
IP_TIMER_MatchEnableInt
(TMRx, matchnum);
197
}
198
205
STATIC
INLINE
void
Chip_TIMER_MatchDisableInt
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
206
{
207
IP_TIMER_MatchDisableInt
(TMRx, matchnum);
208
}
209
216
STATIC
INLINE
void
Chip_TIMER_ResetOnMatchEnable
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
217
{
218
IP_TIMER_ResetOnMatchEnable
(TMRx, matchnum);
219
}
220
227
STATIC
INLINE
void
Chip_TIMER_ResetOnMatchDisable
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
228
{
229
IP_TIMER_ResetOnMatchDisable
(TMRx, matchnum);
230
}
231
239
STATIC
INLINE
void
Chip_TIMER_StopOnMatchEnable
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
240
{
241
IP_TIMER_StopOnMatchEnable
(TMRx, matchnum);
242
}
243
251
STATIC
INLINE
void
Chip_TIMER_StopOnMatchDisable
(
LPC_TIMER_Type
*TMRx, int8_t matchnum)
252
{
253
IP_TIMER_StopOnMatchDisable
(TMRx, matchnum);
254
}
255
264
STATIC
INLINE
void
Chip_TIMER_CaptureRisingEdgeEnable
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
265
{
266
IP_TIMER_CaptureRisingEdgeEnable
(TMRx, capnum);
267
}
268
277
STATIC
INLINE
void
Chip_TIMER_CaptureRisingEdgeDisable
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
278
{
279
IP_TIMER_CaptureRisingEdgeDisable
(TMRx, capnum);
280
}
281
290
STATIC
INLINE
void
Chip_TIMER_CaptureFallingEdgeEnable
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
291
{
292
IP_TIMER_CaptureFallingEdgeEnable
(TMRx, capnum);
293
}
294
303
STATIC
INLINE
void
Chip_TIMER_CaptureFallingEdgeDisable
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
304
{
305
IP_TIMER_CaptureFallingEdgeDisable
(TMRx, capnum);
306
}
307
316
STATIC
INLINE
void
Chip_TIMER_CaptureEnableInt
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
317
{
318
IP_TIMER_CaptureEnableInt
(TMRx, capnum);
319
}
320
327
STATIC
INLINE
void
Chip_TIMER_CaptureDisableInt
(
LPC_TIMER_Type
*TMRx, int8_t capnum)
328
{
329
IP_TIMER_CaptureDisableInt
(TMRx, capnum);
330
}
331
342
STATIC
INLINE
void
Chip_TIMER_ExtMatchControlSet
(
LPC_TIMER_Type
*TMRx, int8_t initial_state,
343
IP_TIMER_PIN_MATCH_STATE_Type
matchState, int8_t matchnum)
344
{
345
IP_TIMER_ExtMatchControlSet
(TMRx, initial_state, matchState, matchnum);
346
}
347
356
STATIC
INLINE
void
Chip_TIMER_TIMER_SetCountClockSrc
(
LPC_TIMER_Type
*TMRx,
357
IP_TIMER_CAP_SRC_STATE_Type
capSrc,
358
int8_t capnum)
359
{
360
IP_TIMER_SetCountClockSrc
(TMRx, capSrc, capnum);
361
}
362
367
#ifdef __cplusplus
368
}
369
#endif
370
371
#endif
/* __TIMER_18XX_43XX_H_ */
software
lpc_core
lpc_chip
chip_18xx_43xx
timer_18xx_43xx.h
Generated on Fri Nov 16 2012 13:36:42 for LPCOpen Platform by
1.8.2