FreeRTOS port on GAP8/RISC-V
|
Macros | |
#define | LOG2_MAXDCO |
#define | FLL_MAXM |
#define | ARCHI_FLL_MAXDCO_FREQ |
#define | PI_FLL_INPUT_FREQ |
#define | PI_FLL_ITG_PER |
#define | PI_FLL_MAX_MUL |
Functions | |
static uint32_t | __pi_fll_mult_div_from_frequency_get (uint32_t freq, uint32_t *mult, uint32_t *div) |
void | pi_fll_init (uint8_t fll_id, uint32_t frequency) |
Initialize an FLL. More... | |
int32_t | pi_fll_frequency_set (uint8_t fll_id, uint32_t frequency, uint8_t check) |
Set FLL to given frequency. More... | |
uint32_t | pi_fll_frequency_get (uint8_t fll_id, uint8_t real) |
Get FLL frequency. More... | |
Variables | |
static uint32_t | g_fll_frequency [ARCHI_NB_FLL] |
#define ARCHI_FLL_MAXDCO_FREQ |
#define FLL_MAXM |
#define LOG2_MAXDCO |
#define PI_FLL_INPUT_FREQ |
Referenced by __pi_fll_mult_div_from_frequency_get().
#define PI_FLL_ITG_PER |
Referenced by pi_fll_init().
#define PI_FLL_MAX_MUL |
Referenced by __pi_fll_mult_div_from_frequency_get().
|
static |
References PI_FLL_INPUT_FREQ, and PI_FLL_MAX_MUL.
Referenced by pi_fll_frequency_set(), and pi_fll_init().
uint32_t pi_fll_frequency_get | ( | uint8_t | fll_id, |
uint8_t | real | ||
) |
fll_id | FLL domain. |
real | Compute current frequency. |
References __pi_fll_frequency_from_mult_div_get(), g_fll_frequency, hal_fll_conf1_div_get(), and hal_fll_status_mult_factor_get().
int32_t pi_fll_frequency_set | ( | uint8_t | fll_id, |
uint32_t | frequency, | ||
uint8_t | check | ||
) |
fll_id | FLL domain. |
frequency | Frequency value to set. |
check | Check frequency(with current voltage). |
References __pi_fll_frequency_from_mult_div_get(), __pi_fll_mult_div_from_frequency_get(), abs(), fll_ctrl_conf2_t::assert_cycles, fll_ctrl_conf1_t::clock_out_divider, fll_ctrl_conf2_t::config_clock_sel, fll_ctrl_conf2_t::de_assert_cycles, fll_ctrl_conf2_t::dithering, FLL_ID_FC, FLL_TRACE, g_fll_frequency, hal_fll_conf1_div_get(), hal_fll_conf1_mask_set(), hal_fll_conf2_mask_set(), hal_fll_mult_div_set(), hal_fll_status_mult_factor_get(), fll_ctrl_conf2_t::lock_tolerance, fll_ctrl_conf2_t::loop_gain, fll_ctrl_conf1_t::mode, fll_ctrl_conf1_t::mult_factor, fll_ctrl_conf2_t::open_loop, fll_ctrl_conf1_t::output_lock_enable, pi_freq_callback_exec(), printf, fll_ctrl_conf1_t::raw, fll_ctrl_conf2_t::raw, and system_core_clock_update().
void pi_fll_init | ( | uint8_t | fll_id, |
uint32_t | frequency | ||
) |
This function initializes an FLL at a given frequency if param is not null.
fll_id | FLL domain. |
frequency | Initial frequency. |
References __pi_fll_mult_div_from_frequency_get(), fll_ctrl_conf2_t::assert_cycles, fll_ctrl_conf2_t::config_clock_sel, fll_ctrl_conf2_t::de_assert_cycles, fll_ctrl_conf2_t::dithering, fll, FLL_TRACE, g_fll_frequency, hal_fll_clock_conf_mask_set(), hal_fll_conf1_get(), hal_fll_conf1_mask_set(), hal_fll_conf2_mask_set(), hal_fll_dco_set(), hal_fll_integrator_set(), hal_fll_mult_div_set(), fll_ctrl_integrator_t::int_part, fll_ctrl_conf2_t::lock_tolerance, fll_ctrl_conf2_t::loop_gain, fll_ctrl_conf1_t::mode, fll_ctrl_conf2_t::open_loop, pi_fll_frequency_set(), PI_FLL_ITG_PER, fll_ctrl_conf1_t::raw, fll_ctrl_conf2_t::raw, and fll_ctrl_integrator_t::raw.
|
static |
Referenced by pi_fll_frequency_get(), pi_fll_frequency_set(), and pi_fll_init().