1 /******************************************************************************
2 * Filename: aux_timer.h
3 * Revised: 2015-07-16 12:12:04 +0200 (Thu, 16 Jul 2015)
4 * Revision: 44151
5 *
6 * Description: Defines and prototypes for the AUX Timer
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38
39 //*****************************************************************************
40 //
41 //! \addtogroup aux_group
42 //! @{
43 //! \addtogroup auxtimer_api
44 //! @{
45 //
46 //*****************************************************************************
47
48 #ifndef __AUX_TIMER_H__
49 #define __AUX_TIMER_H__
50
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61
62 #include <stdbool.h>
63 #include <stdint.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_ints.h>
66 #include <inc/hw_memmap.h>
67 #include <inc/hw_aux_timer.h>
68 #include <driverlib/debug.h>
69 #include <driverlib/interrupt.h>
70
71 //*****************************************************************************
72 //
73 // Support for DriverLib in ROM:
74 // This section renames all functions that are not "static inline", so that
75 // calling these functions will default to implementation in flash. At the end
76 // of this file a second renaming will change the defaults to implementation in
77 // ROM for available functions.
78 //
79 // To force use of the implementation in flash, e.g. for debugging:
80 // - Globally: Define DRIVERLIB_NOROM at project level
81 // - Per function: Use prefix "NOROM_" when calling the function
82 //
83 //*****************************************************************************
84 #if !defined(DOXYGEN)
85 #define AUXTimerConfigure NOROM_AUXTimerConfigure
86 #define AUXTimerStart NOROM_AUXTimerStart
87 #define AUXTimerStop NOROM_AUXTimerStop
88 #define AUXTimerPrescaleSet NOROM_AUXTimerPrescaleSet
89 #define AUXTimerPrescaleGet NOROM_AUXTimerPrescaleGet
90 #endif
91
92 //*****************************************************************************
93 //
94 // Values that can be passed to AUXTimerConfigure().
95 //
96 // Requires timer0 and timer1 to use same enumerations and values!
97 //
98 //*****************************************************************************
99 #define AUX_TIMER_CFG_ONE_SHOT (AUX_TIMER_T0CFG_RELOAD_MAN) // One-shot timer mode
100 #define AUX_TIMER_CFG_PERIODIC (AUX_TIMER_T0CFG_RELOAD_CONT) // Period timer mode
101 #define AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT ((AUX_TIMER_T0CFG_RELOAD_MAN) | (AUX_TIMER_T0CFG_MODE_TICK)) // One-shot timer with edge count
102 #define AUX_TIMER_CFG_PERIODIC_EDGE_COUNT ((AUX_TIMER_T0CFG_RELOAD_CONT) | (AUX_TIMER_T0CFG_MODE_TICK)) // Periodic timer with edge count
103 #define AUX_TIMER_CFG_RISING_EDGE (AUX_TIMER_T0CFG_TICK_SRC_POL_RISE) // Count rising edges (used with edge count mode)
104 #define AUX_TIMER_CFG_FALLING_EDGE (AUX_TIMER_T0CFG_TICK_SRC_POL_FALL) // Count falling edges (used with edge count mode)
105
106 #define AUX_TIMER_CFG_TICK_SRC_RTC_EVENT (AUX_TIMER_T0CFG_TICK_SRC_RTC_CH2_EV) // AON wake-up event
107 #define AUX_TIMER_CFG_TICK_SRC_CMP_A (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPA) // Comparator A
108 #define AUX_TIMER_CFG_TICK_SRC_CMP_B (AUX_TIMER_T0CFG_TICK_SRC_AUX_COMPB) // Comparator B
109 #define AUX_TIMER_CFG_TICK_SRC_TDCDONE (AUX_TIMER_T0CFG_TICK_SRC_TDC_DONE) // TDC Done
110 #define AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT (AUX_TIMER_T1CFG_TICK_SRC_TIMER0_EV) // Timer 0 event
111 #define AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT (AUX_TIMER_T0CFG_TICK_SRC_TIMER1_EV) // Timer 1 event
112 #define AUX_TIMER_CFG_TICK_SRC_SMPH_RELEASE (AUX_TIMER_T0CFG_TICK_SRC_SMPH_AUTOTAKE_DONE) // Semaphore release
113 #define AUX_TIMER_CFG_TICK_SRC_ADC_DONE (AUX_TIMER_T0CFG_TICK_SRC_ADC_DONE) // ADC done
114 #define AUX_TIMER_CFG_TICK_SRC_RTC_4KHZ (AUX_TIMER_T0CFG_TICK_SRC_RTC_4KHZ)
115 #define AUX_TIMER_CFG_TICK_SRC_OBSMUX0 (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX0)
116 #define AUX_TIMER_CFG_TICK_SRC_OBSMUX1 (AUX_TIMER_T0CFG_TICK_SRC_OBSMUX1)
117 #define AUX_TIMER_CFG_TICK_SRC_AON_SW (AUX_TIMER_T0CFG_TICK_SRC_AON_SW)
118 #define AUX_TIMER_CFG_TICK_SRC_AON_PROG_WU (AUX_TIMER_T0CFG_TICK_SRC_AON_PROG_WU)
119 #define AUX_TIMER_CFG_TICK_SRC_AIO0 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO0) // AIO_DAT[ 0]
120 #define AUX_TIMER_CFG_TICK_SRC_AIO1 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO1) // AIO_DAT[ 1]
121 #define AUX_TIMER_CFG_TICK_SRC_AIO2 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO2) // AIO_DAT[ 2]
122 #define AUX_TIMER_CFG_TICK_SRC_AIO3 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO3) // AIO_DAT[ 3]
123 #define AUX_TIMER_CFG_TICK_SRC_AIO4 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO4) // AIO_DAT[ 4]
124 #define AUX_TIMER_CFG_TICK_SRC_AIO5 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO5) // AIO_DAT[ 5]
125 #define AUX_TIMER_CFG_TICK_SRC_AIO6 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO6) // AIO_DAT[ 6]
126 #define AUX_TIMER_CFG_TICK_SRC_AIO7 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO7) // AIO_DAT[ 7]
127 #define AUX_TIMER_CFG_TICK_SRC_AIO8 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO8) // AIO_DAT[ 8]
128 #define AUX_TIMER_CFG_TICK_SRC_AIO9 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO9) // AIO_DAT[ 9]
129 #define AUX_TIMER_CFG_TICK_SRC_AIO10 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO10) // AIO_DAT[10]
130 #define AUX_TIMER_CFG_TICK_SRC_AIO11 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO11) // AIO_DAT[11]
131 #define AUX_TIMER_CFG_TICK_SRC_AIO12 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO12) // AIO_DAT[12]
132 #define AUX_TIMER_CFG_TICK_SRC_AIO13 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO13) // AIO_DAT[13]
133 #define AUX_TIMER_CFG_TICK_SRC_AIO14 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO14) // AIO_DAT[14]
134 #define AUX_TIMER_CFG_TICK_SRC_AIO15 (AUX_TIMER_T0CFG_TICK_SRC_AUXIO15) // AIO_DAT[15]
135 #define AUX_TIMER_CFG_TICK_SRC_ACLK_REF (AUX_TIMER_T0CFG_TICK_SRC_ACLK_REF) // ACLK_REF_i
136 #define AUX_TIMER_CFG_TICK_SRC_MCU_EVENT (AUX_TIMER_T0CFG_TICK_SRC_MCU_EVENT) // MCU event
137 #define AUX_TIMER_CFG_TICK_SRC_ADC_IRQ (AUX_TIMER_T0CFG_TICK_SRC_ADC_IRQ) // DMA done
138
139 //*****************************************************************************
140 //
141 // Values that can be passed to most of the timer APIs as the ui32Timer
142 // parameter.
143 //
144 //*****************************************************************************
145 #define AUX_TIMER_0 0x0000FFFF // AUX Timer 0
146 #define AUX_TIMER_1 0x00FF0000 // AUX Timer 1
147 #define AUX_TIMER_BOTH 0x00FFFFFF // AUX Timer Both 0 and 1
148
149 //*****************************************************************************
150 //
151 // Values that can be passed to AUXTimerPrescaleSet and returned from
152 // AUXTimerPrescaleGet.
153 //
154 //*****************************************************************************
155 #define AUX_TIMER_PRESCALE_DIV_1 0x00000000 // Prescale division ratio 1
156 #define AUX_TIMER_PRESCALE_DIV_2 0x00000010 // Prescale division ratio 2
157 #define AUX_TIMER_PRESCALE_DIV_4 0x00000020 // Prescale division ratio 4
158 #define AUX_TIMER_PRESCALE_DIV_8 0x00000030 // Prescale division ratio 8
159 #define AUX_TIMER_PRESCALE_DIV_16 0x00000040 // Prescale division ratio 16
160 #define AUX_TIMER_PRESCALE_DIV_32 0x00000050 // Prescale division ratio 32
161 #define AUX_TIMER_PRESCALE_DIV_64 0x00000060 // Prescale division ratio 64
162 #define AUX_TIMER_PRESCALE_DIV_128 0x00000070 // Prescale division ratio 128
163 #define AUX_TIMER_PRESCALE_DIV_256 0x00000080 // Prescale division ratio 256
164 #define AUX_TIMER_PRESCALE_DIV_512 0x00000090 // Prescale division ratio 512
165 #define AUX_TIMER_PRESCALE_DIV_1028 0x000000A0 // Prescale div. ratio 1028
166 #define AUX_TIMER_PRESCALE_DIV_2048 0x000000B0 // Prescale div. ratio 2048
167 #define AUX_TIMER_PRESCALE_DIV_4096 0x000000C0 // Prescale div. ratio 4096
168 #define AUX_TIMER_PRESCALE_DIV_8192 0x000000D0 // Prescale div. ratio 8192
169 #define AUX_TIMER_PRESCALE_DIV_16384 0x000000E0 // Prescale div. ratio 16384
170 #define AUX_TIMER_PRESCALE_DIV_32768 0x000000F0 // Prescale div. ratio 32768
171
172 //*****************************************************************************
173 //
174 // API Functions and prototypes
175 //
176 //*****************************************************************************
177
178 //*****************************************************************************
179 //
180 //! \brief Configure AUX timer.
181 //!
182 //! This call configures the AUX timer selected by the \c ui32Timer.
183 //! The timer module is disabled before being configured and is left in the
184 //! disabled state.
185 //!
186 //! The configuration is specified in \c ui32Config as one of the following
187 //! values:
188 //! - \ref AUX_TIMER_CFG_ONE_SHOT : One-shot timer.
189 //! - \ref AUX_TIMER_CFG_PERIODIC : Periodic timer.
190 //! - \ref AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT : One-shot edge counter.
191 //! - \ref AUX_TIMER_CFG_PERIODIC_EDGE_COUNT : Periodic edge counter.
192 //!
193 //! When configured as timer, the counter is incremented based on the AUX clock
194 //! after the prescaler. The prescale division ratio is set
195 //! using \ref AUXTimerPrescaleSet().
196 //!
197 //! When configured as an edge counter the counter is incremented only on edges
198 //! of the selected event.
199 //! The polarity of the event is selected by:
200 //! - \ref AUX_TIMER_CFG_RISING_EDGE : rising edge trigger
201 //! - \ref AUX_TIMER_CFG_FALLING_EDGE : falling edge trigger
202 //!
203 //! The event source is selected as one of the following defines:
204 //! - \ref AUX_TIMER_CFG_TICK_SRC_RTC_EVENT
205 //! - \ref AUX_TIMER_CFG_TICK_SRC_CMP_A
206 //! - \ref AUX_TIMER_CFG_TICK_SRC_CMP_B
207 //! - \ref AUX_TIMER_CFG_TICK_SRC_TDCDONE
208 //! - \ref AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT
209 //! - \ref AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT
210 //! - \ref AUX_TIMER_CFG_TICK_SRC_SMPH_RELEASE
211 //! - \ref AUX_TIMER_CFG_TICK_SRC_ADC_DONE
212 //! - \ref AUX_TIMER_CFG_TICK_SRC_RTC_4KHZ
213 //! - \ref AUX_TIMER_CFG_TICK_SRC_OBSMUX0
214 //! - \ref AUX_TIMER_CFG_TICK_SRC_OBSMUX1
215 //! - \ref AUX_TIMER_CFG_TICK_SRC_AON_SW
216 //! - \ref AUX_TIMER_CFG_TICK_SRC_AON_PROG_WU
217 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO0
218 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO1
219 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO2
220 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO3
221 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO4
222 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO5
223 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO6
224 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO7
225 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO8
226 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO9
227 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO10
228 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO11
229 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO12
230 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO13
231 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO14
232 //! - \ref AUX_TIMER_CFG_TICK_SRC_AIO15
233 //! - \ref AUX_TIMER_CFG_TICK_SRC_ACLK_REF
234 //! - \ref AUX_TIMER_CFG_TICK_SRC_MCU_EVENT
235 //! - \ref AUX_TIMER_CFG_TICK_SRC_ADC_IRQ
236 //!
237 //! The mode, event polarity and event source are configured by setting the
238 //! \c ui32Config parameter as the bitwise OR of the various settings.
239 //! I.e. (\ref AUX_TIMER_CFG_ONE_SHOT_EDGE_COUNT | \ref AUX_TIMER_CFG_RISING_EDGE |
240 //! \ref AUX_TIMER_CFG_TICK_SRC_RTC_EVENT).
241 //!
242 //! \note When used as an edge counter the prescaler should be set to
243 //! \ref AUX_TIMER_PRESCALE_DIV_1.
244 //!
245 //! \note A timer can not trigger itself thus timer 0 can \b not use
246 //! \ref AUX_TIMER_CFG_TICK_SRC_TIMER0_EVENT and timer 1 can \b not use
247 //! \ref AUX_TIMER_CFG_TICK_SRC_TIMER1_EVENT.
248 //!
249 //! \param ui32Timer is the timer to configure.
250 //! - \ref AUX_TIMER_0
251 //! - \ref AUX_TIMER_1
252 //! \param ui32Config is the timer configuration.
253 //!
254 //! \return None
255 //!
256 //! \sa \ref AUXTimerPrescaleSet()
257 //
258 //*****************************************************************************
259 extern void AUXTimerConfigure(uint32_t ui32Timer, uint32_t ui32Config);
260
261 //*****************************************************************************
262 //
263 //! \brief Start AUX timer(s).
264 //!
265 //! This call starts the selected AUX timer(s).
266 //!
267 //! \note The counter will start counting up from zero.
268 //!
269 //! \param ui32Timer is the timer to start.
270 //! - \ref AUX_TIMER_0
271 //! - \ref AUX_TIMER_1
272 //! - \ref AUX_TIMER_BOTH
273 //!
274 //! \return None
275 //!
276 //! \sa \ref AUXTimerStop()
277 //
278 //*****************************************************************************
279 extern void AUXTimerStart(uint32_t ui32Timer);
280
281 //*****************************************************************************
282 //
283 //! \brief Stop AUX timer(s).
284 //!
285 //! This call stops the selected AUX timer(s).
286 //!
287 //! \param ui32Timer is the timer to stop.
288 //! - \ref AUX_TIMER_0
289 //! - \ref AUX_TIMER_1
290 //! - \ref AUX_TIMER_BOTH
291 //!
292 //! \return None
293 //!
294 //! \sa \ref AUXTimerStart()
295 //
296 //*****************************************************************************
297 extern void AUXTimerStop(uint32_t ui32Timer);
298
299 //*****************************************************************************
300 //
301 //! \brief Set AUX timer target value.
302 //!
303 //! The timer counts from zero to the target value. When target value is
304 //! reached an event is generated.
305 //!
306 //! \param ui32Timer is the timer to set the target value for.
307 //! - \ref AUX_TIMER_0
308 //! - \ref AUX_TIMER_1
309 //! \param ui32Target is the timer target value.
310 //! - For \ref AUX_TIMER_0 the target value must be an integer in the range 0..65535 (16 bit).
311 //! - For \ref AUX_TIMER_1 the target value must be an integer in the range 0..255 (8 bit).
312 //!
313 //! \return None
314 //!
315 //! \sa \ref AUXTimerTargetValGet()
316 //
317 //*****************************************************************************
318 __STATIC_INLINE void
AUXTimerTargetValSet(uint32_t ui32Timer,uint32_t ui32Target)319 AUXTimerTargetValSet(uint32_t ui32Timer, uint32_t ui32Target)
320 {
321 uint32_t ui32Addr;
322
323 //
324 // Check the arguments.
325 //
326 ASSERT((ui32Timer == AUX_TIMER_0) || (ui32Timer == AUX_TIMER_1));
327 ASSERT(((ui32Timer & AUX_TIMER_0) && (ui32Target <= 65535)) ||
328 ((ui32Timer & AUX_TIMER_1) && (ui32Target <= 255)));
329
330 ui32Addr = (ui32Timer & AUX_TIMER_0) ?
331 (AUX_TIMER_BASE + AUX_TIMER_O_T0TARGET) :
332 (AUX_TIMER_BASE + AUX_TIMER_O_T1TARGET);
333
334 HWREG(ui32Addr) = ui32Target;
335 }
336
337 //*****************************************************************************
338 //
339 //! \brief Get AUX timer target value.
340 //!
341 //! The timer counts from zero to the target value. When target value is
342 //! reached an event is generated. This function returns the programmed target
343 //! value for the specified timer.
344 //!
345 //! \param ui32Timer is the timer to get the target value from.
346 //! - \ref AUX_TIMER_0
347 //! - \ref AUX_TIMER_1
348 //!
349 //! \return Returns target value for the specified timer
350 //!
351 //! \sa \ref AUXTimerTargetValSet()
352 //
353 //*****************************************************************************
354 __STATIC_INLINE uint32_t
AUXTimerTargetValGet(uint32_t ui32Timer)355 AUXTimerTargetValGet(uint32_t ui32Timer)
356 {
357 //
358 // Check the arguments.
359 //
360 ASSERT((ui32Timer == AUX_TIMER_0) || (ui32Timer == AUX_TIMER_1));
361
362 return(HWREG((ui32Timer & AUX_TIMER_0) ?
363 (AUX_TIMER_BASE + AUX_TIMER_O_T0TARGET) :
364 (AUX_TIMER_BASE + AUX_TIMER_O_T1TARGET)));
365 }
366
367 //*****************************************************************************
368 //
369 //! \brief Set AUX timer prescale value.
370 //!
371 //! When configured as timer, the counter is incremented based on the AUX clock
372 //! after the prescaler.
373 //!
374 //! \note Setting prescale value is \b not advised when the timer is running.
375 //!
376 //! \note When timer is used as an edge counter the prescaler should be
377 //! set to \ref AUX_TIMER_PRESCALE_DIV_1.
378 //!
379 //! \param ui32Timer is the timer to set the prescale on.
380 //! - \ref AUX_TIMER_0
381 //! - \ref AUX_TIMER_1
382 //! \param ui32PrescaleDiv is the prescaler division ratio.
383 //! - \ref AUX_TIMER_PRESCALE_DIV_1 : Prescale division ratio 1
384 //! - \ref AUX_TIMER_PRESCALE_DIV_2 : Prescale division ratio 2
385 //! - \ref AUX_TIMER_PRESCALE_DIV_4 : Prescale division ratio 4
386 //! - \ref AUX_TIMER_PRESCALE_DIV_16 : Prescale division ratio 16
387 //! - \ref AUX_TIMER_PRESCALE_DIV_32 : Prescale division ratio 32
388 //! - \ref AUX_TIMER_PRESCALE_DIV_64 : Prescale division ratio 64
389 //! - \ref AUX_TIMER_PRESCALE_DIV_128 : Prescale division ratio 128
390 //! - \ref AUX_TIMER_PRESCALE_DIV_256 : Prescale division ratio 256
391 //! - \ref AUX_TIMER_PRESCALE_DIV_1028 : Prescale division ratio 1028
392 //! - \ref AUX_TIMER_PRESCALE_DIV_2048 : Prescale division ratio 2048
393 //! - \ref AUX_TIMER_PRESCALE_DIV_4096 : Prescale division ratio 4096
394 //! - \ref AUX_TIMER_PRESCALE_DIV_8192 : Prescale division ratio 8192
395 //! - \ref AUX_TIMER_PRESCALE_DIV_16384 : Prescale division ratio 16384
396 //! - \ref AUX_TIMER_PRESCALE_DIV_32768 : Prescale division ratio 32768
397 //!
398 //! \return None
399 //!
400 //! \sa \ref AUXTimerPrescaleGet()
401 //
402 //*****************************************************************************
403 extern void AUXTimerPrescaleSet(uint32_t ui32Timer, uint32_t ui32PrescaleDiv);
404
405 //*****************************************************************************
406 //
407 //! \brief Get AUX timer prescale value.
408 //!
409 //! When configured as timer, the counter is incremented based on the AUX clock
410 //! after the prescaler. This call returns the setting of the prescale divide
411 //! ratio for the specified timer.
412 //!
413 //! \param ui32Timer is the timer to get the prescale value from.
414 //! - \ref AUX_TIMER_0
415 //! - \ref AUX_TIMER_1
416 //!
417 //! \return Returns the prescaler division ratio as one of the following values:
418 //! - \ref AUX_TIMER_PRESCALE_DIV_1 : Prescale division ratio 1
419 //! - \ref AUX_TIMER_PRESCALE_DIV_2 : Prescale division ratio 2
420 //! - \ref AUX_TIMER_PRESCALE_DIV_4 : Prescale division ratio 4
421 //! - \ref AUX_TIMER_PRESCALE_DIV_16 : Prescale division ratio 16
422 //! - \ref AUX_TIMER_PRESCALE_DIV_32 : Prescale division ratio 32
423 //! - \ref AUX_TIMER_PRESCALE_DIV_64 : Prescale division ratio 64
424 //! - \ref AUX_TIMER_PRESCALE_DIV_128 : Prescale division ratio 128
425 //! - \ref AUX_TIMER_PRESCALE_DIV_256 : Prescale division ratio 256
426 //! - \ref AUX_TIMER_PRESCALE_DIV_1028 : Prescale division ratio 1028
427 //! - \ref AUX_TIMER_PRESCALE_DIV_2048 : Prescale division ratio 2048
428 //! - \ref AUX_TIMER_PRESCALE_DIV_4096 : Prescale division ratio 4096
429 //! - \ref AUX_TIMER_PRESCALE_DIV_8192 : Prescale division ratio 8192
430 //! - \ref AUX_TIMER_PRESCALE_DIV_16384 : Prescale division ratio 16384
431 //! - \ref AUX_TIMER_PRESCALE_DIV_32768 : Prescale division ratio 32768
432 //!
433 //! \sa \ref AUXTimerPrescaleSet()
434 //
435 //*****************************************************************************
436 extern uint32_t AUXTimerPrescaleGet(uint32_t ui32Timer);
437
438 //*****************************************************************************
439 //
440 // Support for DriverLib in ROM:
441 // Redirect to implementation in ROM when available.
442 //
443 //*****************************************************************************
444 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
445 #include <driverlib/rom.h>
446 #ifdef ROM_AUXTimerConfigure
447 #undef AUXTimerConfigure
448 #define AUXTimerConfigure ROM_AUXTimerConfigure
449 #endif
450 #ifdef ROM_AUXTimerStart
451 #undef AUXTimerStart
452 #define AUXTimerStart ROM_AUXTimerStart
453 #endif
454 #ifdef ROM_AUXTimerStop
455 #undef AUXTimerStop
456 #define AUXTimerStop ROM_AUXTimerStop
457 #endif
458 #ifdef ROM_AUXTimerPrescaleSet
459 #undef AUXTimerPrescaleSet
460 #define AUXTimerPrescaleSet ROM_AUXTimerPrescaleSet
461 #endif
462 #ifdef ROM_AUXTimerPrescaleGet
463 #undef AUXTimerPrescaleGet
464 #define AUXTimerPrescaleGet ROM_AUXTimerPrescaleGet
465 #endif
466 #endif
467
468 //*****************************************************************************
469 //
470 // Mark the end of the C bindings section for C++ compilers.
471 //
472 //*****************************************************************************
473 #ifdef __cplusplus
474 }
475 #endif
476
477 #endif // __AUX_TIMER_H__
478
479 //*****************************************************************************
480 //
481 //! Close the Doxygen group.
482 //! @}
483 //! @}
484 //
485 //*****************************************************************************
486