ISF  2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
BMTimer1.h
Go to the documentation of this file.
1 /* ###################################################################
2 ** THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
3 ** Filename : BMTimer1.h
4 ** Project : ISF_K64F_CW_PROJ
5 ** Processor : MK64FN1M0VLL12
6 ** Component : TimerUnit_LDD
7 ** Version : Component 01.164, Driver 01.11, CPU db: 3.00.000
8 ** Compiler : GNU C Compiler
9 ** Date/Time : 2015-03-03, 11:01, # CodeGen: 0
10 ** Abstract :
11 ** This TimerUnit component provides a low level API for unified hardware access across
12 ** various timer devices using the Prescaler-Counter-Compare-Capture timer structure.
13 ** Settings :
14 ** Component name : BMTimer1
15 ** Module name : PIT
16 ** Counter : PIT_CVAL0
17 ** Counter direction : Down
18 ** Counter width : 32 bits
19 ** Value type : Optimal
20 ** Input clock source : Internal
21 ** Counter frequency : Auto select
22 ** Counter restart : On-match
23 ** Period device : PIT_LDVAL0
24 ** Period : 1 sec
25 ** Interrupt : Enabled
26 ** Interrupt : INT_PIT0
27 ** Interrupt priority : medium priority
28 ** Channel list : 0
29 ** Initialization :
30 ** Enabled in init. code : yes
31 ** Auto initialization : no
32 ** Event mask :
33 ** OnCounterRestart : Enabled
34 ** OnChannel0 : Disabled
35 ** OnChannel1 : Disabled
36 ** OnChannel2 : Disabled
37 ** OnChannel3 : Disabled
38 ** OnChannel4 : Disabled
39 ** OnChannel5 : Disabled
40 ** OnChannel6 : Disabled
41 ** OnChannel7 : Disabled
42 ** CPU clock/configuration selection :
43 ** Clock configuration 0 : This component enabled
44 ** Clock configuration 1 : This component disabled
45 ** Clock configuration 2 : This component disabled
46 ** Clock configuration 3 : This component disabled
47 ** Clock configuration 4 : This component disabled
48 ** Clock configuration 5 : This component disabled
49 ** Clock configuration 6 : This component disabled
50 ** Clock configuration 7 : This component disabled
51 ** Contents :
52 ** Init - LDD_TDeviceData* BMTimer1_Init(LDD_TUserData *UserDataPtr);
53 ** Deinit - void BMTimer1_Deinit(LDD_TDeviceData *DeviceDataPtr);
54 ** Enable - LDD_TError BMTimer1_Enable(LDD_TDeviceData *DeviceDataPtr);
55 ** Disable - LDD_TError BMTimer1_Disable(LDD_TDeviceData *DeviceDataPtr);
56 ** SetPeriodTicks - LDD_TError BMTimer1_SetPeriodTicks(LDD_TDeviceData *DeviceDataPtr,...
57 ** GetPeriodTicks - LDD_TError BMTimer1_GetPeriodTicks(LDD_TDeviceData *DeviceDataPtr,...
58 ** ResetCounter - LDD_TError BMTimer1_ResetCounter(LDD_TDeviceData *DeviceDataPtr);
59 ** GetCounterValue - BMTimer1_TValueType BMTimer1_GetCounterValue(LDD_TDeviceData *DeviceDataPtr);
60 **
61 ** Copyright : 1997 - 2014 Freescale Semiconductor, Inc.
62 ** All Rights Reserved.
63 **
64 ** Redistribution and use in source and binary forms, with or without modification,
65 ** are permitted provided that the following conditions are met:
66 **
67 ** o Redistributions of source code must retain the above copyright notice, this list
68 ** of conditions and the following disclaimer.
69 **
70 ** o Redistributions in binary form must reproduce the above copyright notice, this
71 ** list of conditions and the following disclaimer in the documentation and/or
72 ** other materials provided with the distribution.
73 **
74 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
75 ** contributors may be used to endorse or promote products derived from this
76 ** software without specific prior written permission.
77 **
78 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
79 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
80 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
81 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
82 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
83 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
84 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
85 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
87 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88 **
89 ** http: www.freescale.com
90 ** mail: support@freescale.com
91 ** ###################################################################*/
92 /*!
93 ** @file BMTimer1.h
94 ** @version 01.11
95 ** @brief
96 ** This TimerUnit component provides a low level API for unified hardware access across
97 ** various timer devices using the Prescaler-Counter-Compare-Capture timer structure.
98 */
99 /*!
100 ** @addtogroup BMTimer1_module BMTimer1 module documentation
101 ** @{
102 */
103 
104 #ifndef __BMTimer1_H
105 #define __BMTimer1_H
106 
107 /* MODULE BMTimer1. */
108 
109 /* Include shared modules, which are used for whole project */
110 #include "PE_Types.h"
111 #include "PE_Error.h"
112 #include "PE_Const.h"
113 #include "IO_Map.h"
114 /* Include inherited beans */
115 
116 #include "PIT_PDD.h"
117 #include "Cpu.h"
118 
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122 
123 
124 #ifndef __BWUserType_BMTimer1_TValueType
125 #define __BWUserType_BMTimer1_TValueType
126  typedef uint32_t BMTimer1_TValueType ; /* Type for data parameters of methods */
127 #endif
128 #define BMTimer1_CNT_INP_FREQ_U_0 0x016E3600UL /* Counter input frequency in Hz */
129 #define BMTimer1_CNT_INP_FREQ_R_0 23999808.00153599F /* Counter input frequency in Hz */
130 #define BMTimer1_CNT_INP_FREQ_COUNT 0U /* Count of predefined counter input frequencies */
131 #define BMTimer1_PERIOD_TICKS 0x016E3600UL /* Initialization value of period in 'counter ticks' */
132 #define BMTimer1_NUMBER_OF_CHANNELS 0x00U /* Count of predefined channels */
133 #define BMTimer1_COUNTER_WIDTH 0x20U /* Counter width in bits */
134 #define BMTimer1_COUNTER_DIR DIR_DOWN /* Direction of counting */
135 /*! Peripheral base address of a device allocated by the component. This constant can be used directly in PDD macros. */
136 #define BMTimer1_PRPH_BASE_ADDRESS 0x40037000U
137 
138 /* Methods configuration constants - generated for all enabled component's methods */
139 #define BMTimer1_Init_METHOD_ENABLED /*!< Init method of the component BMTimer1 is enabled (generated) */
140 #define BMTimer1_Deinit_METHOD_ENABLED /*!< Deinit method of the component BMTimer1 is enabled (generated) */
141 #define BMTimer1_Enable_METHOD_ENABLED /*!< Enable method of the component BMTimer1 is enabled (generated) */
142 #define BMTimer1_Disable_METHOD_ENABLED /*!< Disable method of the component BMTimer1 is enabled (generated) */
143 #define BMTimer1_SetPeriodTicks_METHOD_ENABLED /*!< SetPeriodTicks method of the component BMTimer1 is enabled (generated) */
144 #define BMTimer1_GetPeriodTicks_METHOD_ENABLED /*!< GetPeriodTicks method of the component BMTimer1 is enabled (generated) */
145 #define BMTimer1_ResetCounter_METHOD_ENABLED /*!< ResetCounter method of the component BMTimer1 is enabled (generated) */
146 #define BMTimer1_GetCounterValue_METHOD_ENABLED /*!< GetCounterValue method of the component BMTimer1 is enabled (generated) */
147 
148 /* Events configuration constants - generated for all enabled component's events */
149 #define BMTimer1_OnCounterRestart_EVENT_ENABLED /*!< OnCounterRestart event of the component BMTimer1 is enabled (generated) */
150 
151 
152 
153 /*
154 ** ===================================================================
155 ** Method : BMTimer1_Init (component TimerUnit_LDD)
156 */
157 /*!
158 ** @brief
159 ** Initializes the device. Allocates memory for the device data
160 ** structure, allocates interrupt vectors and sets interrupt
161 ** priority, sets pin routing, sets timing, etc. If the
162 ** property ["Enable in init. code"] is set to "yes" value then
163 ** the device is also enabled (see the description of the
164 ** [Enable] method). In this case the [Enable] method is not
165 ** necessary and needn't to be generated. This method can be
166 ** called only once. Before the second call of Init the [Deinit]
167 ** must be called first.
168 ** @param
169 ** UserDataPtr - Pointer to the user or
170 ** RTOS specific data. This pointer will be
171 ** passed as an event or callback parameter.
172 ** @return
173 ** - Pointer to the dynamically allocated private
174 ** structure or NULL if there was an error.
175 */
176 /* ===================================================================*/
177 LDD_TDeviceData* BMTimer1_Init(LDD_TUserData *UserDataPtr);
178 
179 /*
180 ** ===================================================================
181 ** Method : BMTimer1_Deinit (component TimerUnit_LDD)
182 */
183 /*!
184 ** @brief
185 ** Deinitializes the device. Switches off the device, frees the
186 ** device data structure memory, interrupts vectors, etc.
187 ** @param
188 ** DeviceDataPtr - Device data structure
189 ** pointer returned by Init method
190 */
191 /* ===================================================================*/
192 void BMTimer1_Deinit(LDD_TDeviceData *DeviceDataPtr);
193 
194 /*
195 ** ===================================================================
196 ** Method : BMTimer1_Enable (component TimerUnit_LDD)
197 */
198 /*!
199 ** @brief
200 ** Enables the component - it starts the signal generation.
201 ** Events may be generated (see SetEventMask). The method is
202 ** not available if the counter can't be disabled/enabled by HW.
203 ** @param
204 ** DeviceDataPtr - Device data structure
205 ** pointer returned by [Init] method.
206 ** @return
207 ** - Error code, possible codes:
208 ** ERR_OK - OK
209 ** ERR_SPEED - The component does not work in
210 ** the active clock configuration
211 */
212 /* ===================================================================*/
213 LDD_TError BMTimer1_Enable(LDD_TDeviceData *DeviceDataPtr);
214 
215 /*
216 ** ===================================================================
217 ** Method : BMTimer1_Disable (component TimerUnit_LDD)
218 */
219 /*!
220 ** @brief
221 ** Disables the component - it stops signal generation and
222 ** events calling. The method is not available if the counter
223 ** can't be disabled/enabled by HW.
224 ** @param
225 ** DeviceDataPtr - Device data structure
226 ** pointer returned by [Init] method.
227 ** @return
228 ** - Error code, possible codes:
229 ** ERR_OK - OK
230 ** ERR_SPEED - The component does not work in
231 ** the active clock configuration
232 */
233 /* ===================================================================*/
234 LDD_TError BMTimer1_Disable(LDD_TDeviceData *DeviceDataPtr);
235 
236 /*
237 ** ===================================================================
238 ** Method : BMTimer1_SetPeriodTicks (component TimerUnit_LDD)
239 */
240 /*!
241 ** @brief
242 ** The method sets timer re-initialization period (in timer
243 ** ticks). This method is available only if the property
244 ** ["Counter restart"] is switched to 'on-match' value.
245 ** @param
246 ** DeviceDataPtr - Device data structure
247 ** pointer returned by [Init] method.
248 ** @param
249 ** Ticks - Number of counter ticks before counter
250 ** re-initialization. Value 0 means maximal
251 ** period value the same as "free-running
252 ** mode", e.g. counter overflow or underflow
253 ** without any explicit re-initialization.
254 ** @return
255 ** - Error code, possible codes:
256 ** ERR_OK - OK
257 ** ERR_PARAM_TICKS - Ticks parameter is out of
258 ** possible range.
259 ** ERR_SPEED - The component does not work in
260 ** the active clock configuration
261 */
262 /* ===================================================================*/
263 LDD_TError BMTimer1_SetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType Ticks);
264 
265 /*
266 ** ===================================================================
267 ** Method : BMTimer1_GetPeriodTicks (component TimerUnit_LDD)
268 */
269 /*!
270 ** @brief
271 ** Returns the number of counter ticks before re-initialization.
272 ** See also method [SetPeriodTicks]. This method is available
273 ** only if the property ["Counter restart"] is switched to
274 ** 'on-match' value.
275 ** @param
276 ** DeviceDataPtr - Device data structure
277 ** pointer returned by [Init] method.
278 ** @param
279 ** TicksPtr - Pointer to return value of the
280 ** number of counter ticks before
281 ** re-initialization
282 ** @return
283 ** - Error code, possible codes:
284 ** ERR_OK - OK
285 ** ERR_SPEED - The component does not work in
286 ** the active clock configuration
287 */
288 /* ===================================================================*/
289 LDD_TError BMTimer1_GetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType *TicksPtr);
290 
291 /*
292 ** ===================================================================
293 ** Method : BMTimer1_ResetCounter (component TimerUnit_LDD)
294 */
295 /*!
296 ** @brief
297 ** Resets counter. If counter is counting up then it is set to
298 ** zero. If counter is counting down then counter is updated to
299 ** the reload value.
300 ** The method is not available if HW doesn't allow resetting of
301 ** the counter.
302 ** @param
303 ** DeviceDataPtr - Device data structure
304 ** pointer returned by [Init] method.
305 ** @return
306 ** - Error code, possible codes:
307 ** ERR_OK - OK
308 ** ERR_SPEED - The component does not work in
309 ** the active clock configuration
310 */
311 /* ===================================================================*/
312 LDD_TError BMTimer1_ResetCounter(LDD_TDeviceData *DeviceDataPtr);
313 
314 /*
315 ** ===================================================================
316 ** Method : BMTimer1_GetCounterValue (component TimerUnit_LDD)
317 */
318 /*!
319 ** @brief
320 ** Returns the content of counter register. This method can be
321 ** used both if counter is enabled and if counter is disabled.
322 ** The method is not available if HW doesn't allow reading of
323 ** the counter.
324 ** @param
325 ** DeviceDataPtr - Device data structure
326 ** pointer returned by [Init] method.
327 ** @return
328 ** - Counter value (number of counted ticks).
329 */
330 /* ===================================================================*/
331 BMTimer1_TValueType BMTimer1_GetCounterValue(LDD_TDeviceData *DeviceDataPtr);
332 
333 /*
334 ** ===================================================================
335 ** Method : BMTimer1_Interrupt (component TimerUnit_LDD)
336 **
337 ** Description :
338 ** The method services the interrupt of the selected peripheral(s)
339 ** and eventually invokes event(s) of the component.
340 ** This method is internal. It is used by Processor Expert only.
341 ** ===================================================================
342 */
343 /* {MQXLite RTOS Adapter} ISR function prototype */
344 void BMTimer1_Interrupt(LDD_RTOS_TISRParameter _isrParameter);
345 
346 /* END BMTimer1. */
347 
348 #ifdef __cplusplus
349 } /* extern "C" */
350 #endif
351 
352 #endif
353 /* ifndef __BMTimer1_H */
354 /*!
355 ** @}
356 */
357 /*
358 ** ###################################################################
359 **
360 ** This file was created by Processor Expert 10.3 [05.09]
361 ** for the Freescale Kinetis series of microcontrollers.
362 **
363 ** ###################################################################
364 */
LDD_TDeviceData * BMTimer1_Init(LDD_TUserData *UserDataPtr)
Initializes the device. Allocates memory for the device data structure, allocates interrupt vectors a...
Definition: BMTimer1.c:155
LDD_TError BMTimer1_ResetCounter(LDD_TDeviceData *DeviceDataPtr)
Resets counter. If counter is counting up then it is set to zero. If counter is counting down then co...
Definition: BMTimer1.c:356
void BMTimer1_Interrupt(LDD_RTOS_TISRParameter _isrParameter)
Definition: BMTimer1.c:403
uint32_t BMTimer1_TValueType
Definition: BMTimer1.h:126
LDD_TError BMTimer1_Enable(LDD_TDeviceData *DeviceDataPtr)
Enables the component - it starts the signal generation. Events may be generated (see SetEventMask)...
Definition: BMTimer1.c:237
BMTimer1_TValueType BMTimer1_GetCounterValue(LDD_TDeviceData *DeviceDataPtr)
Returns the content of counter register. This method can be used both if counter is enabled and if co...
Definition: BMTimer1.c:387
void BMTimer1_Deinit(LDD_TDeviceData *DeviceDataPtr)
Deinitializes the device. Switches off the device, frees the device data structure memory...
Definition: BMTimer1.c:201
LDD_TError BMTimer1_GetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType *TicksPtr)
Returns the number of counter ticks before re-initialization. See also method [SetPeriodTicks]. This method is available only if the property ["Counter restart"] is switched to 'on-match' value.
Definition: BMTimer1.c:328
LDD_TError BMTimer1_Disable(LDD_TDeviceData *DeviceDataPtr)
Disables the component - it stops signal generation and events calling. The method is not available i...
Definition: BMTimer1.c:263
LDD_TError BMTimer1_SetPeriodTicks(LDD_TDeviceData *DeviceDataPtr, BMTimer1_TValueType Ticks)
The method sets timer re-initialization period (in timer ticks). This method is available only if the...
Definition: BMTimer1.c:297