Appiko
|
Driver to use timer for code profiling and time-stamping. More...
Macros | |
#define | PROFILER_TIMER CONCAT_2(NRF_TIMER,TIMER_USED_PROFILE_TIMER) |
#define | PRINT_TIME |
Functions | |
void | profiler_timer_init (void) |
void | printfcomma (uint32_t num) |
uint32_t | read_time_us (void) |
bool | profiler_timer_is_on (void) |
void | profiler_timer_deinit () |
Fully stop the profiling timer to save power. profiler_timer_init needs to be called again before using it. | |
Definitions for marking the beginning and ending of code to profile | |
| |
#define | PROFILE_START do{ PROFILER_TIMER->TASKS_CAPTURE[2] = 1; }while(0) |
#define | PROFILE_STOP |
#define PRINT_TIME |
Print the current time in micro-seconds from the startup (beginning of TIMER0). This is used for time stamping at different parts in the code
Definition at line 52 of file profiler_timer.h.
#define PROFILE_START do{ PROFILER_TIMER->TASKS_CAPTURE[2] = 1; }while(0) |
Point of start of profiling
Definition at line 61 of file profiler_timer.h.
#define PROFILE_STOP |
Point of end of profiling. The time from start is displayed in nano-seconds with an accuracy of 62.5 ns
Definition at line 63 of file profiler_timer.h.
#define PROFILER_TIMER CONCAT_2(NRF_TIMER,TIMER_USED_PROFILE_TIMER) |
Specify which timer would be used for the profiler timer module
Definition at line 47 of file profiler_timer.h.
void printfcomma | ( | uint32_t | num | ) |
Takes in an unsigned integer and prints it with a ',' after every three digits
num | Number to be printed with commas |
Definition at line 45 of file profiler_timer.c.
References printfcomma().
Referenced by printfcomma().
void profiler_timer_init | ( | void | ) |
Initialize the timer to run at 16 MHz and with full 32 bit width
profiler_timer.c : Profiler timer Copyright (C) 2019 Appiko
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Definition at line 21 of file profiler_timer.c.
References PROFILER_TIMER.
Referenced by crystal_test(), and rc_test().
bool profiler_timer_is_on | ( | void | ) |
Check if the profiler timer is already initialized
Definition at line 40 of file profiler_timer.c.
References PROFILER_TIMER.
|
inline |
The time from start-up in micro-seconds
Definition at line 84 of file profiler_timer.h.
References PROFILER_TIMER.
Referenced by rc_test().