ClearCore Library
|
ClearCore timing profiling utility functions. More...
#include <stdint.h>
Go to the source code of this file.
Classes | |
class | ClearCore::SysTiming |
ClearCore system timing class. More... | |
Namespaces | |
namespace | ClearCore |
Namespace to encompass the ClearCore board API. | |
Macros | |
#define | CPU_CLK 120000000 |
#define | _CLEARCORE_SAMPLE_RATE_HZ (5000) |
#define | MS_TO_SAMPLES (_CLEARCORE_SAMPLE_RATE_HZ / 1000) |
#define | CYCLES_PER_INTERRUPT (CPU_CLK / _CLEARCORE_SAMPLE_RATE_HZ) |
#define | SAMPLE_PERIOD_MICROSECONDS (1000000UL / _CLEARCORE_SAMPLE_RATE_HZ) |
#define | CYCLES_PER_MICROSECOND (CPU_CLK / 1000000) |
#define | CYCLES_PER_MILLISECOND (CPU_CLK / 1000) |
#define | CYCLES_PER_SECOND (CPU_CLK) |
Functions | |
uint32_t | Milliseconds (void) |
Number of milliseconds since the ClearCore was initialized. | |
uint32_t | Microseconds (void) |
Number of microseconds since the ClearCore was initialized. | |
void | Delay_cycles (uint64_t cycles) |
Blocks for operations cycles CPU cycles. | |
void | Delay_ms (uint32_t ms) |
Blocks operations for ms milliseconds. | |
void | Delay_us (uint32_t usec) |
Blocks for operations usec microseconds. | |
Variables | |
const uint16_t | ClearCore::SampleRateHz = _CLEARCORE_SAMPLE_RATE_HZ |
ClearCore timing profiling utility functions.
#define _CLEARCORE_SAMPLE_RATE_HZ (5000) |
ClearCore sample rate for main interrupt processing (5 kHz).
#define CPU_CLK 120000000 |
Number of CPU cycles, in Hz. (120MHz)
#define CYCLES_PER_INTERRUPT (CPU_CLK / _CLEARCORE_SAMPLE_RATE_HZ) |
Number of CPU cycles per interrupt time (24,000).
#define CYCLES_PER_MICROSECOND (CPU_CLK / 1000000) |
Number of CPU cycles per microsecond (120).
#define CYCLES_PER_MILLISECOND (CPU_CLK / 1000) |
Number of CPU cycles per millisecond (120,000).
#define CYCLES_PER_SECOND (CPU_CLK) |
Number of CPU cycles per second (120,000,000).
#define MS_TO_SAMPLES (_CLEARCORE_SAMPLE_RATE_HZ / 1000) |
ClearCore sample rate, expressed in sample times (5).
#define SAMPLE_PERIOD_MICROSECONDS (1000000UL / _CLEARCORE_SAMPLE_RATE_HZ) |
ClearCore sample time, expressed in microseconds (200us).
void Delay_cycles | ( | uint64_t | cycles | ) |
Blocks for operations cycles CPU cycles.
[in] | cycles | Time in CPU cycles to delay |
|
inline |
Blocks operations for ms milliseconds.
[in] | ms | Time in milliseconds to delay |
|
inline |
Blocks for operations usec microseconds.
[in] | usec | Time in microseconds to delay |
uint32_t Microseconds | ( | void | ) |
Number of microseconds since the ClearCore was initialized.
Uses the processor's cycle counter register to calculate the number of microseconds elapsed.
uint32_t Milliseconds | ( | void | ) |
Number of milliseconds since the ClearCore was initialized.
Uses the fast update interrupt counter to retrieve the number of milliseconds elapsed.