FreeRTOS port on GAP8/RISC-V
|
Functions | |
void | system_init (void) |
Setup the microcontroller system. More... | |
void | system_setup_systick (uint32_t tick_rate_hz) |
Setup timer used for SysTick. More... | |
void | system_core_clock_update (uint32_t new_freq) |
Update the SystemCoreClock variable. More... | |
uint32_t | system_core_clock_get (void) |
Get current SystemCoreClock value. More... | |
void | system_usermode_entry (void *arg) |
Prologue for usermode thread. More... | |
void | system_exit (int32_t code) |
Stop execution. More... | |
Variables | |
volatile uint32_t | SystemCoreClock |
System clock frequency (core clock) More... | |
uint32_t system_core_clock_get | ( | void | ) |
References SystemCoreClock.
void system_core_clock_update | ( | uint32_t | new_freq | ) |
It must be called whenever the CPU frequency is changed during execution. This function updates SystemCoreClock variable according to current CPU frequency.
new_freq | New SoC frequence. |
References timer_cfg_u::enable, timer_cfg_u::field, timer_cfg_u::irq_en, timer_cfg_u::mode, pi_timer_conf_init(), pi_timer_init(), pi_timer_stop(), timer_cfg_u::reset, SYS_TIMER, SystemCoreClock, and tick_rate.
void system_exit | ( | int32_t | code | ) |
This function is called to stop an execution and stop the microcontroller.
References hal_eu_evt_mask_clr(), hal_eu_evt_wait(), hal_itc_wait_for_interrupt(), hal_soc_ctrl_corestatus_set(), pi_is_fc(), semihost_exit(), SEMIHOST_EXIT_ERROR, SEMIHOST_EXIT_SUCCESS, soc_ctrl_corestatus_set(), and system_exit_printf_flush().
void system_init | ( | void | ) |
This function configures the oscillator (FLL), setup caches and IRQ. It also initializes malloc functions. this function should be called from startup_device file.
References __heapfcram_size, __heapfcram_start, __heapl2ram_size, __heapl2ram_start, __pi_pmu_init(), FC_ICACHE, FC_IRQ_SOC_EVENT_FIFO_EVT, FC_SOC_EVENT_IRQN, hal_itc_reset(), hal_soc_eu_reset_cl_mask(), hal_soc_eu_reset_fc_mask(), hal_soc_eu_reset_pr_mask(), hal_write32(), NVIC, NVIC_EnableIRQ, PENDSV_IRQN, pi_fc_event_handler_init(), pi_malloc_init(), pi_pmu_init(), printf_uart_init(), SCBC, and SOCEU.
void system_setup_systick | ( | uint32_t | tick_rate_hz | ) |
This function sets up low timer for a given tick rate.
tick_rate_hz | Tick rate of SysTick timer. |
References timer_cfg_u::enable, timer_cfg_u::field, timer_cfg_u::irq_en, timer_cfg_u::mode, NVIC_EnableIRQ, pi_timer_conf_init(), pi_timer_init(), timer_cfg_u::reset, SYS_TIMER, SystemCoreClock, SYSTICK_IRQN, and tick_rate.
void system_usermode_entry | ( | void * | arg | ) |
This function is called at the beginig of user threads. It harvest arguments to launch the user thread, free temp structs and drop privileges before executing the actual user thread.
References pi_user_task_arg_t::arg, ECALL_PRIV_DROP, pi_user_task_arg_t::entry, hal_compiler_barrier(), pi_fc_l1_free(), and syscall().
volatile uint32_t SystemCoreClock |
The system clock frequency supplied to the SysTick timer and the processor core clock. This variable can be used by the user application to setup the SysTick timer or configure other parameters. It may also be used by debugger to query the frequency of the debug timer or configure the trace clock speed SystemCoreClock is initialized with a correct predefined value.