FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gap8/pmsis/drivers/fll/fll.c File Reference

Macros

#define LOG2_MAXDCO
 
#define LOG2_MAXDIV
 
#define LOG2_REFCLK
 
#define LOG2_MAXM
 

Functions

static uint32_t __pi_fll_mult_div_from_frequency_get (uint32_t freq, uint32_t *mult, uint32_t *div)
 
static uint32_t __pi_fll_frequency_from_mult_div_get (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...
 
int pi_freq_callback_add (pi_freq_cb_t *cb)
 
int pi_freq_callback_remove (pi_freq_cb_t *cb)
 
void pi_freq_callback_exec (void)
 

Variables

static volatile uint32_t g_fll_frequency [ARCHI_NB_FLL]
 
static pi_freq_cb_tg_freq_cb
 

Macro Definition Documentation

#define LOG2_MAXDCO

FreqOut = (Fref * Mult)/2^(Div-1) With Mult on 16 bits and Div on 4 bits

#define LOG2_MAXDIV
#define LOG2_MAXM

Function Documentation

static uint32_t __pi_fll_frequency_from_mult_div_get ( uint32_t  mult,
uint32_t  div 
)
static
static uint32_t __pi_fll_mult_div_from_frequency_get ( uint32_t  freq,
uint32_t *  mult,
uint32_t *  div 
)
static

References __FL1, __MAX, and LOG2_REFCLK.

Referenced by pi_fll_frequency_set().

uint32_t pi_fll_frequency_get ( uint8_t  fll_id,
uint8_t  real 
)
Parameters
fll_idFLL domain.
realCompute current frequency.
Note
If real param is set, current frequency is computed from HW registers.
Returns
Frequency value.

Referenced by pi_freq_get().

int32_t pi_fll_frequency_set ( uint8_t  fll_id,
uint32_t  frequency,
uint8_t  check 
)
Parameters
fll_idFLL domain.
frequencyFrequency value to set.
checkCheck frequency(with current voltage).
Returns
Set frequency.

Referenced by pi_fll_init(), and pi_freq_set().

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.

Parameters
fll_idFLL domain.
frequencyInitial frequency.

Referenced by __pi_pmu_init(), and pi_pmu_init().

int pi_freq_callback_add ( pi_freq_cb_t cb)
void pi_freq_callback_exec ( void  )
int pi_freq_callback_remove ( pi_freq_cb_t cb)

Variable Documentation

volatile uint32_t g_fll_frequency[ARCHI_NB_FLL]
static