ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
adi_tmr.c
1 
14 #ifdef __ICCARM__
15 /*
16 * IAR MISRA C 2004 error suppressions.
17 *
18 * Pm011 (rule 6.3): the basic types of char, int, short, long, float, and double should not be used
19 * Necessary for stdbool.
20 *
21 * Pm073 (rule 14.7): a function should have a single point of exit
22 * Pm143 (rule 14.7): a function should have a single point of exit at the end of the function
23 * Multiple returns are used for error handling.
24 *
25 * Pm123 (rule 8.5): there shall be no definition of objects or functions in a header file
26 * Static configuration data file is included.
27 *
28 * Pm140 (Rule 11.4): a cast should not be performed between a pointer type and an integral type
29 * This violation appears when deferencing the pointer to the register typedef. No way around this.
30 *
31 * Pm141 (Rule 11.4): a cast should not be performed between a pointer to object type and a different pointer to object type
32 * The pointer casting is necessary to allow the GP and RGB timers to abstracted into one driver. This has been approved by the PO.
33 */
34 #pragma diag_suppress=Pm011,Pm073,Pm123,Pm140,Pm141,Pm143
35 #endif /* __ICCARM__ */
36 
37 
47 #include <adi_processor.h>
48 #include <adi_tmr_config.h>
49 #include <rtos_map/adi_rtos_map.h>
50 #include <drivers/tmr/adi_tmr.h>
51 
52 /* Static configuration data */
53 #include "adi_tmr_data.c"
54 
55 #if defined(__ADUCM4x50__)
56 /* 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. */
57 #if BITP_TMR_RGB_PWM0CTL_IDLESTATE != BITP_TMR_RGB_PWM1CTL_IDLESTATE
58 #error "Bit positions for PWM0 and PWM1 do not match. Fix adi_tmr_ConfigPwm."
59 #endif
60 #if BITP_TMR_RGB_PWM0CTL_IDLESTATE != BITP_TMR_RGB_PWM2CTL_IDLESTATE
61 #error "Bit positions for PWM0 and PWM2 do not match. Fix adi_tmr_ConfigPwm."
62 #endif
63 #if BITP_TMR_RGB_PWM0CTL_MATCH != BITP_TMR_RGB_PWM1CTL_MATCH
64 #error "Bit positions for PWM0 and PWM1 do not match. Fix adi_tmr_ConfigPwm."
65 #endif
66 #if BITP_TMR_RGB_PWM0CTL_MATCH != BITP_TMR_RGB_PWM2CTL_MATCH
67 #error "Bit positions for PWM0 and PWM2 do not match. Fix adi_tmr_ConfigPwm."
68 #endif
69 #endif /*__ADUCM4x50__*/
70 
72 #if defined(__ADUCM302x__)
73 #define ADI_TMR_NUM_EVENTS (16u)
74 #elif defined(__ADUCM4x50__)
75 #define ADI_TMR_NUM_EVENTS (40u)
76 #else
77 #error TMR is not ported for this processor
78 #endif
79 
82 /* Since the RGB typedef is a superset of the GP typedef, treat the GP timers as RGB timers and restrict top register access */
83 #if defined(__ADUCM302x__)
84 static ADI_TMR_TypeDef * adi_tmr_registers[ADI_TMR_DEVICE_NUM] = {pADI_TMR0, pADI_TMR1, pADI_TMR2};
85 #elif defined(__ADUCM4x50__)
86 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};
87 #else
88 #error TMR is not ported for this processor
89 #endif
90 
91 /* Interrupt enums */
92 #if defined(__ADUCM302x__)
93 static const IRQn_Type adi_tmr_interrupt[ADI_TMR_DEVICE_NUM] = {TMR0_EVT_IRQn, TMR1_EVT_IRQn, TMR2_EVT_IRQn};
94 #elif defined(__ADUCM4x50__)
95 static const IRQn_Type adi_tmr_interrupt[ADI_TMR_DEVICE_NUM] = {TMR0_EVT_IRQn, TMR1_EVT_IRQn, TMR2_EVT_IRQn, TMR_RGB_EVT_IRQn};
96 #else
97 #error TMR is not ported for this processor
98 #endif
99 
100 /* Private data that the driver needs to retain between function calls */
101 static ADI_CALLBACK adi_tmr_callbacks[ADI_TMR_DEVICE_NUM];
102 static void * adi_tmr_parameters[ADI_TMR_DEVICE_NUM];
103 
104 static ADI_TMR_RESULT WaitForStatusBit (ADI_TMR_DEVICE const eDevice, uint16_t nBusyBit);
105 static void CommonIntHandler (ADI_TMR_DEVICE const eDevice);
106  void GP_Tmr0_Int_Handler(void);
107  void GP_Tmr1_Int_Handler(void);
108  void GP_Tmr2_Int_Handler(void);
109 #if defined(__ADUCM4x50__)
110  void RGB_Tmr_Int_Handler(void);
111 #endif
112 
116 /*********************************************************************************
117  API IMPLEMENTATIONS
118 *********************************************************************************/
119 
120 
143 ADI_TMR_RESULT adi_tmr_Init(ADI_TMR_DEVICE const eDevice, ADI_CALLBACK const pfCallback, void * const pCBParam, bool bEnableInt) {
144 #ifdef ADI_DEBUG
145  /* IF(Bad device input parameter) */
146  if (eDevice >= ADI_TMR_DEVICE_NUM) {
147  return ADI_TMR_BAD_DEVICE_NUM;
148  } /* ENDIF */
149  /* IF(The timer is already running) */
150  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
152  } /* ENDIF */
153 #endif
154  /* Setup the callback function */
155  adi_tmr_callbacks [eDevice] = pfCallback;
156  adi_tmr_parameters[eDevice] = pCBParam;
157 
158  /* IF(Enable interrupt) */
159  if (bEnableInt == true) {
160  NVIC_EnableIRQ(adi_tmr_interrupt[eDevice]);
161  /* ELSE(Disable interrupt) */
162  } else {
163  NVIC_DisableIRQ(adi_tmr_interrupt[eDevice]);
164  } /* ENDIF */
165 
166  /* Static configuration */
167  adi_tmr_registers[eDevice]->CTL = aTimerCtlConfig [eDevice];
168  adi_tmr_registers[eDevice]->LOAD = aTimerLoadConfig [eDevice];
169  adi_tmr_registers[eDevice]->ALOAD = aTimerALoadConfig [eDevice];
170  adi_tmr_registers[eDevice]->PWM0CTL = aTimerPwmCtlConfig [eDevice];
171  adi_tmr_registers[eDevice]->PWM0MATCH = aTimerPwmMatchConfig[eDevice];
172 #if defined(__ADUCM4x50__)
173  adi_tmr_registers[eDevice]->EVENTSELECT = aTimerEventConfig [eDevice];
174 
175  /* IF(Initializing the RGB timer, there are 2 other PWM outputs to configure) */
176  if (eDevice == ADI_TMR_DEVICE_RGB) {
177  /* The array is bumped by 1 to get to the 5th entry in the static config array, which contains RGB PWM1 */
178  adi_tmr_registers[eDevice]->PWM1CTL = aTimerPwmCtlConfig [eDevice+1u];
179  adi_tmr_registers[eDevice]->PWM1MATCH = aTimerPwmMatchConfig[eDevice+1u];
180  /* The array is bumped by 2 to get to the 6th entry in the static config array, which contains RGB PWM2 */
181  adi_tmr_registers[eDevice]->PWM2CTL = aTimerPwmCtlConfig [eDevice+2u];
182  adi_tmr_registers[eDevice]->PWM2MATCH = aTimerPwmMatchConfig[eDevice+2u];
183  } /* ENDIF */
184 #endif /*__ADUCM4x50__*/
185 
186  return ADI_TMR_SUCCESS;
187 }
188 
189 
210  uint16_t nTemp;
211 #ifdef ADI_DEBUG
212  /* IF(Bad device input parameter) */
213  if (eDevice >= ADI_TMR_DEVICE_NUM) {
214  return ADI_TMR_BAD_DEVICE_NUM;
215  } /* ENDIF */
216  /* IF(Bad configuration, cannot enable reloading while in free running mode) */
217  if ((timerConfig->bPeriodic == false) && (timerConfig->bReloading == true)) {
219  } /* ENDIF */
220  /* IF(The timer is already running) */
221  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
223  } /* ENDIF */
224 #endif
225  /* Set the load registers */
226  adi_tmr_registers[eDevice]->LOAD = timerConfig->nLoad;
227  adi_tmr_registers[eDevice]->ALOAD = timerConfig->nAsyncLoad;
228 
229  /* IF(Busy bit does not clear after waiting) */
230  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
231  return ADI_TMR_DEVICE_BUSY;
232  } /* ENDIF */
233 
234  /* Read the control register and clear everything aside to the event capture bits, which are the only fields not set in this function */
235  nTemp = adi_tmr_registers[eDevice]->CTL;
236  nTemp &= (uint16_t) (BITM_TMR_RGB_CTL_EVTEN | BITM_TMR_RGB_CTL_RSTEN );
237 
238  /* Setup the prescaler and the clock source */
239  nTemp |= (uint16_t)(((uint16_t) timerConfig->ePrescaler ) << BITP_TMR_RGB_CTL_PRE);
240  nTemp |= (uint16_t)(((uint16_t) timerConfig->eClockSource) << BITP_TMR_RGB_CTL_CLK);
241 
242  /* IF(Periodic mode) */
243  if (timerConfig->bPeriodic == true) {
244  nTemp |= (1u << BITP_TMR_RGB_CTL_MODE);
245  } /* ENDIF */
246 
247  /* IF(Counting up) */
248  if (timerConfig->bCountingUp == true) {
249  nTemp |= (1u << BITP_TMR_RGB_CTL_UP);
250  } /* ENDIF */
251 
252  /* IF(Reloading is enabled) */
253  if (timerConfig->bReloading == true) {
254  nTemp |= (1u << BITP_TMR_RGB_CTL_RLD);
255  } /* ENDIF */
256 
257  /* IF(Sync bypass is enabled) */
258  if (timerConfig->bSyncBypass == true) {
259  nTemp |= (1u << BITP_TMR_RGB_CTL_SYNCBYP);
260  } /* ENDIF */
261 
262  /* Update the control register with the new configuration */
263  adi_tmr_registers[eDevice]->CTL = nTemp;
264 
265  return ADI_TMR_SUCCESS;
266 }
267 
268 
292 #ifdef ADI_DEBUG
293  /* IF(Bad device input parameter) */
294  if (eDevice >= ADI_TMR_DEVICE_NUM) {
295  return ADI_TMR_BAD_DEVICE_NUM;
296  } /* ENDIF */
297  /* IF(Bad event input parameter) */
298  if (eventConfig->nEventID >= ADI_TMR_NUM_EVENTS) {
299  return ADI_TMR_BAD_EVENT_ID;
300  } /* ENDIF */
301  /* IF(The timer is already running) */
302  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
304  } /* ENDIF */
305 #endif
306 
307 #if defined(__ADUCM4x50__)
308  /* Set the event number */
309  adi_tmr_registers[eDevice]->EVENTSELECT = (uint16_t) eventConfig->nEventID;
310 #endif
311 
312  /* IF(Busy bit does not clear after waiting) */
313  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
314  return ADI_TMR_DEVICE_BUSY;
315  } /* ENDIF */
316 
317  /* Clear the event enable bit and keep the other bits */
318  adi_tmr_registers[eDevice]->CTL &= (uint16_t) ~(BITM_TMR_RGB_CTL_EVTEN | BITM_TMR_RGB_CTL_RSTEN );
319 
320  /* IF(Turning event capture on) */
321  if (eventConfig->bEnable == true) {
322  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_EVTEN;
323  } /* ENDIF */
324 
325  /* IF(Enabling reset on event capture) */
326  if (eventConfig->bPrescaleReset == true) {
327  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_RSTEN;
328  } /* ENDIF */
329 
330 #if defined(__ADUCM302x__)
331  /* Write the event index */
332  adi_tmr_registers[eDevice]->CTL |= (uint16_t) (((uint16_t) eventConfig->nEventID) << BITP_TMR_CTL_EVTRANGE);
333 #endif
334 
335  return ADI_TMR_SUCCESS;
336 }
337 
338 
363  uint16_t nControl = 0u;
364 #ifdef ADI_DEBUG
365  /* IF(Bad device input parameter) */
366  if (eDevice >= ADI_TMR_DEVICE_NUM) {
367  return ADI_TMR_BAD_DEVICE_NUM;
368  } /* ENDIF */
369  /* IF(The timer is already running) */
370  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_EN) == BITM_TMR_RGB_CTL_EN) {
372  } /* ENDIF */
373 #if defined(__ADUCM4x50__)
374  /* IF(Bad PWM output and device combo OR bad PWM output) */
375  if (((eDevice != ADI_TMR_DEVICE_RGB) && (pwmConfig->eOutput != ADI_TMR_PWM_OUTPUT_0)) || (pwmConfig->eOutput >= ADI_TMR_PWM_OUTPUT_NUM)) {
376  return ADI_TMR_BAD_PWM_NUM;
377  } /* ENDIF */
378 #endif
379 #endif
380  /* IF(Idle high is set) */
381  if (pwmConfig->bIdleHigh == true) {
382  nControl = (1u << ((uint16_t) BITP_TMR_RGB_PWM0CTL_IDLESTATE));
383  } /* ENDIF */
384 
385  /* IF(Match mode is enabled) */
386  if (pwmConfig->bMatch == true) {
387  nControl |= (1u << ((uint16_t) BITP_TMR_RGB_PWM0CTL_MATCH));
388  } /* ENDIF */
389 
390  /* IF(PWM output 0) */
391  if (pwmConfig->eOutput == ADI_TMR_PWM_OUTPUT_0) {
392  adi_tmr_registers[eDevice]->PWM0CTL = nControl;
393  adi_tmr_registers[eDevice]->PWM0MATCH = pwmConfig->nMatchValue;
394  }
395 #if defined(__ADUCM4x50__)
396  /* IF(PWM output 1) */
397  else if (pwmConfig->eOutput == ADI_TMR_PWM_OUTPUT_1) {
398  adi_tmr_registers[eDevice]->PWM1CTL = nControl;
399  adi_tmr_registers[eDevice]->PWM1MATCH = pwmConfig->nMatchValue;
400  /* ELSE(PWM output 2) */
401  } else {
402  adi_tmr_registers[eDevice]->PWM2CTL = nControl;
403  adi_tmr_registers[eDevice]->PWM2MATCH = pwmConfig->nMatchValue;
404  } /* ENDIF */
405 #endif
406  return ADI_TMR_SUCCESS;
407 }
408 
409 
425 ADI_TMR_RESULT adi_tmr_Enable(ADI_TMR_DEVICE const eDevice, bool bEnable) {
426 #ifdef ADI_DEBUG
427  /* IF(Bad device input parameter) */
428  if (eDevice >= ADI_TMR_DEVICE_NUM) {
429  return ADI_TMR_BAD_DEVICE_NUM;
430  } /* ENDIF */
431 #endif
432  /* IF(Busy bit does not clear after waiting) */
433  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_BUSY)) {
434  return ADI_TMR_DEVICE_BUSY;
435  } /* ENDIF */
436 
437  /* Clear the enable bit and keep the other bits */
438  adi_tmr_registers[eDevice]->CTL &= (uint16_t) ~BITM_TMR_RGB_CTL_EN;
439 
440  /* IF(Turning the timer on) */
441  if (bEnable == true) {
442  adi_tmr_registers[eDevice]->CTL |= (uint16_t) BITM_TMR_RGB_CTL_EN;
443  } /* ENDIF */
444 
445  return ADI_TMR_SUCCESS;
446 }
447 
448 
464 ADI_TMR_RESULT adi_tmr_GetCurrentCount(ADI_TMR_DEVICE const eDevice, uint16_t *pCount) {
465 #ifdef ADI_DEBUG
466  /* IF(Bad device input parameter) */
467  if (eDevice >= ADI_TMR_DEVICE_NUM) {
468  return ADI_TMR_BAD_DEVICE_NUM;
469  } /* ENDIF */
470  /* IF(Null pointer) */
471  if (pCount == NULL) {
472  return ADI_TMR_NULL_POINTER;
473  } /* ENDIF */
474 #endif
475  *pCount = adi_tmr_registers[eDevice]->CURCNT;
476  return ADI_TMR_SUCCESS;
477 }
478 
479 
496 ADI_TMR_RESULT adi_tmr_GetCaptureCount(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]->CAPTURE;
508  return ADI_TMR_SUCCESS;
509 }
510 
511 
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(Reloading has not been enabled) */
535  if ((adi_tmr_registers[eDevice]->CTL & BITM_TMR_RGB_CTL_RLD) != BITM_TMR_RGB_CTL_RLD) {
537  } /* ENDIF */
538 #endif
539  /* Clear the timeout bit to cause a reload to happen */
540  adi_tmr_registers[eDevice]->CLRINT = BITM_TMR_RGB_CLRINT_TIMEOUT;
541  /* IF(The clear interrupt does not take effect in a reasonable amount of time) */
542  if (ADI_TMR_SUCCESS != WaitForStatusBit(eDevice, (uint16_t) BITM_TMR_RGB_STAT_PDOK)) {
543  return ADI_TMR_DEVICE_BUSY;
544  } /* ENDIF */
545  return ADI_TMR_SUCCESS;
546 }
547 
548 
549 /*********************************************************************************
550  PRIVATE FUNCTIONS
551 *********************************************************************************/
552 
555 static ADI_TMR_RESULT WaitForStatusBit(ADI_TMR_DEVICE const eDevice, uint16_t nBusyBit) {
556  /* FOR(Number of arbitrary iterations) */
557  for (uint16_t i = 0u; i < 1000u; i++) {
558  /* IF(Busy bit is low) */
559  if ((adi_tmr_registers[(eDevice)]->STAT & nBusyBit) == ((uint16_t) 0u)) {
560  return ADI_TMR_SUCCESS;
561  } /* ENDIF */
562  } /* ENDFOR */
563  return ADI_TMR_DEVICE_BUSY;
564 }
565 
566 static void CommonIntHandler(ADI_TMR_DEVICE const eDevice) {
567  /* Read status register */
568  uint16_t IntStatus = adi_tmr_registers[eDevice]->STAT;
569  /* IF(Callback function has been set) */
570  if(adi_tmr_callbacks[eDevice] != NULL) {
571  /* IF(Timeout interrupt occurred) */
572  if((IntStatus & ((uint16_t) BITM_TMR_RGB_STAT_TIMEOUT)) != ((uint16_t) 0u)) {
573  adi_tmr_callbacks[eDevice](adi_tmr_parameters[eDevice], ADI_TMR_EVENT_TIMEOUT, NULL);
574  } /* ENDIF */
575  /* IF(Event capture interrupt occurred) */
576  if((IntStatus & ((uint16_t) BITM_TMR_RGB_STAT_CAPTURE)) != ((uint16_t) 0u)) {
577  adi_tmr_callbacks[eDevice](adi_tmr_parameters[eDevice], ADI_TMR_EVENT_CAPTURE, NULL);
578  } /* ENDIF */
579  } /* ENDIF */
580  /* Clear pending interrupt */
581  adi_tmr_registers[eDevice]->CLRINT = (BITM_TMR_RGB_CLRINT_EVTCAPT | BITM_TMR_RGB_CLRINT_TIMEOUT);
582 }
583 
584 void GP_Tmr0_Int_Handler(void) {
585  ISR_PROLOG()
586  CommonIntHandler(ADI_TMR_DEVICE_GP0);
587  ISR_EPILOG()
588 }
589 
590 void GP_Tmr1_Int_Handler(void) {
591  ISR_PROLOG()
592  CommonIntHandler(ADI_TMR_DEVICE_GP1);
593  ISR_EPILOG()
594 }
595 
596 void GP_Tmr2_Int_Handler(void) {
597  ISR_PROLOG()
598  CommonIntHandler(ADI_TMR_DEVICE_GP2);
599  ISR_EPILOG()
600 }
601 
602 #if defined(__ADUCM4x50__)
603 void RGB_Tmr_Int_Handler(void) {
604  ISR_PROLOG()
605  CommonIntHandler(ADI_TMR_DEVICE_RGB);
606  ISR_EPILOG()
607 }
608 #endif
609 
ADI_TMR_PRESCALER ePrescaler
Definition: adi_tmr.h:159
ADI_TMR_PWM_OUTPUT eOutput
Definition: adi_tmr.h:195
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:425
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:496
bool bCountingUp
Definition: adi_tmr.h:155
ADI_TMR_RESULT
Definition: adi_tmr.h:39
bool bPeriodic
Definition: adi_tmr.h:157
uint16_t nMatchValue
Definition: adi_tmr.h:201
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:143
uint16_t nAsyncLoad
Definition: adi_tmr.h:165
ADI_TMR_DEVICE
Definition: adi_tmr.h:65
uint16_t nLoad
Definition: adi_tmr.h:163
ADI_TMR_CLOCK_SOURCE eClockSource
Definition: adi_tmr.h:161
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:362
bool bReloading
Definition: adi_tmr.h:167
bool bSyncBypass
Definition: adi_tmr.h:169
ADI_TMR_RESULT adi_tmr_ConfigTimer(ADI_TMR_DEVICE const eDevice, ADI_TMR_CONFIG *timerConfig)
Configure GP or RGB Timer.
Definition: adi_tmr.c:209
#define ADI_TMR_NUM_EVENTS
Definition: adi_tmr.c:75
ADI_TMR_RESULT adi_tmr_Reload(ADI_TMR_DEVICE const eDevice)
Reload GP or RGB Timer.
Definition: adi_tmr.c:528
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:291
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:464