ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_tmr.c
1 
46 #ifdef __ICCARM__
47 /*
48 * IAR MISRA C 2004 error suppressions.
49 *
50 * Pm011 (rule 6.3): the basic types of char, int, short, long, float, and double should not be used
51 * Necessary for stdbool.
52 *
53 * Pm073 (rule 14.7): a function should have a single point of exit
54 * Pm143 (rule 14.7): a function should have a single point of exit at the end of the function
55 * Multiple returns are used for error handling.
56 *
57 * Pm123 (rule 8.5): there shall be no definition of objects or functions in a header file
58 * Static configuration data file is included.
59 *
60 * Pm140 (Rule 11.4): a cast should not be performed between a pointer type and an integral type
61 * This violation appears when deferencing the pointer to the register typedef. No way around this.
62 *
63 * Pm141 (Rule 11.4): a cast should not be performed between a pointer to object type and a different pointer to object type
64 * The pointer casting is necessary to allow the GP and RGB timers to abstracted into one driver. This has been approved by the PO.
65 */
66 #pragma diag_suppress=Pm011,Pm073,Pm123,Pm140,Pm141,Pm143
67 #endif /* __ICCARM__ */
68 
69 
79 #include <adi_processor.h>
80 #include <adi_tmr_config.h>
81 #include <rtos_map/adi_rtos_map.h>
82 #include <drivers/tmr/adi_tmr.h>
83 
84 /* Static configuration data */
85 #include "adi_tmr_data.c"
86 
87 #if defined(__ADUCM4x50__)
88 /* In adi_tmr_ConfigPwm, the bit positions for just PWM0 are used for PWM1 and PWM2 to simplify the code. Check here to make sure this is safe. */
89 #if BITP_TMR_RGB_PWM0CTL_IDLESTATE != BITP_TMR_RGB_PWM1CTL_IDLESTATE
90 #error "Bit positions for PWM0 and PWM1 do not match. Fix adi_tmr_ConfigPwm."
91 #endif
92 #if BITP_TMR_RGB_PWM0CTL_IDLESTATE != BITP_TMR_RGB_PWM2CTL_IDLESTATE
93 #error "Bit positions for PWM0 and PWM2 do not match. Fix adi_tmr_ConfigPwm."
94 #endif
95 #if BITP_TMR_RGB_PWM0CTL_MATCH != BITP_TMR_RGB_PWM1CTL_MATCH
96 #error "Bit positions for PWM0 and PWM1 do not match. Fix adi_tmr_ConfigPwm."
97 #endif
98 #if BITP_TMR_RGB_PWM0CTL_MATCH != BITP_TMR_RGB_PWM2CTL_MATCH
99 #error "Bit positions for PWM0 and PWM2 do not match. Fix adi_tmr_ConfigPwm."
100 #endif
101 #endif /*__ADUCM4x50__*/
102 
104 #if defined(__ADUCM302x__)
105 #define ADI_TMR_NUM_EVENTS (16u)
106 #elif defined(__ADUCM4x50__)
107 #define ADI_TMR_NUM_EVENTS (40u)
108 #else
109 #error TMR is not ported for this processor
110 #endif
111 
114 /* Since the RGB typedef is a superset of the GP typedef, treat the GP timers as RGB timers and restrict top register access */
115 #if defined(__ADUCM302x__)
116 static ADI_TMR_TypeDef * adi_tmr_registers[ADI_TMR_DEVICE_NUM] = {pADI_TMR0, pADI_TMR1, pADI_TMR2};
117 #elif defined(__ADUCM4x50__)
118 static ADI_TMR_RGB_TypeDef * adi_tmr_registers[ADI_TMR_DEVICE_NUM] = {(ADI_TMR_RGB_TypeDef *) pADI_TMR0, (ADI_TMR_RGB_TypeDef *) pADI_TMR1, (ADI_TMR_RGB_TypeDef *) pADI_TMR2, pADI_TMR_RGB};
119 #else
120 #error TMR is not ported for this processor
121 #endif
122 
123 /* Interrupt enums */
124 #if defined(__ADUCM302x__)
125 static const IRQn_Type adi_tmr_interrupt[ADI_TMR_DEVICE_NUM] = {TMR0_EVT_IRQn, TMR1_EVT_IRQn, TMR2_EVT_IRQn};
126 #elif defined(__ADUCM4x50__)
127 static const IRQn_Type adi_tmr_interrupt[ADI_TMR_DEVICE_NUM] = {TMR0_EVT_IRQn, TMR1_EVT_IRQn, TMR2_EVT_IRQn, TMR_RGB_EVT_IRQn};
128 #else
129 #error TMR is not ported for this processor
130 #endif
131 
132 /* Private data that the driver needs to retain between function calls */
133 static ADI_CALLBACK adi_tmr_callbacks[ADI_TMR_DEVICE_NUM];
134 static void * adi_tmr_parameters[ADI_TMR_DEVICE_NUM];
135 
136 static ADI_TMR_RESULT WaitForStatusBit (ADI_TMR_DEVICE const eDevice, uint16_t nBusyBit);
137 static void CommonIntHandler (ADI_TMR_DEVICE const eDevice);
138  void GP_Tmr0_Int_Handler(void);
139  void GP_Tmr1_Int_Handler(void);
140  void GP_Tmr2_Int_Handler(void);
141 #if defined(__ADUCM4x50__)
142  void RGB_Tmr_Int_Handler(void);
143 #endif
144 
148 /*********************************************************************************
149  API IMPLEMENTATIONS
150 *********************************************************************************/
151 
152 
175 ADI_TMR_RESULT adi_tmr_Init(ADI_TMR_DEVICE const eDevice, ADI_CALLBACK const pfCallback, void * const pCBParam, bool bEnableInt) {
176 #ifdef ADI_DEBUG
177  /* IF(Bad device input parameter) */
178  if (eDevice >= ADI_TMR_DEVICE_NUM) {
179  return ADI_TMR_BAD_DEVICE_NUM;
180  } /* ENDIF */
181  /* IF(The timer is already running) */
182  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
184  } /* ENDIF */
185 #endif
186  /* Setup the callback function */
187  adi_tmr_callbacks [eDevice] = pfCallback;
188  adi_tmr_parameters[eDevice] = pCBParam;
189 
190  /* IF(Enable interrupt) */
191  if (bEnableInt == true) {
192  NVIC_EnableIRQ(adi_tmr_interrupt[eDevice]);
193  /* ELSE(Disable interrupt) */
194  } else {
195  NVIC_DisableIRQ(adi_tmr_interrupt[eDevice]);
196  } /* ENDIF */
197 
198  /* Static configuration */
199  adi_tmr_registers[eDevice]->CTL = aTimerCtlConfig [eDevice];
200  adi_tmr_registers[eDevice]->LOAD = aTimerLoadConfig [eDevice];
201  adi_tmr_registers[eDevice]->ALOAD = aTimerALoadConfig [eDevice];
202  adi_tmr_registers[eDevice]->PWM0CTL = aTimerPwmCtlConfig [eDevice];
203  adi_tmr_registers[eDevice]->PWM0MATCH = aTimerPwmMatchConfig[eDevice];
204 #if defined(__ADUCM4x50__)
205  adi_tmr_registers[eDevice]->EVENTSELECT = aTimerEventConfig [eDevice];
206 
207  /* IF(Initializing the RGB timer, there are 2 other PWM outputs to configure) */
208  if (eDevice == ADI_TMR_DEVICE_RGB) {
209  /* The array is bumped by 1 to get to the 5th entry in the static config array, which contains RGB PWM1 */
210  adi_tmr_registers[eDevice]->PWM1CTL = aTimerPwmCtlConfig [eDevice+1u];
211  adi_tmr_registers[eDevice]->PWM1MATCH = aTimerPwmMatchConfig[eDevice+1u];
212  /* The array is bumped by 2 to get to the 6th entry in the static config array, which contains RGB PWM2 */
213  adi_tmr_registers[eDevice]->PWM2CTL = aTimerPwmCtlConfig [eDevice+2u];
214  adi_tmr_registers[eDevice]->PWM2MATCH = aTimerPwmMatchConfig[eDevice+2u];
215  } /* ENDIF */
216 #endif /*__ADUCM4x50__*/
217 
218  return ADI_TMR_SUCCESS;
219 }
220 
221 
242  uint16_t nTemp;
243 #ifdef ADI_DEBUG
244  /* IF(Bad device input parameter) */
245  if (eDevice >= ADI_TMR_DEVICE_NUM) {
246  return ADI_TMR_BAD_DEVICE_NUM;
247  } /* ENDIF */
248  /* IF(Bad configuration, cannot enable reloading while in free running mode) */
249  if ((timerConfig->bPeriodic == false) && (timerConfig->bReloading == true)) {
251  } /* ENDIF */
252  /* IF(The timer is already running) */
253  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
255  } /* ENDIF */
256 #endif
257  /* Set the load registers */
258  adi_tmr_registers[eDevice]->LOAD = timerConfig->nLoad;
259  adi_tmr_registers[eDevice]->ALOAD = timerConfig->nAsyncLoad;
260 
261  /* IF(Busy bit does not clear after waiting) */
262  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
263  return ADI_TMR_DEVICE_BUSY;
264  } /* ENDIF */
265 
266  /* Read the control register and clear everything aside to the event capture bits, which are the only fields not set in this function */
267  nTemp = adi_tmr_registers[eDevice]->CTL;
268  nTemp &= (uint16_t) (BITM_TMR_RGB_CTL_EVTEN | BITM_TMR_RGB_CTL_RSTEN );
269 
270  /* Setup the prescaler and the clock source */
271  nTemp |= (uint16_t)(((uint16_t) timerConfig->ePrescaler ) << BITP_TMR_RGB_CTL_PRE);
272  nTemp |= (uint16_t)(((uint16_t) timerConfig->eClockSource) << BITP_TMR_RGB_CTL_CLK);
273 
274  /* IF(Periodic mode) */
275  if (timerConfig->bPeriodic == true) {
276  nTemp |= (1u << BITP_TMR_RGB_CTL_MODE);
277  } /* ENDIF */
278 
279  /* IF(Counting up) */
280  if (timerConfig->bCountingUp == true) {
281  nTemp |= (1u << BITP_TMR_RGB_CTL_UP);
282  } /* ENDIF */
283 
284  /* IF(Reloading is enabled) */
285  if (timerConfig->bReloading == true) {
286  nTemp |= (1u << BITP_TMR_RGB_CTL_RLD);
287  } /* ENDIF */
288 
289  /* IF(Sync bypass is enabled) */
290  if (timerConfig->bSyncBypass == true) {
291  nTemp |= (1u << BITP_TMR_RGB_CTL_SYNCBYP);
292  } /* ENDIF */
293 
294  /* Update the control register with the new configuration */
295  adi_tmr_registers[eDevice]->CTL = nTemp;
296 
297  return ADI_TMR_SUCCESS;
298 }
299 
300 
324 #ifdef ADI_DEBUG
325  /* IF(Bad device input parameter) */
326  if (eDevice >= ADI_TMR_DEVICE_NUM) {
327  return ADI_TMR_BAD_DEVICE_NUM;
328  } /* ENDIF */
329  /* IF(Bad event input parameter) */
330  if (eventConfig->nEventID >= ADI_TMR_NUM_EVENTS) {
331  return ADI_TMR_BAD_EVENT_ID;
332  } /* ENDIF */
333  /* IF(The timer is already running) */
334  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
336  } /* ENDIF */
337 #endif
338 
339 #if defined(__ADUCM4x50__)
340  /* Set the event number */
341  adi_tmr_registers[eDevice]->EVENTSELECT = (uint16_t) eventConfig->nEventID;
342 #endif
343 
344  /* IF(Busy bit does not clear after waiting) */
345  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
346  return ADI_TMR_DEVICE_BUSY;
347  } /* ENDIF */
348 
349  /* Clear the event enable bit and keep the other bits */
350  adi_tmr_registers[eDevice]->CTL &= (uint16_t) ~(BITM_TMR_RGB_CTL_EVTEN | BITM_TMR_RGB_CTL_RSTEN );
351 
352  /* IF(Turning event capture on) */
353  if (eventConfig->bEnable == true) {
354  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_EVTEN;
355  } /* ENDIF */
356 
357  /* IF(Enabling reset on event capture) */
358  if (eventConfig->bPrescaleReset == true) {
359  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_RSTEN;
360  } /* ENDIF */
361 
362 #if defined(__ADUCM302x__)
363  /* Write the event index */
364  adi_tmr_registers[eDevice]->CTL |= (uint16_t) (((uint16_t) eventConfig->nEventID) << BITP_TMR_CTL_EVTRANGE);
365 #endif
366 
367  return ADI_TMR_SUCCESS;
368 }
369 
370 
395  uint16_t nControl = 0u;
396 #ifdef ADI_DEBUG
397  /* IF(Bad device input parameter) */
398  if (eDevice >= ADI_TMR_DEVICE_NUM) {
399  return ADI_TMR_BAD_DEVICE_NUM;
400  } /* ENDIF */
401  /* IF(The timer is already running) */
402  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
404  } /* ENDIF */
405 #if defined(__ADUCM4x50__)
406  /* IF(Bad PWM output and device combo OR bad PWM output) */
407  if (((eDevice != ADI_TMR_DEVICE_RGB) && (pwmConfig->eOutput != ADI_TMR_PWM_OUTPUT_0)) || (pwmConfig->eOutput >= ADI_TMR_PWM_OUTPUT_NUM)) {
408  return ADI_TMR_BAD_PWM_NUM;
409  } /* ENDIF */
410 #endif
411 #endif
412  /* IF(Idle high is set) */
413  if (pwmConfig->bIdleHigh == true) {
414  nControl = (1u << ((uint16_t) BITP_TMR_RGB_PWM0CTL_IDLESTATE));
415  } /* ENDIF */
416 
417  /* IF(Match mode is enabled) */
418  if (pwmConfig->bMatch == true) {
419  nControl |= (1u << ((uint16_t) BITP_TMR_RGB_PWM0CTL_MATCH));
420  } /* ENDIF */
421 
422  /* IF(PWM output 0) */
423  if (pwmConfig->eOutput == ADI_TMR_PWM_OUTPUT_0) {
424  adi_tmr_registers[eDevice]->PWM0CTL = nControl;
425  adi_tmr_registers[eDevice]->PWM0MATCH = pwmConfig->nMatchValue;
426  }
427 #if defined(__ADUCM4x50__)
428  /* IF(PWM output 1) */
429  else if (pwmConfig->eOutput == ADI_TMR_PWM_OUTPUT_1) {
430  adi_tmr_registers[eDevice]->PWM1CTL = nControl;
431  adi_tmr_registers[eDevice]->PWM1MATCH = pwmConfig->nMatchValue;
432  /* ELSE(PWM output 2) */
433  } else {
434  adi_tmr_registers[eDevice]->PWM2CTL = nControl;
435  adi_tmr_registers[eDevice]->PWM2MATCH = pwmConfig->nMatchValue;
436  } /* ENDIF */
437 #endif
438  return ADI_TMR_SUCCESS;
439 }
440 
441 
457 ADI_TMR_RESULT adi_tmr_Enable(ADI_TMR_DEVICE const eDevice, bool bEnable) {
458 #ifdef ADI_DEBUG
459  /* IF(Bad device input parameter) */
460  if (eDevice >= ADI_TMR_DEVICE_NUM) {
461  return ADI_TMR_BAD_DEVICE_NUM;
462  } /* ENDIF */
463 #endif
464  /* IF(Busy bit does not clear after waiting) */
465  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
466  return ADI_TMR_DEVICE_BUSY;
467  } /* ENDIF */
468 
469  /* Clear the enable bit and keep the other bits */
470  adi_tmr_registers[eDevice]->CTL &= (uint16_t) ~BITM_TMR_RGB_CTL_EN;
471 
472  /* IF(Turning the timer on) */
473  if (bEnable == true) {
474  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_EN;
475  } /* ENDIF */
476 
477  return ADI_TMR_SUCCESS;
478 }
479 
480 
496 ADI_TMR_RESULT adi_tmr_GetCurrentCount(ADI_TMR_DEVICE const eDevice, uint16_t *pCount) {
497 #ifdef ADI_DEBUG
498  /* IF(Bad device input parameter) */
499  if (eDevice >= ADI_TMR_DEVICE_NUM) {
500  return ADI_TMR_BAD_DEVICE_NUM;
501  } /* ENDIF */
502  /* IF(Null pointer) */
503  if (pCount == NULL) {
504  return ADI_TMR_NULL_POINTER;
505  } /* ENDIF */
506 #endif
507  *pCount = adi_tmr_registers[eDevice]->CURCNT;
508  return ADI_TMR_SUCCESS;
509 }
510 
511 
528 ADI_TMR_RESULT adi_tmr_GetCaptureCount(ADI_TMR_DEVICE const eDevice, uint16_t *pCount) {
529 #ifdef ADI_DEBUG
530  /* IF(Bad device input parameter) */
531  if (eDevice >= ADI_TMR_DEVICE_NUM) {
532  return ADI_TMR_BAD_DEVICE_NUM;
533  } /* ENDIF */
534  /* IF(Null pointer) */
535  if (pCount == NULL) {
536  return ADI_TMR_NULL_POINTER;
537  } /* ENDIF */
538 #endif
539  *pCount = adi_tmr_registers[eDevice]->CAPTURE;
540  return ADI_TMR_SUCCESS;
541 }
542 
543 
561 #ifdef ADI_DEBUG
562  /* IF(Bad device input parameter) */
563  if (eDevice >= ADI_TMR_DEVICE_NUM) {
564  return ADI_TMR_BAD_DEVICE_NUM;
565  } /* ENDIF */
566  /* IF(Reloading has not been enabled) */
567  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_RLD) != BITM_TMR_RGB_CTL_RLD) {
569  } /* ENDIF */
570 #endif
571  /* Clear the timeout bit to cause a reload to happen */
572  adi_tmr_registers[eDevice]->CLRINT = BITM_TMR_RGB_CLRINT_TIMEOUT;
573  /* IF(The clear interrupt does not take effect in a reasonable amount of time) */
574  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_PDOK)) {
575  return ADI_TMR_DEVICE_BUSY;
576  } /* ENDIF */
577  return ADI_TMR_SUCCESS;
578 }
579 
580 
581 /*********************************************************************************
582  PRIVATE FUNCTIONS
583 *********************************************************************************/
584 
587 static ADI_TMR_RESULT WaitForStatusBit(ADI_TMR_DEVICE const eDevice, uint16_t nBusyBit) {
588  /* FOR(Number of arbitrary iterations) */
589  for (uint16_t i = 0u; i < 1000u; i++) {
590  /* IF(Busy bit is low) */
591  if ((adi_tmr_registers[(eDevice)]->STAT & nBusyBit) == ((uint16_t) 0u)) {
592  return ADI_TMR_SUCCESS;
593  } /* ENDIF */
594  } /* ENDFOR */
595  return ADI_TMR_DEVICE_BUSY;
596 }
597 
598 static void CommonIntHandler(ADI_TMR_DEVICE const eDevice) {
599  /* Read status register */
600  uint16_t IntStatus = adi_tmr_registers[eDevice]->STAT;
601  /* IF(Callback function has been set) */
602  if(adi_tmr_callbacks[eDevice] != NULL) {
603  /* IF(Timeout interrupt occurred) */
604  if((IntStatus & ((uint16_t) BITM_TMR_RGB_STAT_TIMEOUT)) != ((uint16_t) 0u)) {
605  adi_tmr_callbacks[eDevice](adi_tmr_parameters[eDevice], ADI_TMR_EVENT_TIMEOUT, NULL);
606  } /* ENDIF */
607  /* IF(Event capture interrupt occurred) */
608  if((IntStatus & ((uint16_t) BITM_TMR_RGB_STAT_CAPTURE)) != ((uint16_t) 0u)) {
609  adi_tmr_callbacks[eDevice](adi_tmr_parameters[eDevice], ADI_TMR_EVENT_CAPTURE, NULL);
610  } /* ENDIF */
611  } /* ENDIF */
612  /* Clear pending interrupt */
613  adi_tmr_registers[eDevice]->CLRINT = (BITM_TMR_RGB_CLRINT_EVTCAPT | BITM_TMR_RGB_CLRINT_TIMEOUT);
614 }
615 
616 void GP_Tmr0_Int_Handler(void) {
617  ISR_PROLOG()
618  CommonIntHandler(ADI_TMR_DEVICE_GP0);
619  ISR_EPILOG()
620 }
621 
622 void GP_Tmr1_Int_Handler(void) {
623  ISR_PROLOG()
624  CommonIntHandler(ADI_TMR_DEVICE_GP1);
625  ISR_EPILOG()
626 }
627 
628 void GP_Tmr2_Int_Handler(void) {
629  ISR_PROLOG()
630  CommonIntHandler(ADI_TMR_DEVICE_GP2);
631  ISR_EPILOG()
632 }
633 
634 #if defined(__ADUCM4x50__)
635 void RGB_Tmr_Int_Handler(void) {
636  ISR_PROLOG()
637  CommonIntHandler(ADI_TMR_DEVICE_RGB);
638  ISR_EPILOG()
639 }
640 #endif
641 
ADI_TMR_PRESCALER ePrescaler
Definition: adi_tmr.h:192
ADI_TMR_PWM_OUTPUT eOutput
Definition: adi_tmr.h:228
ADI_TMR_RESULT adi_tmr_Enable(ADI_TMR_DEVICE const eDevice, bool bEnable)
Enable or Disable the GP or RGB Timer.
Definition: adi_tmr.c:457
ADI_TMR_RESULT adi_tmr_GetCaptureCount(ADI_TMR_DEVICE const eDevice, uint16_t *pCount)
Get GP or RGB Timer Captured Count.
Definition: adi_tmr.c:528
bool bCountingUp
Definition: adi_tmr.h:188
ADI_TMR_RESULT
Definition: adi_tmr.h:72
bool bPeriodic
Definition: adi_tmr.h:190
uint16_t nMatchValue
Definition: adi_tmr.h:234
ADI_TMR_RESULT adi_tmr_Init(ADI_TMR_DEVICE const eDevice, ADI_CALLBACK const pfCallback, void *const pCBParam, bool bEnableInt)
Initialize GP or RGB Timer.
Definition: adi_tmr.c:175
uint16_t nAsyncLoad
Definition: adi_tmr.h:198
ADI_TMR_DEVICE
Definition: adi_tmr.h:98
uint16_t nLoad
Definition: adi_tmr.h:196
ADI_TMR_CLOCK_SOURCE eClockSource
Definition: adi_tmr.h:194
ADI_TMR_RESULT adi_tmr_ConfigPwm(ADI_TMR_DEVICE const eDevice, ADI_TMR_PWM_CONFIG *pwmConfig)
Setup GP or RGB Timer Pulse Width Modulation.
Definition: adi_tmr.c:394
bool bReloading
Definition: adi_tmr.h:200
bool bSyncBypass
Definition: adi_tmr.h:202
ADI_TMR_RESULT adi_tmr_ConfigTimer(ADI_TMR_DEVICE const eDevice, ADI_TMR_CONFIG *timerConfig)
Configure GP or RGB Timer.
Definition: adi_tmr.c:241
#define ADI_TMR_NUM_EVENTS
Definition: adi_tmr.c:105
ADI_TMR_RESULT adi_tmr_Reload(ADI_TMR_DEVICE const eDevice)
Reload GP or RGB Timer.
Definition: adi_tmr.c:560
ADI_TMR_RESULT adi_tmr_ConfigEvent(ADI_TMR_DEVICE const eDevice, ADI_TMR_EVENT_CONFIG *eventConfig)
Setup GP or RGB Timer Event Capture.
Definition: adi_tmr.c:323
ADI_TMR_RESULT adi_tmr_GetCurrentCount(ADI_TMR_DEVICE const eDevice, uint16_t *pCount)
Get GP or RGB Timer Current Count.
Definition: adi_tmr.c:496