[update] 增加获取cortex-a generic timer频率接口

This commit is contained in:
zhouji 2021-05-05 23:13:10 +08:00 committed by zhouji
parent 1523e4680d
commit ffe8d06bd3
2 changed files with 9 additions and 0 deletions

View File

@ -110,6 +110,14 @@ void gtimer_set_counter_frequency(rt_uint32_t value)
__asm__ volatile ("isb 0xF":::"memory");
}
/** Get the frequency the timer shall run at.
* return timer frequency in Hz.
*/
rt_uint32_t gtimer_get_counter_frequency(void)
{
return(__get_cntfrq());
}
/** Sets the reset value of the timer.
* param value: The value the timer is loaded with.
*/

View File

@ -14,6 +14,7 @@
#include <rtdef.h>
void gtimer_set_counter_frequency(rt_uint32_t value);
rt_uint32_t gtimer_get_counter_frequency(void);
void gtimer_set_load_value(rt_uint32_t value);
rt_uint32_t gtimer_get_current_value(void);
rt_uint64_t gtimer_get_current_physical_value(void);