CC13xx Driver Library
timer.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: timer.h
3 * Revised: 2015-11-03 09:54:47 +0100 (Tue, 03 Nov 2015)
4 * Revision: 44933
5 *
6 * Copyright (c) 2015 - 2016, 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 //
43 //
44 //****************************************************************************
45 
46 #ifndef __GPT_H__
47 #define __GPT_H__
48 
49 //*****************************************************************************
50 //
51 // If building with a C++ compiler, make all of the definitions in this header
52 // have a C binding.
53 //
54 //*****************************************************************************
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59 
60 #include <stdbool.h>
61 #include <stdint.h>
62 #include <inc/hw_ints.h>
63 #include <inc/hw_types.h>
64 #include <inc/hw_memmap.h>
65 #include <inc/hw_gpt.h>
66 #include <driverlib/interrupt.h>
67 #include <driverlib/debug.h>
68 
69 //*****************************************************************************
70 //
71 // Support for DriverLib in ROM:
72 // This section renames all functions that are not "static inline", so that
73 // calling these functions will default to implementation in flash. At the end
74 // of this file a second renaming will change the defaults to implementation in
75 // ROM for available functions.
76 //
77 // To force use of the implementation in flash, e.g. for debugging:
78 // - Globally: Define DRIVERLIB_NOROM at project level
79 // - Per function: Use prefix "NOROM_" when calling the function
80 //
81 //*****************************************************************************
82 #if !defined(DOXYGEN)
83  #define TimerConfigure NOROM_TimerConfigure
84  #define TimerLevelControl NOROM_TimerLevelControl
85  #define TimerStallControl NOROM_TimerStallControl
86  #define TimerWaitOnTriggerControl NOROM_TimerWaitOnTriggerControl
87  #define TimerIntRegister NOROM_TimerIntRegister
88  #define TimerIntUnregister NOROM_TimerIntUnregister
89  #define TimerMatchUpdateMode NOROM_TimerMatchUpdateMode
90  #define TimerIntervalLoadMode NOROM_TimerIntervalLoadMode
91 #endif
92 
93 //*****************************************************************************
94 //
95 // Values that can be passed to TimerConfigure as the ui32Config parameter.
96 //
97 //*****************************************************************************
98 #define TIMER_CFG_ONE_SHOT 0x00000021 // Full-width one-shot timer
99 #define TIMER_CFG_ONE_SHOT_UP 0x00000031 // Full-width one-shot up-count timer
100 #define TIMER_CFG_PERIODIC 0x00000022 // Full-width periodic timer
101 #define TIMER_CFG_PERIODIC_UP 0x00000032 // Full-width periodic up-count 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_CAPA_EVENT 0x00000004 // CaptureA event interrupt
137 #define TIMER_CAPA_MATCH 0x00000002 // CaptureA match interrupt
138 #define TIMER_TIMA_TIMEOUT 0x00000001 // TimerA time out interrupt
139 
140 //*****************************************************************************
141 //
142 // Values that can be passed to TimerControlEvent as the ui32Event parameter.
143 //
144 //*****************************************************************************
145 #define TIMER_EVENT_POS_EDGE 0x00000000 // Count positive edges
146 #define TIMER_EVENT_NEG_EDGE 0x00000404 // Count negative edges
147 #define TIMER_EVENT_BOTH_EDGES 0x00000C0C // Count both edges
148 
149 //*****************************************************************************
150 //
151 // Values that can be passed to most of the timer APIs as the ui32Timer
152 // parameter.
153 //
154 //*****************************************************************************
155 #define TIMER_A 0x000000FF // Timer A
156 #define TIMER_B 0x0000FF00 // Timer B
157 #define TIMER_BOTH 0x0000FFFF // Timer Both
158 
159 //*****************************************************************************
160 //
161 // Values that can be passed to GPTSynchronize as the ui32Timers parameter
162 //
163 //*****************************************************************************
164 #define TIMER_0A_SYNC 0x00000001 // Synchronize Timer 0A
165 #define TIMER_0B_SYNC 0x00000002 // Synchronize Timer 0B
166 #define TIMER_1A_SYNC 0x00000004 // Synchronize Timer 1A
167 #define TIMER_1B_SYNC 0x00000008 // Synchronize Timer 1B
168 #define TIMER_2A_SYNC 0x00000010 // Synchronize Timer 2A
169 #define TIMER_2B_SYNC 0x00000020 // Synchronize Timer 2B
170 #define TIMER_3A_SYNC 0x00000040 // Synchronize Timer 3A
171 #define TIMER_3B_SYNC 0x00000080 // Synchronize Timer 3B
172 
173 //*****************************************************************************
174 //
175 // Values that can be passed to TimerMatchUpdateMode
176 //
177 //*****************************************************************************
178 #define TIMER_MATCHUPDATE_NEXTCYCLE 0x00000000 // Apply match register on next cycle
179 #define TIMER_MATCHUPDATE_TIMEOUT 0x00000001 // Apply match register on next timeout
180 
181 //*****************************************************************************
182 //
183 // Values that can be passed to TimerIntervalLoad
184 //
185 //*****************************************************************************
186 #define TIMER_INTERVALLOAD_NEXTCYCLE 0x00000000 // Load TxR register with the value in the TxILR register on the next clock cycle
187 #define TIMER_INTERVALLOAD_TIMEOUT 0x00000001 // Load TxR register with the value in the TxILR register on next timeout
188 
189 //*****************************************************************************
190 //
191 // API Functions and prototypes
192 //
193 //*****************************************************************************
194 
195 #ifdef DRIVERLIB_DEBUG
196 //*****************************************************************************
197 //
208 //
209 //*****************************************************************************
210 static bool
211 TimerBaseValid(uint32_t ui32Base)
212 {
213  return((ui32Base == GPT0_BASE) || (ui32Base == GPT1_BASE) ||
214  (ui32Base == GPT2_BASE) || (ui32Base == GPT3_BASE));
215 }
216 #endif
217 
218 //*****************************************************************************
219 //
232 //
233 //*****************************************************************************
234 __STATIC_INLINE void
235 TimerEnable(uint32_t ui32Base, uint32_t ui32Timer)
236 {
237  //
238  // Check the arguments.
239  //
240  ASSERT(TimerBaseValid(ui32Base));
241  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
242  (ui32Timer == TIMER_BOTH));
243 
244  //
245  // Enable the timer(s) module.
246  //
247  HWREG(ui32Base + GPT_O_CTL) |= ui32Timer & (GPT_CTL_TAEN | GPT_CTL_TBEN);
248 }
249 
250 //*****************************************************************************
251 //
263 //
264 //*****************************************************************************
265 __STATIC_INLINE void
266 TimerDisable(uint32_t ui32Base, uint32_t ui32Timer)
267 {
268  //
269  // Check the arguments.
270  //
271  ASSERT(TimerBaseValid(ui32Base));
272  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
273  (ui32Timer == TIMER_BOTH));
274 
275  //
276  // Disable the timer module.
277  //
278  HWREG(ui32Base + GPT_O_CTL) &= ~(ui32Timer &
280 }
281 
282 //*****************************************************************************
283 //
332 //
333 //*****************************************************************************
334 extern void TimerConfigure(uint32_t ui32Base, uint32_t ui32Config);
335 
336 //*****************************************************************************
337 //
352 //
353 //*****************************************************************************
354 extern void TimerLevelControl(uint32_t ui32Base, uint32_t ui32Timer,
355  bool bInvert);
356 
357 //*****************************************************************************
358 //
375 //
376 //*****************************************************************************
377 __STATIC_INLINE void
378 TimerEventControl(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
379 {
380  //
381  // Check the arguments.
382  //
383  ASSERT(TimerBaseValid(ui32Base));
384  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
385  (ui32Timer == TIMER_BOTH));
386 
387  //
388  // Set the event type.
389  //
390  ui32Timer &= GPT_CTL_TAEVENT_M | GPT_CTL_TBEVENT_M;
391  HWREG(ui32Base + GPT_O_CTL) = ((HWREG(ui32Base + GPT_O_CTL) & ~ui32Timer) |
392  (ui32Event & ui32Timer));
393 }
394 
395 //*****************************************************************************
396 //
414 //
415 //*****************************************************************************
416 extern void TimerStallControl(uint32_t ui32Base, uint32_t ui32Timer,
417  bool bStall);
418 
419 //*****************************************************************************
420 //
440 //
441 //*****************************************************************************
442 extern void TimerWaitOnTriggerControl(uint32_t ui32Base, uint32_t ui32Timer,
443  bool bWait);
444 
445 //*****************************************************************************
446 //
477 //
478 //*****************************************************************************
479 __STATIC_INLINE void
480 TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
481 {
482  //
483  // Check the arguments.
484  //
485  ASSERT(TimerBaseValid(ui32Base));
486  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
487  (ui32Timer == TIMER_BOTH));
488  ASSERT(ui32Value < 256);
489 
490  //
491  // Set the timer A prescaler if requested.
492  //
493  if(ui32Timer & TIMER_A)
494  {
495  HWREG(ui32Base + GPT_O_TAPR) = ui32Value;
496  }
497 
498  //
499  // Set the timer B prescaler if requested.
500  //
501  if(ui32Timer & TIMER_B)
502  {
503  HWREG(ui32Base + GPT_O_TBPR) = ui32Value;
504  }
505 }
506 
507 //*****************************************************************************
508 //
532 //
533 //*****************************************************************************
534 __STATIC_INLINE uint32_t
535 TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer)
536 {
537  //
538  // Check the arguments.
539  //
540  ASSERT(TimerBaseValid(ui32Base));
541  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
542  (ui32Timer == TIMER_BOTH));
543 
544  //
545  // Return the appropriate prescale value.
546  //
547  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAPR) :
548  HWREG(ui32Base + GPT_O_TBPR));
549 }
550 
551 //*****************************************************************************
552 //
571 //
572 //*****************************************************************************
573 __STATIC_INLINE void
574 TimerPrescaleMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
575 {
576  //
577  // Check the arguments.
578  //
579  ASSERT(TimerBaseValid(ui32Base));
580  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
581  (ui32Timer == TIMER_BOTH));
582  ASSERT(ui32Value < 256);
583 
584  //
585  // Set the timer A prescale match if requested.
586  //
587  if(ui32Timer & TIMER_A)
588  {
589  HWREG(ui32Base + GPT_O_TAPMR) = ui32Value;
590  }
591 
592  //
593  // Set the timer B prescale match if requested.
594  //
595  if(ui32Timer & TIMER_B)
596  {
597  HWREG(ui32Base + GPT_O_TBPMR) = ui32Value;
598  }
599 }
600 
601 //*****************************************************************************
602 //
618 //
619 //*****************************************************************************
620 __STATIC_INLINE uint32_t
621 TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
622 {
623  //
624  // Check the arguments.
625  //
626  ASSERT(TimerBaseValid(ui32Base));
627  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
628 
629  //
630  // Return the appropriate prescale match value.
631  //
632  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAPMR) :
633  HWREG(ui32Base + GPT_O_TBPMR));
634 }
635 
636 //*****************************************************************************
637 //
657 //
658 //*****************************************************************************
659 __STATIC_INLINE void
660 TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
661 {
662  //
663  // Check the arguments.
664  //
665  ASSERT(TimerBaseValid(ui32Base));
666  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
667  (ui32Timer == TIMER_BOTH));
668 
669  //
670  // Set the timer A load value if requested.
671  //
672  if(ui32Timer & TIMER_A)
673  {
674  HWREG(ui32Base + GPT_O_TAILR) = ui32Value;
675  }
676 
677  //
678  // Set the timer B load value if requested.
679  //
680  if(ui32Timer & TIMER_B)
681  {
682  HWREG(ui32Base + GPT_O_TBILR) = ui32Value;
683  }
684 }
685 
686 //*****************************************************************************
687 //
705 //
706 //*****************************************************************************
707 __STATIC_INLINE uint32_t
708 TimerLoadGet(uint32_t ui32Base, uint32_t ui32Timer)
709 {
710  //
711  // Check the arguments.
712  //
713  ASSERT(TimerBaseValid(ui32Base));
714  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
715 
716  //
717  // Return the appropriate load value.
718  //
719  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAILR) :
720  HWREG(ui32Base + GPT_O_TBILR));
721 }
722 
723 //*****************************************************************************
724 //
741 //
742 //*****************************************************************************
743 __STATIC_INLINE uint32_t
744 TimerValueGet(uint32_t ui32Base, uint32_t ui32Timer)
745 {
746  //
747  // Check the arguments.
748  //
749  ASSERT(TimerBaseValid(ui32Base));
750  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
751 
752  //
753  // Return the appropriate timer value.
754  //
755  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAR) :
756  HWREG(ui32Base + GPT_O_TBR));
757 }
758 
759 //*****************************************************************************
760 //
783 //
784 //*****************************************************************************
785 __STATIC_INLINE void
786 TimerMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
787 {
788  //
789  // Check the arguments.
790  //
791  ASSERT(TimerBaseValid(ui32Base));
792  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
793  (ui32Timer == TIMER_BOTH));
794 
795  //
796  // Set the timer A match value if requested.
797  //
798  if(ui32Timer & TIMER_A)
799  {
800  HWREG(ui32Base + GPT_O_TAMATCHR) = ui32Value;
801  }
802 
803  //
804  // Set the timer B match value if requested.
805  //
806  if(ui32Timer & TIMER_B)
807  {
808  HWREG(ui32Base + GPT_O_TBMATCHR) = ui32Value;
809  }
810 }
811 
812 //*****************************************************************************
813 //
831 //
832 //*****************************************************************************
833 __STATIC_INLINE uint32_t
834 TimerMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
835 {
836  //
837  // Check the arguments.
838  //
839  ASSERT(TimerBaseValid(ui32Base));
840  ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B));
841 
842  //
843  // Return the appropriate match value.
844  //
845  return((ui32Timer == TIMER_A) ? HWREG(ui32Base + GPT_O_TAMATCHR) :
846  HWREG(ui32Base + GPT_O_TBMATCHR));
847 }
848 
849 //*****************************************************************************
850 //
871 //
872 //*****************************************************************************
873 extern void TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer,
874  void (*pfnHandler)(void));
875 
876 //*****************************************************************************
877 //
894 //
895 //*****************************************************************************
896 extern void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer);
897 
898 //*****************************************************************************
899 //
918 //
919 //*****************************************************************************
920 __STATIC_INLINE void
921 TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
922 {
923  //
924  // Check the arguments.
925  //
926  ASSERT(TimerBaseValid(ui32Base));
927 
928  //
929  // Enable the specified interrupts.
930  //
931  HWREG(ui32Base + GPT_O_IMR) |= ui32IntFlags;
932 }
933 
934 //*****************************************************************************
935 //
954 //
955 //*****************************************************************************
956 __STATIC_INLINE void
957 TimerIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
958 {
959  //
960  // Check the arguments.
961  //
962  ASSERT(TimerBaseValid(ui32Base));
963 
964  //
965  // Disable the specified interrupts.
966  //
967  HWREG(ui32Base + GPT_O_IMR) &= ~(ui32IntFlags);
968 }
969 
970 //*****************************************************************************
971 //
990 //
991 //*****************************************************************************
992 __STATIC_INLINE uint32_t
993 TimerIntStatus(uint32_t ui32Base, bool bMasked)
994 {
995  //
996  // Check the arguments.
997  //
998  ASSERT(TimerBaseValid(ui32Base));
999 
1000  //
1001  // Return either the interrupt status or the raw interrupt status as
1002  // requested.
1003  //
1004  return(bMasked ? HWREG(ui32Base + GPT_O_MIS) :
1005  HWREG(ui32Base + GPT_O_RIS));
1006 }
1007 
1008 //*****************************************************************************
1009 //
1043 //
1044 //*****************************************************************************
1045 __STATIC_INLINE void
1046 TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
1047 {
1048  //
1049  // Check the arguments.
1050  //
1051  ASSERT(TimerBaseValid(ui32Base));
1052 
1053  //
1054  // Clear the requested interrupt sources.
1055  //
1056  HWREG(ui32Base + GPT_O_ICLR) = ui32IntFlags;
1057 }
1058 
1059 //*****************************************************************************
1060 //
1083 //
1084 //*****************************************************************************
1085 __STATIC_INLINE void
1086 TimerSynchronize(uint32_t ui32Base, uint32_t ui32Timers)
1087 {
1088  //
1089  // Check the arguments.
1090  //
1091  ASSERT(ui32Base == GPT0_BASE);
1092 
1093  //
1094  // Synchronize the specified timers.
1095  //
1096  HWREG(ui32Base + GPT_O_SYNC) = ui32Timers;
1097 }
1098 
1099 //*****************************************************************************
1100 //
1106 //
1107 //*****************************************************************************
1108 __STATIC_INLINE void
1109 TimerCcpCombineEnable(uint32_t ui32Base)
1110 {
1111  // Check the arguments
1112  ASSERT(TimerBaseValid(ui32Base));
1113 
1114  // Set the bit
1115  HWREG(ui32Base + GPT_O_ANDCCP) |= GPT_ANDCCP_CCP_AND_EN;
1116 }
1117 
1118 //*****************************************************************************
1119 //
1125 //
1126 //*****************************************************************************
1127 __STATIC_INLINE void
1128 TimerCcpCombineDisable(uint32_t ui32Base)
1129 {
1130  // Check the arguments
1131  ASSERT(TimerBaseValid(ui32Base));
1132 
1133  // Clear the bit
1134  HWREG(ui32Base + GPT_O_ANDCCP) &= ~(GPT_ANDCCP_CCP_AND_EN);
1135 }
1136 
1137 //*****************************************************************************
1138 //
1159 //
1160 //*****************************************************************************
1161 extern void TimerMatchUpdateMode(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode);
1162 
1163 //*****************************************************************************
1164 //
1186 //
1187 //*****************************************************************************
1188 extern void TimerIntervalLoadMode(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode);
1189 
1190 //*****************************************************************************
1191 //
1192 // Support for DriverLib in ROM:
1193 // Redirect to implementation in ROM when available.
1194 //
1195 //*****************************************************************************
1196 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
1197  #include <driverlib/rom.h>
1198  #ifdef ROM_TimerConfigure
1199  #undef TimerConfigure
1200  #define TimerConfigure ROM_TimerConfigure
1201  #endif
1202  #ifdef ROM_TimerLevelControl
1203  #undef TimerLevelControl
1204  #define TimerLevelControl ROM_TimerLevelControl
1205  #endif
1206  #ifdef ROM_TimerStallControl
1207  #undef TimerStallControl
1208  #define TimerStallControl ROM_TimerStallControl
1209  #endif
1210  #ifdef ROM_TimerWaitOnTriggerControl
1211  #undef TimerWaitOnTriggerControl
1212  #define TimerWaitOnTriggerControl ROM_TimerWaitOnTriggerControl
1213  #endif
1214  #ifdef ROM_TimerIntRegister
1215  #undef TimerIntRegister
1216  #define TimerIntRegister ROM_TimerIntRegister
1217  #endif
1218  #ifdef ROM_TimerIntUnregister
1219  #undef TimerIntUnregister
1220  #define TimerIntUnregister ROM_TimerIntUnregister
1221  #endif
1222  #ifdef ROM_TimerMatchUpdateMode
1223  #undef TimerMatchUpdateMode
1224  #define TimerMatchUpdateMode ROM_TimerMatchUpdateMode
1225  #endif
1226  #ifdef ROM_TimerIntervalLoadMode
1227  #undef TimerIntervalLoadMode
1228  #define TimerIntervalLoadMode ROM_TimerIntervalLoadMode
1229  #endif
1230 #endif
1231 
1232 //*****************************************************************************
1233 //
1234 // Mark the end of the C bindings section for C++ compilers.
1235 //
1236 //*****************************************************************************
1237 #ifdef __cplusplus
1238 }
1239 #endif
1240 
1241 #endif // __GPT_H__
1242 
1243 //*****************************************************************************
1244 //
1248 //
1249 //*****************************************************************************
void TimerWaitOnTriggerControl(uint32_t ui32Base, uint32_t ui32Timer, bool bWait)
Controls the wait on trigger handling.
Definition: timer.c:222
static uint32_t TimerPrescaleMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
Get the timer prescale match value.
Definition: timer.h:621
static void TimerMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Sets the timer match value.
Definition: timer.h:786
static uint32_t TimerValueGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the current timer value.
Definition: timer.h:744
static void TimerIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Disables individual timer interrupt sources.
Definition: timer.h:957
void TimerStallControl(uint32_t ui32Base, uint32_t ui32Timer, bool bStall)
Controls the stall handling.
Definition: timer.c:198
void TimerMatchUpdateMode(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)
Sets the Match Register Update mode.
Definition: timer.c:378
static void TimerDisable(uint32_t ui32Base, uint32_t ui32Timer)
Disables the timer(s).
Definition: timer.h:266
static uint32_t TimerLoadGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the timer load value.
Definition: timer.h:708
void TimerIntRegister(uint32_t ui32Base, uint32_t ui32Timer, void(*pfnHandler)(void))
Registers an interrupt handler for the timer interrupt.
Definition: timer.c:268
static uint32_t TimerMatchGet(uint32_t ui32Base, uint32_t ui32Timer)
Gets the timer match value.
Definition: timer.h:834
static void TimerCcpCombineEnable(uint32_t ui32Base)
Enables AND'ing of the CCP outputs from Timer A and Timer B.
Definition: timer.h:1109
static void TimerIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Clears timer interrupt sources.
Definition: timer.h:1046
static uint32_t TimerIntStatus(uint32_t ui32Base, bool bMasked)
Gets the current interrupt status.
Definition: timer.h:993
void TimerConfigure(uint32_t ui32Base, uint32_t ui32Config)
Configures the timer(s).
Definition: timer.c:117
static void TimerEventControl(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Event)
Controls the event type.
Definition: timer.h:378
static void TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Enables individual timer interrupt sources.
Definition: timer.h:921
static void TimerPrescaleSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Set the timer prescale value.
Definition: timer.h:480
#define ASSERT(expr)
Definition: debug.h:74
#define TIMER_B
Definition: timer.h:156
void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer)
Unregisters an interrupt handler for the timer interrupt.
Definition: timer.c:323
static void TimerEnable(uint32_t ui32Base, uint32_t ui32Timer)
Enables the timer(s).
Definition: timer.h:235
void TimerLevelControl(uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)
Controls the output level.
Definition: timer.c:173
void TimerIntervalLoadMode(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Mode)
Sets the Interval Load mode.
Definition: timer.c:418
#define TIMER_A
Definition: timer.h:155
static void TimerPrescaleMatchSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Set the timer prescale match value.
Definition: timer.h:574
static uint32_t TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer)
Get the timer prescale value.
Definition: timer.h:535
static void TimerSynchronize(uint32_t ui32Base, uint32_t ui32Timers)
Synchronizes the counters in a set of timers.
Definition: timer.h:1086
static void TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value)
Sets the timer load value.
Definition: timer.h:660
#define TIMER_BOTH
Definition: timer.h:157
static void TimerCcpCombineDisable(uint32_t ui32Base)
Disables AND'ing of the CCP outputs from Timer A and Timer B.
Definition: timer.h:1128