CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
timer.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: timer.h
3 * Revised: 2015-01-14 12:12:44 +0100 (on, 14 jan 2015)
4 * Revision: 42373
5 *
6 * Copyright (c) 2015, Texas Instruments Incorporated
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1) Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2) Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 
37 //****************************************************************************
38 //
41 //
42 //****************************************************************************
43 
44 #ifndef __GPT_H__
45 #define __GPT_H__
46 
47 //*****************************************************************************
48 //
49 // If building with a C++ compiler, make all of the definitions in this header
50 // have a C binding.
51 //
52 //*****************************************************************************
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 
58 #include <stdbool.h>
59 #include <stdint.h>
60 #include <inc/hw_ints.h>
61 #include <inc/hw_types.h>
62 #include <inc/hw_memmap.h>
63 #include <inc/hw_gpt.h>
64 #include <driverlib/interrupt.h>
65 #include <driverlib/debug.h>
66 
67 //*****************************************************************************
68 //
69 // Support for DriverLib in ROM:
70 // This section renames all functions that are not "static inline", so that
71 // calling these functions will default to implementation in flash. At the end
72 // of this file a second renaming will change the defaults to implementation in
73 // ROM for available functions.
74 //
75 // To force use of the implementation in flash, e.g. for debugging:
76 // - Globally: Define DRIVERLIB_NOROM at project level
77 // - Per function: Use prefix "NOROM_" when calling the function
78 //
79 // Do not define DRIVERLIB_GENERATE_ROM!
80 //
81 //*****************************************************************************
82 #ifndef DRIVERLIB_GENERATE_ROM
83  #define TimerConfigure NOROM_TimerConfigure
84  #define TimerLevelControl NOROM_TimerLevelControl
85  #define TimerTriggerControl NOROM_TimerTriggerControl
86  #define TimerStallControl NOROM_TimerStallControl
87  #define TimerWaitOnTriggerControl NOROM_TimerWaitOnTriggerControl
88  #define TimerIntRegister NOROM_TimerIntRegister
89  #define TimerIntUnregister NOROM_TimerIntUnregister
90 #endif
91 
92 //*****************************************************************************
93 //
94 // Values that can be passed to TimerConfigure as the ui32Config parameter.
95 //
96 //*****************************************************************************
97 #define TIMER_CFG_ONE_SHOT 0x00000021 // Full-width one-shot timer
98 #define TIMER_CFG_ONE_SHOT_UP 0x00000031 // Full-width one-shot up-count timer
99 #define TIMER_CFG_PERIODIC 0x00000022 // Full-width periodic timer
100 #define TIMER_CFG_PERIODIC_UP 0x00000032 // Full-width periodic up-count timer
101 #define TIMER_CFG_RTC 0x01000000 // Full-width RTC timer
102 #define TIMER_CFG_SPLIT_PAIR 0x04000000 // Two half-width timers
103 #define TIMER_CFG_A_ONE_SHOT 0x00000021 // Timer A one-shot timer
104 #define TIMER_CFG_A_ONE_SHOT_UP 0x00000031 // Timer A one-shot up-count timer
105 #define TIMER_CFG_A_PERIODIC 0x00000022 // Timer A periodic timer
106 #define TIMER_CFG_A_PERIODIC_UP 0x00000032 // Timer A periodic up-count timer
107 #define TIMER_CFG_A_CAP_COUNT 0x00000003 // Timer A event counter
108 #define TIMER_CFG_A_CAP_COUNT_UP 0x00000013 // Timer A event up-counter
109 #define TIMER_CFG_A_CAP_TIME 0x00000007 // Timer A event timer
110 #define TIMER_CFG_A_CAP_TIME_UP 0x00000017 // Timer A event up-count timer
111 #define TIMER_CFG_A_PWM 0x0000000A // Timer A PWM output
112 #define TIMER_CFG_B_ONE_SHOT 0x00002100 // Timer B one-shot timer
113 #define TIMER_CFG_B_ONE_SHOT_UP 0x00003100 // Timer B one-shot up-count timer
114 #define TIMER_CFG_B_PERIODIC 0x00002200 // Timer B periodic timer
115 #define TIMER_CFG_B_PERIODIC_UP 0x00003200 // Timer B periodic up-count timer
116 #define TIMER_CFG_B_CAP_COUNT 0x00000300 // Timer B event counter
117 #define TIMER_CFG_B_CAP_COUNT_UP 0x00001300 // Timer B event up-counter
118 #define TIMER_CFG_B_CAP_TIME 0x00000700 // Timer B event timer
119 #define TIMER_CFG_B_CAP_TIME_UP 0x00001700 // Timer B event up-count timer
120 #define TIMER_CFG_B_PWM 0x00000A00 // Timer B PWM output
121 
122 //*****************************************************************************
123 //
124 // Values that can be passed to TimerIntEnable, TimerIntDisable, and
125 // TimerIntClear as the ui32IntFlags parameter, and returned from
126 // TimerIntStatus.
127 //
128 //*****************************************************************************
129 #define TIMER_TIMB_DMA 0x00002000 // TimerB DMA Done interrupt
130 #define TIMER_TIMB_MATCH 0x00000800 // TimerB match interrupt
131 #define TIMER_CAPB_EVENT 0x00000400 // CaptureB event interrupt
132 #define TIMER_CAPB_MATCH 0x00000200 // CaptureB match interrupt
133 #define TIMER_TIMB_TIMEOUT 0x00000100 // TimerB time out interrupt
134 #define TIMER_TIMA_DMA 0x00000020 // TimerA DMA Done interrupt
135 #define TIMER_TIMA_MATCH 0x00000010 // TimerA match interrupt
136 #define TIMER_RTC_MATCH 0x00000008 // RTC interrupt mask
137 #define TIMER_CAPA_EVENT 0x00000004 // CaptureA event interrupt
138 #define TIMER_CAPA_MATCH 0x00000002 // CaptureA match interrupt
139 #define TIMER_TIMA_TIMEOUT 0x00000001 // TimerA time out interrupt
140 
141 //*****************************************************************************
142 //
143 // Values that can be passed to TimerControlEvent as the ui32Event parameter.
144 //
145 //*****************************************************************************
146 #define TIMER_EVENT_POS_EDGE 0x00000000 // Count positive edges
147 #define TIMER_EVENT_NEG_EDGE 0x00000404 // Count negative edges
148 #define TIMER_EVENT_BOTH_EDGES 0x00000C0C // Count both edges
149 
150 //*****************************************************************************
151 //
152 // Values that can be passed to most of the timer APIs as the ui32Timer
153 // parameter.
154 //
155 //*****************************************************************************
156 #define TIMER_A 0x000000FF // Timer A
157 #define TIMER_B 0x0000FF00 // Timer B
158 #define TIMER_BOTH 0x0000FFFF // Timer Both
159 
160 //*****************************************************************************
161 //
162 // Values that can be passed to GPTSynchronize as the ui32Timers parameter
163 //
164 //*****************************************************************************
165 #define TIMER_0A_SYNC 0x00000001 // Synchronize Timer 0A
166 #define TIMER_0B_SYNC 0x00000002 // Synchronize Timer 0B
167 #define TIMER_1A_SYNC 0x00000004 // Synchronize Timer 1A
168 #define TIMER_1B_SYNC 0x00000008 // Synchronize Timer 1B
169 #define TIMER_2A_SYNC 0x00000010 // Synchronize Timer 2A
170 #define TIMER_2B_SYNC 0x00000020 // Synchronize Timer 2B
171 #define TIMER_3A_SYNC 0x00000040 // Synchronize Timer 3A
172 #define TIMER_3B_SYNC 0x00000080 // Synchronize Timer 3B
173 
174 //*****************************************************************************
175 //
176 // API Functions and prototypes
177 //
178 //*****************************************************************************
179 
180 #ifdef DRIVERLIB_DEBUG
181 //*****************************************************************************
182 //
193 //
194 //*****************************************************************************
195 static bool
196 TimerBaseValid(uint32_t ui32Base)
197 {
198  return((ui32Base == GPT0_BASE) || (ui32Base == GPT1_BASE) ||
199  (ui32Base == GPT2_BASE) || (ui32Base == GPT3_BASE));
200 }
201 #endif
202 
203 //*****************************************************************************
204 //
217 //
218 //*****************************************************************************
219 __STATIC_INLINE void
220 TimerEnable(uint32_t ui32Base, uint32_t ui32Timer)
221 {
222  //
223  // Check the arguments.
224  //
225  ASSERT(TimerBaseValid(ui32Base));
226  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
227  (ui32Timer == TIMER_BOTH));
228 
229  //
230  // Enable the timer(s) module.
231  //
232  HWREG(ui32Base + GPT_O_CTL) |= ui32Timer & (GPT_CTL_TAEN | GPT_CTL_TBEN);
233 }
234 
235 //*****************************************************************************
236 //
248 //
249 //*****************************************************************************
250 __STATIC_INLINE void
251 TimerDisable(uint32_t ui32Base, uint32_t ui32Timer)
252 {
253  //
254  // Check the arguments.
255  //
256  ASSERT(TimerBaseValid(ui32Base));
257  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
258  (ui32Timer == TIMER_BOTH));
259 
260  //
261  // Disable the timer module.
262  //
263  HWREG(ui32Base + GPT_O_CTL) &= ~(ui32Timer &
265 }
266 
267 //*****************************************************************************
268 //
318 //
319 //*****************************************************************************
320 extern void TimerConfigure(uint32_t ui32Base, uint32_t ui32Config);
321 
322 //*****************************************************************************
323 //
338 //
339 //*****************************************************************************
340 extern void TimerLevelControl(uint32_t ui32Base, uint32_t ui32Timer,
341  bool bInvert);
342 
343 //*****************************************************************************
344 //
359 //
360 //*****************************************************************************
361 extern void TimerTriggerControl(uint32_t ui32Base, uint32_t ui32Timer,
362  bool bEnable);
363 
364 //*****************************************************************************
365 //
382 //
383 //*****************************************************************************
384 __STATIC_INLINE void
385 TimerEventControl(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
386 {
387  //
388  // Check the arguments.
389  //
390  ASSERT(TimerBaseValid(ui32Base));
391  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
392  (ui32Timer == TIMER_BOTH));
393 
394  //
395  // Set the event type.
396  //
397  ui32Timer &= GPT_CTL_TAEVENT_M | GPT_CTL_TBEVENT_M;
398  HWREG(ui32Base + GPT_O_CTL) = ((HWREG(ui32Base + GPT_O_CTL) & ~ui32Timer) |
399  (ui32Event & ui32Timer));
400 }
401 
402 //*****************************************************************************
403 //
421 //
422 //*****************************************************************************
423 extern void TimerStallControl(uint32_t ui32Base, uint32_t ui32Timer,
424  bool bStall);
425 
426 //*****************************************************************************
427 //
447 //
448 //*****************************************************************************
449 extern void TimerWaitOnTriggerControl(uint32_t ui32Base, uint32_t ui32Timer,
450  bool bWait);
451 
452 //*****************************************************************************
453 //
462 //
463 //*****************************************************************************
464 __STATIC_INLINE void
465 TimerRtcEnable(uint32_t ui32Base)
466 {
467  //
468  // Check the arguments.
469  //
470  ASSERT(TimerBaseValid(ui32Base));
471 
472  //
473  // Enable RTC counting.
474  //
475  HWREG(ui32Base + GPT_O_CTL) |= GPT_CTL_RTCEN;
476 }
477 
478 //*****************************************************************************
479 //
487 //
488 //*****************************************************************************
489 __STATIC_INLINE void
490 TimerRtcDisable(uint32_t ui32Base)
491 {
492  //
493  // Check the arguments.
494  //
495  ASSERT(TimerBaseValid(ui32Base));
496 
497  //
498  // Disable RTC counting.
499  //
500  HWREG(ui32Base + GPT_O_CTL) &= ~(GPT_CTL_RTCEN);
501 }
502 
503 //*****************************************************************************
504 //
535 //
536 //*****************************************************************************
537 __STATIC_INLINE void
538 TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
539 {
540  //
541  // Check the arguments.
542  //
543  ASSERT(TimerBaseValid(ui32Base));
544  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
545  (ui32Timer == TIMER_BOTH));
546  ASSERT(ui32Value < 256);
547 
548  //
549  // Set the timer A prescaler if requested.
550  //
551  if(ui32Timer & TIMER_A)
552  {
553  HWREG(ui32Base + GPT_O_TAPR) = ui32Value;
554  }
555 
556  //
557  // Set the timer B prescaler if requested.
558  //
559  if(ui32Timer & TIMER_B)
560  {
561  HWREG(ui32Base + GPT_O_TBPR) = ui32Value;
562  }
563 }
564 
565 //*****************************************************************************
566 //
590 //
591 //*****************************************************************************
592 __STATIC_INLINE uint32_t
593 TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer)
594 {
595  //
596  // Check the arguments.
597  //
598  ASSERT(TimerBaseValid(ui32Base));
599  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
600  (ui32Timer == TIMER_BOTH));
601 
602  //
603  // Return the appropriate prescale value.
604  //
605  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAPR) :
606  HWREG(ui32Base + GPT_O_TBPR));
607 }
608 
609 //*****************************************************************************
610 //
629 //
630 //*****************************************************************************
631 __STATIC_INLINE void
632 TimerPrescaleMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
633 {
634  //
635  // Check the arguments.
636  //
637  ASSERT(TimerBaseValid(ui32Base));
638  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
639  (ui32Timer == TIMER_BOTH));
640  ASSERT(ui32Value < 256);
641 
642  //
643  // Set the timer A prescale match if requested.
644  //
645  if(ui32Timer & TIMER_A)
646  {
647  HWREG(ui32Base + GPT_O_TAPMR) = ui32Value;
648  }
649 
650  //
651  // Set the timer B prescale match if requested.
652  //
653  if(ui32Timer & TIMER_B)
654  {
655  HWREG(ui32Base + GPT_O_TBPMR) = ui32Value;
656  }
657 }
658 
659 //*****************************************************************************
660 //
676 //
677 //*****************************************************************************
678 __STATIC_INLINE uint32_t
679 TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
680 {
681  //
682  // Check the arguments.
683  //
684  ASSERT(TimerBaseValid(ui32Base));
685  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
686 
687  //
688  // Return the appropriate prescale match value.
689  //
690  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAPMR) :
691  HWREG(ui32Base + GPT_O_TBPMR));
692 }
693 
694 //*****************************************************************************
695 //
715 //
716 //*****************************************************************************
717 __STATIC_INLINE void
718 TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
719 {
720  //
721  // Check the arguments.
722  //
723  ASSERT(TimerBaseValid(ui32Base));
724  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
725  (ui32Timer == TIMER_BOTH));
726 
727  //
728  // Set the timer A load value if requested.
729  //
730  if(ui32Timer & TIMER_A)
731  {
732  HWREG(ui32Base + GPT_O_TAILR) = ui32Value;
733  }
734 
735  //
736  // Set the timer B load value if requested.
737  //
738  if(ui32Timer & TIMER_B)
739  {
740  HWREG(ui32Base + GPT_O_TBILR) = ui32Value;
741  }
742 }
743 
744 //*****************************************************************************
745 //
763 //
764 //*****************************************************************************
765 __STATIC_INLINE uint32_t
766 TimerLoadGet(uint32_t ui32Base, uint32_t ui32Timer)
767 {
768  //
769  // Check the arguments.
770  //
771  ASSERT(TimerBaseValid(ui32Base));
772  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
773 
774  //
775  // Return the appropriate load value.
776  //
777  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAILR) :
778  HWREG(ui32Base + GPT_O_TBILR));
779 }
780 
781 //*****************************************************************************
782 //
799 //
800 //*****************************************************************************
801 __STATIC_INLINE uint32_t
802 TimerValueGet(uint32_t ui32Base, uint32_t ui32Timer)
803 {
804  //
805  // Check the arguments.
806  //
807  ASSERT(TimerBaseValid(ui32Base));
808  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
809 
810  //
811  // Return the appropriate timer value.
812  //
813  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAR) :
814  HWREG(ui32Base + GPT_O_TBR));
815 }
816 
817 //*****************************************************************************
818 //
841 //
842 //*****************************************************************************
843 __STATIC_INLINE void
844 TimerMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
845 {
846  //
847  // Check the arguments.
848  //
849  ASSERT(TimerBaseValid(ui32Base));
850  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
851  (ui32Timer == TIMER_BOTH));
852 
853  //
854  // Set the timer A match value if requested.
855  //
856  if(ui32Timer & TIMER_A)
857  {
858  HWREG(ui32Base + GPT_O_TAMATCHR) = ui32Value;
859  }
860 
861  //
862  // Set the timer B match value if requested.
863  //
864  if(ui32Timer & TIMER_B)
865  {
866  HWREG(ui32Base + GPT_O_TBMATCHR) = ui32Value;
867  }
868 }
869 
870 //*****************************************************************************
871 //
889 //
890 //*****************************************************************************
891 __STATIC_INLINE uint32_t
892 TimerMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
893 {
894  //
895  // Check the arguments.
896  //
897  ASSERT(TimerBaseValid(ui32Base));
898  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
899 
900  //
901  // Return the appropriate match value.
902  //
903  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAMATCHR) :
904  HWREG(ui32Base + GPT_O_TBMATCHR));
905 }
906 
907 //*****************************************************************************
908 //
929 //
930 //*****************************************************************************
931 extern void TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer,
932  void (*pfnHandler)(void));
933 
934 //*****************************************************************************
935 //
952 //
953 //*****************************************************************************
954 extern void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer);
955 
956 //*****************************************************************************
957 //
977 //
978 //*****************************************************************************
979 __STATIC_INLINE void
980 TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
981 {
982  //
983  // Check the arguments.
984  //
985  ASSERT(TimerBaseValid(ui32Base));
986 
987  //
988  // Enable the specified interrupts.
989  //
990  HWREG(ui32Base + GPT_O_IMR) |= ui32IntFlags;
991 }
992 
993 //*****************************************************************************
994 //
1014 //
1015 //*****************************************************************************
1016 __STATIC_INLINE void
1017 TimerIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
1018 {
1019  //
1020  // Check the arguments.
1021  //
1022  ASSERT(TimerBaseValid(ui32Base));
1023 
1024  //
1025  // Disable the specified interrupts.
1026  //
1027  HWREG(ui32Base + GPT_O_IMR) &= ~(ui32IntFlags);
1028 }
1029 
1030 //*****************************************************************************
1031 //
1051 //
1052 //*****************************************************************************
1053 __STATIC_INLINE uint32_t
1054 TimerIntStatus(uint32_t ui32Base, bool bMasked)
1055 {
1056  //
1057  // Check the arguments.
1058  //
1059  ASSERT(TimerBaseValid(ui32Base));
1060 
1061  //
1062  // Return either the interrupt status or the raw interrupt status as
1063  // requested.
1064  //
1065  return(bMasked ? HWREG(ui32Base + GPT_O_MIS) :
1066  HWREG(ui32Base + GPT_O_RIS));
1067 }
1068 
1069 //*****************************************************************************
1070 //
1099 //
1100 //*****************************************************************************
1101 __STATIC_INLINE void
1102 TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
1103 {
1104  //
1105  // Check the arguments.
1106  //
1107  ASSERT(TimerBaseValid(ui32Base));
1108 
1109  //
1110  // Clear the requested interrupt sources.
1111  //
1112  HWREG(ui32Base + GPT_O_ICLR) = ui32IntFlags;
1113 }
1114 
1115 //*****************************************************************************
1116 //
1139 //
1140 //*****************************************************************************
1141 __STATIC_INLINE void
1142 TimerSynchronize(uint32_t ui32Base, uint32_t ui32Timers)
1143 {
1144  //
1145  // Check the arguments.
1146  //
1147  ASSERT(ui32Base == GPT0_BASE);
1148 
1149  //
1150  // Synchronize the specified timers.
1151  //
1152  HWREG(ui32Base + GPT_O_SYNC) = ui32Timers;
1153 }
1154 
1155 //*****************************************************************************
1156 //
1157 // Support for DriverLib in ROM:
1158 // Redirect to implementation in ROM when available.
1159 //
1160 //*****************************************************************************
1161 #ifndef DRIVERLIB_NOROM
1162  #include <driverlib/rom.h>
1163  #ifdef ROM_TimerConfigure
1164  #undef TimerConfigure
1165  #define TimerConfigure ROM_TimerConfigure
1166  #endif
1167  #ifdef ROM_TimerLevelControl
1168  #undef TimerLevelControl
1169  #define TimerLevelControl ROM_TimerLevelControl
1170  #endif
1171  #ifdef ROM_TimerTriggerControl
1172  #undef TimerTriggerControl
1173  #define TimerTriggerControl ROM_TimerTriggerControl
1174  #endif
1175  #ifdef ROM_TimerStallControl
1176  #undef TimerStallControl
1177  #define TimerStallControl ROM_TimerStallControl
1178  #endif
1179  #ifdef ROM_TimerWaitOnTriggerControl
1180  #undef TimerWaitOnTriggerControl
1181  #define TimerWaitOnTriggerControl ROM_TimerWaitOnTriggerControl
1182  #endif
1183  #ifdef ROM_TimerIntRegister
1184  #undef TimerIntRegister
1185  #define TimerIntRegister ROM_TimerIntRegister
1186  #endif
1187  #ifdef ROM_TimerIntUnregister
1188  #undef TimerIntUnregister
1189  #define TimerIntUnregister ROM_TimerIntUnregister
1190  #endif
1191 #endif
1192 
1193 //*****************************************************************************
1194 //
1195 // Mark the end of the C bindings section for C++ compilers.
1196 //
1197 //*****************************************************************************
1198 #ifdef __cplusplus
1199 }
1200 #endif
1201 
1202 #endif // __GPT_H__
1203 
1204 //*****************************************************************************
1205 //
1208 //
1209 //*****************************************************************************
__STATIC_INLINE void TimerSynchronize(uint32_t ui32Base, uint32_t ui32Timers)
Synchronizes the counters in a set of timers.
Definition: timer.h:1142
__STATIC_INLINE uint32_t TimerLoadGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the timer load value.
Definition: timer.h:766
void TimerWaitOnTriggerControl(uint32_t ui32Base, uint32_t ui32Timer, bool bWait)
Controls the wait on trigger handling.
Definition: timer.c:266
__STATIC_INLINE void TimerEventControl(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
Controls the event type.
Definition: timer.h:385
void TimerStallControl(uint32_t ui32Base, uint32_t ui32Timer, bool bStall)
Controls the stall handling.
Definition: timer.c:242
#define ASSERT(expr)
Definition: debug.h:65
__STATIC_INLINE void TimerIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Disables individual timer interrupt sources.
Definition: timer.h:1017
void TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer, void(*pfnHandler)(void))
Registers an interrupt handler for the timer interrupt.
Definition: timer.c:312
__STATIC_INLINE void TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Set the timer prescale value.
Definition: timer.h:538
__STATIC_INLINE uint32_t TimerValueGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the current timer value.
Definition: timer.h:802
__STATIC_INLINE uint32_t TimerIntStatus(uint32_t ui32Base, bool bMasked)
Gets the current interrupt status.
Definition: timer.h:1054
__STATIC_INLINE void TimerPrescaleMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Set the timer prescale match value.
Definition: timer.h:632
__STATIC_INLINE void TimerEnable(uint32_t ui32Base, uint32_t ui32Timer)
Enables the timer(s).
Definition: timer.h:220
__STATIC_INLINE uint32_t TimerMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the timer match value.
Definition: timer.h:892
__STATIC_INLINE void TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Enables individual timer interrupt sources.
Definition: timer.h:980
__STATIC_INLINE void TimerDisable(uint32_t ui32Base, uint32_t ui32Timer)
Disables the timer(s).
Definition: timer.h:251
void TimerConfigure(uint32_t ui32Base, uint32_t ui32Config)
Configures the timer(s).
Definition: timer.c:117
#define TIMER_B
Definition: timer.h:157
__STATIC_INLINE void TimerRtcDisable(uint32_t ui32Base)
Disable RTC counting.
Definition: timer.h:490
void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer)
Unregisters an interrupt handler for the timer interrupt.
Definition: timer.c:367
void TimerLevelControl(uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)
Controls the output level.
Definition: timer.c:174
__STATIC_INLINE uint32_t TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer)
Get the timer prescale value.
Definition: timer.h:593
#define TIMER_A
Definition: timer.h:156
__STATIC_INLINE void TimerRtcEnable(uint32_t ui32Base)
Enable RTC counting.
Definition: timer.h:465
__STATIC_INLINE void TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Clears timer interrupt sources.
Definition: timer.h:1102
void TimerTriggerControl(uint32_t ui32Base, uint32_t ui32Timer, bool bEnable)
Enables or disables the ADC trigger output.
Definition: timer.c:199
__STATIC_INLINE void TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Sets the timer load value.
Definition: timer.h:718
__STATIC_INLINE void TimerMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Sets the timer match value.
Definition: timer.h:844
#define TIMER_BOTH
Definition: timer.h:158
__STATIC_INLINE uint32_t TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
Get the timer prescale match value.
Definition: timer.h:679