ADuCM4x50 Device Drivers API Reference Manual  Release 4.0.0.0
adi_cyclecount.h
1 
15 #ifndef ADI_CYCLECOUNT_H
16 #define ADI_CYCLECOUNT_H
17 
18 #include <stdbool.h>
19 #include <stdint.h>
20 #include <adi_cycle_counting_config.h>
21 
22 
34 typedef uint64_t adi_cyclecount_t;
35 
36 
43 #define ADI_CYCLECOUNT_SYSTICKS (0xFFFFFFu)
44 
50 #define ADI_CYCLECOUNT_INITIAL_STACK_INDEX (-1)
51 
55 typedef enum {
56 
62 
63 
72 #define ADI_CYCLECOUNT_ISR_EXT_3 1u
73 #define ADI_CYCLECOUNT_ISR_UART 2u
74 #define ADI_CYCLECOUNT_ISR_DMA_UART_TX 3u
75 #define ADI_CYCLECOUNT_ISR_DMA_UART_RX 4u
76 #define ADI_CYCLECOUNT_ISR_TMR_COMMON 5u
77 #define ADI_CYCLECOUNT_ISR_RTC 6u
78 #define ADI_CYCLECOUNT_ISR_SPI 7u
79 #define ADI_CYCLECOUNT_ISR_CRC 8u
80 #define ADI_CYCLECOUNT_ISR_SPORT 9u
81 #define ADI_CYCLECOUNT_ID_COUNT 10u
90 typedef struct
91 {
100  uint32_t sample_count;
103 
109 #if defined(ADI_CYCLECOUNT_ENABLED) && (ADI_CYCLECOUNT_ENABLED == 1u)
110 
111  #define ADI_CYCLECOUNT_INITIALIZE() adi_cyclecount_init()
112  #define ADI_CYCLECOUNT_STORE(id) adi_cyclecount_store(id)
113  #define ADI_CYCLECOUNT_REPORT() adi_cyclecount_report()
115 #else
116 
117  #define ADI_CYCLECOUNT_INITIALIZE() do{}while(0)
118  #define ADI_CYCLECOUNT_STORE(id) do{}while(0)
119  #define ADI_CYCLECOUNT_REPORT() do{}while(0)
120 #endif
121 
122 
123 /* Forward API declarations */
127 extern ADI_CYCLECOUNT_RESULT adi_cyclecount_store(uint32_t id);
128 extern void adi_cyclecount_init(void);
129 extern void adi_cyclecount_report(void);
130 extern ADI_CYCLECOUNT_RESULT adi_cyclecount_addEntity(const char *EntityName, uint32_t *pid);
131 
132 extern void SysTick_Handler(void);
133 
136 #endif /* ADI_CYCLECOUNT_H */
137 
ADI_CYCLECOUNT_RESULT adi_cyclecount_store(uint32_t id)
Store Cycle Count.
adi_cyclecount_t average_cycles_unadjusted
void adi_cyclecount_report(void)
Generate a cycle count report.
uint64_t adi_cyclecount_t
void SysTick_Handler(void)
adi_cyclecount_t average_cycles_adjusted
adi_cyclecount_t adi_cyclecount_get(void)
Read the current number of cycle counts.
ADI_CYCLECOUNT_RESULT adi_cyclecount_start(void)
API to be called to start a new cycle counting context.
ADI_CYCLECOUNT_RESULT
adi_cyclecount_t max_cycles_adjusted
ADI_CYCLECOUNT_RESULT adi_cyclecount_addEntity(const char *EntityName, uint32_t *pid)
Add an ISR/API to the cycle counting list.
adi_cyclecount_t max_cycles_unadjusted
ADI_CYCLECOUNT_RESULT adi_cyclecount_stop(void)
Cycle Count Stop.
void adi_cyclecount_init(void)
API to be called to initialize the cycle counting framework.
adi_cyclecount_t min_cycles_adjusted
adi_cyclecount_t min_cycles_unadjusted