29
29
*/
30
30
#ifndef __FSL_PIT_DRIVER_H__
31
31
#define __FSL_PIT_DRIVER_H__
32
-
32
+
33
33
#include <stdint.h>
34
34
#include <stdbool.h>
35
35
#include "fsl_pit_hal.h"
36
-
36
+
37
37
/*!
38
38
* @addtogroup pit_driver
39
39
* @{
47
47
* @brief PIT timer configuration structure
48
48
*
49
49
* Define structure PitConfig and use pit_init() to make necessary initializations.
50
- * You may also use remaining functions for PIT configuration. The timer chain and
50
+ * You may also use remaining functions for PIT configuration. The timer chain and
51
51
* lifetime timer features are only available in specific MCUs.
52
52
*/
53
53
typedef struct PitTimerConfig {
@@ -70,7 +70,7 @@ typedef void (*pit_isr_callback_t)(void);
70
70
/*******************************************************************************
71
71
* API
72
72
******************************************************************************/
73
-
73
+
74
74
#if defined(__cplusplus )
75
75
extern "C" {
76
76
#endif
@@ -82,21 +82,21 @@ extern "C" {
82
82
83
83
/*!
84
84
* @brief Initialize PIT in peripheral driver level.
85
- *
86
- * This function un-gates the PIT clock and enables the PIT module automatically.
87
- * Users should define the config structure and pass it in. Timers do not
85
+ *
86
+ * This function un-gates the PIT clock and enables the PIT module automatically.
87
+ * Users should define the config structure and pass it in. Timers do not
88
88
* start counting after calling this function by default. Function pit_timer_start
89
89
* must be called to start timer counting. Periods set in this function are
90
- * only in units of count. Call pit_set_timer_period_us to re-set the period in
90
+ * only in units of count. Call pit_set_timer_period_us to re-set the period in
91
91
* microsecond units before starting timers.
92
92
*
93
93
* Here is an example demonstrating how to define a PIT config structure:
94
94
@code
95
95
pit_config_t pitTestInit = {
96
- .isRunInDebug = false,
96
+ .isRunInDebug = false,
97
97
.timers[0].isInterruptEnabled = true,
98
98
// Only valid when chain feature is available.
99
- .timers[0].isTimerChained = false,
99
+ .timers[0].isTimerChained = false,
100
100
.timers[0].period = 0x1234FFFF,
101
101
.timers[1].isInterruptEnabled = false,
102
102
.timers[1].isTimerChained = false,
@@ -106,7 +106,7 @@ extern "C" {
106
106
*
107
107
* @param config PIT configuration data.
108
108
*/
109
- void pit_init (const pit_config_t * config );
109
+ void sdk_pit_init (const pit_config_t * config );
110
110
111
111
/*!
112
112
* @brief Disable PIT module and gate control.
@@ -119,7 +119,7 @@ void pit_shutdown(void);
119
119
/* @} */
120
120
121
121
/*!
122
- * @name Timer Start and Stop
122
+ * @name Timer Start and Stop
123
123
* @{
124
124
*/
125
125
@@ -155,20 +155,20 @@ void pit_timer_stop(uint32_t timer);
155
155
* @brief Set timer period in microsecond units.
156
156
*
157
157
* The period range depends on the frequency of PIT source clock. If the required period
158
- * is out of range, use the lifetime timer, if applicable.
159
- *
158
+ * is out of range, use the lifetime timer, if applicable.
159
+ *
160
160
* @param timer Timer channel number.
161
161
* @param us Timer period in microseconds.
162
162
*/
163
163
void pit_set_timer_period_us (uint32_t timer , uint32_t us );
164
164
165
165
/*!
166
166
* @brief Read current timer value in microsecond units.
167
- *
167
+ *
168
168
* This function returns an absolute time stamp in microsecond units.
169
169
* One common use of this function is to measure the running time of a part of
170
170
* code. Call this function at both the beginning and end of code; the time
171
- * difference between these two time stamps is the running time (Make sure the
171
+ * difference between these two time stamps is the running time (Make sure the
172
172
* running time will not exceed the timer period). The time stamp returned is
173
173
* up-counting.
174
174
*
@@ -180,7 +180,7 @@ uint32_t pit_read_timer_us(uint32_t timer);
180
180
#if FSL_FEATURE_PIT_HAS_LIFETIME_TIMER
181
181
/*!
182
182
* @brief Set lifetime timer period.
183
- *
183
+ *
184
184
* Timer 1 must be chained with timer 0 before using the lifetime timer. The period
185
185
* range is restricted by "period * pitSourceClock < max of an uint64_t integer",
186
186
* or it may cause an overflow and be unable to set the correct period.
@@ -192,7 +192,7 @@ void pit_set_lifetime_timer_period_us(uint64_t us);
192
192
/*!
193
193
* @brief Read current lifetime value in microseconds.
194
194
*
195
- * This feature returns an absolute time stamp in microsecond units. The time stamp
195
+ * This feature returns an absolute time stamp in microsecond units. The time stamp
196
196
* value will not exceed the timer period. The timer is up-counting.
197
197
*
198
198
* @return Current lifetime timer value in microseconds.
@@ -203,14 +203,14 @@ uint64_t pit_read_lifetime_timer_us(void);
203
203
/* @} */
204
204
205
205
/*!
206
- * @name ISR Callback Function
206
+ * @name ISR Callback Function
207
207
* @{
208
208
*/
209
209
210
210
/*!
211
- * @brief Register pit isr callback function.
211
+ * @brief Register pit isr callback function.
212
212
*
213
- * System default ISR interfaces are already defined in fsl_pit_irq.c. Users
213
+ * System default ISR interfaces are already defined in fsl_pit_irq.c. Users
214
214
* can either edit these ISRs or use this function to register a callback
215
215
* function. The default ISR runs the callback function if there is one
216
216
* installed.
@@ -225,9 +225,9 @@ void pit_register_isr_callback_function(uint32_t timer, pit_isr_callback_t funct
225
225
#if defined(__cplusplus )
226
226
}
227
227
#endif
228
-
228
+
229
229
/*! @}*/
230
-
230
+
231
231
#endif /* __FSL_PIT_DRIVER_H__*/
232
232
/*******************************************************************************
233
233
* EOF
0 commit comments