]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/bsp/install/include/metal/timer.h
Base project to replace existing Freedom Studio project using latest Freedom Studio...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_GCC / bsp / install / include / metal / timer.h
1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3
4 #ifndef METAL__TIMER_H
5 #define METAL__TIMER_H
6
7 /*!
8  * @file timer.h
9  * @brief API for reading and manipulating the machine timer
10  */
11
12 /*!
13  * @brief Read the machine cycle count
14  * @param hartid The hart ID to read the cycle count of
15  * @param cyclecount The variable to hold the value
16  * @return 0 upon success
17  */
18 int metal_timer_get_cyclecount(int hartid, unsigned long long *cyclecount);
19
20 /*!
21  * @brief Get the machine timebase frequency
22  * @param hartid The hart ID to read the timebase of
23  * @param timebase The variable to hold the value
24  * @return 0 upon success
25  */
26 int metal_timer_get_timebase_frequency(int hartid, unsigned long long *timebase);
27
28 /*! 
29  * @brief Set the machine timer tick interval in seconds
30  * @param hartid The hart ID to read the timebase of
31  * @param second The number of seconds to set the tick interval to
32  * @return 0 upon success
33  */
34 int metal_timer_set_tick(int hartid, int second);
35
36 #endif