FreeRTOS port on GAP8/RISC-V
|
Data Structures | |
union | timer_cfg_u |
Macros | |
#define | fc_timer(id) |
#define | cl_timer(id) |
Typedefs | |
typedef timer_unit_cfg_lo_t | timer_cfg_u |
Enumerations | |
enum | timer_e |
enum | timer_e |
Functions | |
void | pi_timer_init (timer_e timer, timer_cfg_u cfg, uint32_t cmp_val) |
Initialize a timer. More... | |
void | pi_timer_reset (timer_e timer) |
Reset a timer counter. More... | |
void | pi_timer_start (timer_e timer) |
Start a timer. More... | |
void | pi_timer_stop (timer_e timer) |
Stop a timer. More... | |
uint32_t | pi_timer_value_read (timer_e timer) |
Get a timer's counter value. More... | |
void | pi_timer_irq_set (timer_e timer, uint32_t time_us, uint8_t one_shot) |
Set timer to trigger IRQ. More... | |
void | pi_timer_conf_init (timer_cfg_u *cfg) |
Initialize timer config structure. More... | |
#define cl_timer | ( | id | ) |
Pointer to Cluster Timer.
Referenced by pi_timer_init(), pi_timer_reset(), pi_timer_start(), pi_timer_stop(), and pi_timer_value_read().
#define fc_timer | ( | id | ) |
Pointer to FC TImer.
Referenced by pi_timer_init(), pi_timer_reset(), pi_timer_start(), pi_timer_stop(), and pi_timer_value_read().
typedef timer_unit_cfg_lo_t timer_cfg_u |
enum timer_e |
enum timer_e |
void pi_timer_conf_init | ( | timer_cfg_u * | cfg | ) |
This function sets defaults values to timer.
cfg | Pointer to conf structure. |
References timer_cfg_u::enable, timer_cfg_u::mode, and timer_cfg_u::reset.
Referenced by __pi_perf_enable_timer(), pi_timer_irq_set(), system_core_clock_update(), and system_setup_systick().
void pi_timer_init | ( | timer_e | timer, |
timer_cfg_u | cfg, | ||
uint32_t | cmp_val | ||
) |
This function initializes a timer(on FC or Cluster) with given configuration.
timer | Timer to configure. |
cfg | Configuration structure to set up the timer. |
cmp_val | Compare value. |
References __g_timer_state, cl_timer, CL_TIMER_0, CL_TIMER_1, fc_timer, FC_TIMER_0, FC_TIMER_1, FC_TIMER_2, FC_TIMER_3, g_timer_state, hal_write32(), TIMER_INIT, timer_unit_cfg_hi_set(), timer_unit_cfg_lo_set(), timer_unit_cmp_hi_set(), timer_unit_cmp_lo_set(), timer_unit_cnt_hi_set(), timer_unit_cnt_lo_set(), and timer_cfg_u::word.
Referenced by __pi_perf_enable_timer(), pi_timer_irq_set(), system_core_clock_update(), and system_setup_systick().
void pi_timer_irq_set | ( | timer_e | timer, |
uint32_t | time_us, | ||
uint8_t | one_shot | ||
) |
This function is used to set a timer to trigger an IRQ when the given value is reached.
timer | Timer to set. |
time_us | Timer value in us. |
one_shot | Timer mode : one-shot or continuous. |
References __g_timer_state, timer_cfg_u::enable, timer_cfg_u::field, g_timer_state, timer_cfg_u::irq_en, timer_cfg_u::mode, timer_cfg_u::one_shot, pi_freq_get(), pi_timer_conf_init(), pi_timer_init(), pi_timer_start(), pi_timer_stop(), system_core_clock_get(), and TIMER_ENA.
void pi_timer_reset | ( | timer_e | timer | ) |
This function resets a timer's counter register.
timer | Timer to reset. |
References cl_timer, CL_TIMER_0, CL_TIMER_1, fc_timer, FC_TIMER_0, FC_TIMER_1, FC_TIMER_2, FC_TIMER_3, timer_cfg_u::field, hal_or32(), timer_cfg_u::reset, timer_unit_reset_hi_set(), timer_unit_reset_lo_set(), and timer_cfg_u::word.
Referenced by __pi_perf_fc_reset().
void pi_timer_start | ( | timer_e | timer | ) |
This function starts a timer.
timer | Timer to start. |
References __g_timer_state, cl_timer, CL_TIMER_0, CL_TIMER_1, timer_cfg_u::enable, fc_timer, FC_TIMER_0, FC_TIMER_1, FC_TIMER_2, FC_TIMER_3, timer_cfg_u::field, g_timer_state, hal_or32(), TIMER_ENA, timer_unit_start_hi_set(), timer_unit_start_lo_set(), and timer_cfg_u::word.
Referenced by pi_timer_irq_set().
void pi_timer_stop | ( | timer_e | timer | ) |
This function stops a timer.
timer | Timer to stop. |
References __g_timer_state, cl_timer, CL_TIMER_0, CL_TIMER_1, fc_timer, FC_TIMER_0, FC_TIMER_1, FC_TIMER_2, FC_TIMER_3, g_timer_state, hal_read32(), hal_write32(), TIMER_ENA, timer_unit_cfg_hi_get(), timer_unit_cfg_hi_set(), TIMER_UNIT_CFG_LO_ENABLE_MASK, timer_unit_cfg_lo_get(), timer_unit_cfg_lo_set(), and TIMERL_CFG_REG_LOW_ENABLE_Msk.
Referenced by __pi_perf_fc_stop(), pi_timer_irq_set(), and system_core_clock_update().
uint32_t pi_timer_value_read | ( | timer_e | timer | ) |
This function returns current counter value of a timer.
timer | Timer to stop. |
References cl_timer, CL_TIMER_0, CL_TIMER_1, fc_timer, FC_TIMER_0, FC_TIMER_1, FC_TIMER_2, FC_TIMER_3, hal_read32(), timer_unit_cnt_hi_get(), and timer_unit_cnt_lo_get().
Referenced by __pi_perf_save().