ADF7030-1 Device Drivers API Reference Manual  Alpha 0.0.1
Device Drivers for ADF7030-1 Transceiver
adf7030-1__timer.h
1 #ifndef _ADF7030_1__TIMER_H_
2 #define _ADF7030_1__TIMER_H_
3 
13 #include <services/tmr/adi_tmr.h>
14 #include <devices/rf/adf703x/adi_adf7030-1_reg.h>
15 
16 
17 /* Quick fix to compensate for a pclk divided by 4 somewhere */
18 //Somehow the output of timer is 4x the expected value indicating pclk might be divided by 4
19 #define ERROR_COMPENSATION_DIV 4
20 
21 /* Define delay for starting timer */
22 #define ERROR_TON 12
23 
24 /* Define delay for Callback routine */
25 #define ERROR_CB 12
26 
27 /* Define delay for stopping timer */
28 #define ERROR_TOFF 12
29 
30 /* Define global min uS load value */
31 #define TOTAL_TMR_ERROR (ERROR_TON + ERROR_CB + ERROR_TOFF)
32 
33 typedef struct{
34  uint16_t ticks;
35  uint16_t ms;
37 
38 #define WAIT_US(us) { \
39  adf7030_1__TIMER_Wait_uS(us, GPTimer0Callback); \
40  };
41 
42 uint32_t adf7030_1__TIMER_Init
43 (
44  void
45 );
46 
47 uint32_t adf7030_1__TIMER_UnInit
48 (
49  void
50 );
51 
52 uint32_t adf7030_1__TIMER_ClrTime
53 (
55 );
56 
57 uint32_t adf7030_1__TIMER_GetTime
58 (
60 );
61 
62 uint32_t adf7030_1__TIMER_Start_uS
63 (
64  const uint16_t u_sec,
65  ADI_CALLBACK const pfCallback
66 );
67 
68 uint32_t adf7030_1__TIMER_Stop_uS
69 (
70  void
71 );
72 
73 uint32_t adf7030_1__TIMER_Wait_uS
74 (
75  const uint16_t u_sec,
76  ADI_CALLBACK const pfCallback
77 );
78 
79 void GPTimer0Callback
80 (
81  void *pCBParam,
82  uint32_t Event,
83  void *pArg
84 );
85 
86 void GPTimer2Callback
87 (
88  void *pCBParam,
89  uint32_t Event,
90  void *pArg
91 );
92 
94 (
95  const uint16_t delay_us
96 );
97  /* End of group adf7030-1__timer Timers Interface layer */ /* End of group adf7030-1 adf7030-1 Driver */
100 
101 #endif /* _ADF7030_1__TIMER_H_ */
uint32_t adf7030_1__TIMER_Active_Delay_uS(const uint16_t delay_us)
Active wait using NOPs This function loops using NOPs to give short delays.