no-OS
clk_altera_a10_fpll.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef CLK_ALTERA_A10_FPLL_H_
34 #define CLK_ALTERA_A10_FPLL_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdbool.h>
40 
41 /******************************************************************************/
42 /*************************** Types Declarations *******************************/
43 /******************************************************************************/
45  const char *name;
46  uint32_t base;
47  uint32_t parent_rate;
49 };
50 
52  const char *name;
53  uint32_t base;
54  uint32_t parent_rate;
55 };
56 
57 /******************************************************************************/
58 /************************ Functions Declarations ******************************/
59 /******************************************************************************/
60 int32_t altera_a10_fpll_init(struct altera_a10_fpll **a10_fpll,
61  const struct altera_a10_fpll_init *init);
62 int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll);
63 int32_t altera_a10_fpll_set_rate(struct altera_a10_fpll *fpll, uint32_t rate);
64 int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll);
65 void altera_a10_fpll_disable(struct altera_a10_fpll *fpll);
66 #endif
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
altera_a10_release_arbitration
void altera_a10_release_arbitration(struct altera_a10_fpll *fpll, bool run_calibration)
altera_a10_release_arbitration
Definition: clk_altera_a10_fpll.c:127
altera_a10_fpll_enable
int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll)
altera_a10_fpll_enable
Definition: clk_altera_a10_fpll.c:448
no_os_min_t
#define no_os_min_t(type, x, y)
Definition: no_os_util.h:61
altera_a10_fpll_write
void altera_a10_fpll_write(struct altera_a10_fpll *fpll, uint32_t addr, uint32_t val)
altera_a10_fpll_write
Definition: clk_altera_a10_fpll.c:82
altera_a10_fpll_set_rate
int32_t altera_a10_fpll_set_rate(struct altera_a10_fpll *fpll, uint32_t rate)
altera_a10_fpll_set_rate
Definition: clk_altera_a10_fpll.c:340
altera_a10_fpll_enable
int32_t altera_a10_fpll_enable(struct altera_a10_fpll *fpll)
altera_a10_fpll_enable
Definition: clk_altera_a10_fpll.c:448
altera_a10_acquire_arbitration
uint32_t altera_a10_acquire_arbitration(struct altera_a10_fpll *fpll)
altera_a10_acquire_arbitration
Definition: clk_altera_a10_fpll.c:105
altera_a10_fpll_calc_params
int32_t altera_a10_fpll_calc_params(uint32_t fref, uint32_t fout, uint32_t *best_n, uint32_t *best_m, uint32_t *best_c0, uint32_t *best_fvco)
altera_a10_fpll_calc_params
Definition: clk_altera_a10_fpll.c:238
FPLL_REG_DIV_COUNTER0
#define FPLL_REG_DIV_COUNTER0
Definition: clk_altera_a10_fpll.c:58
altera_a10_fpll_remove
int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll)
altera_a10_fpll_remove
Definition: clk_altera_a10_fpll.c:487
FPLL_REG_C_COUNTER2
#define FPLL_REG_C_COUNTER2
Definition: clk_altera_a10_fpll.c:54
NO_OS_DIV_ROUND_CLOSEST_ULL
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
FPLL_REG_DIV_COUNTER1
#define FPLL_REG_DIV_COUNTER1
Definition: clk_altera_a10_fpll.c:59
altera_a10_fpll::parent_rate
uint32_t parent_rate
Definition: clk_altera_a10_fpll.h:47
altera_a10_fpll_init::name
const char * name
Definition: clk_altera_a10_fpll.h:52
altera_a10_fpll_pll_calibration_check
int32_t altera_a10_fpll_pll_calibration_check(struct altera_a10_fpll *fpll)
altera_a10_fpll_pll_calibration_check
Definition: clk_altera_a10_fpll.c:314
altera_a10_fpll_set_rate
int32_t altera_a10_fpll_set_rate(struct altera_a10_fpll *fpll, uint32_t rate)
altera_a10_fpll_set_rate
Definition: clk_altera_a10_fpll.c:340
A10_FPLL_PFD_MIN
#define A10_FPLL_PFD_MIN
Definition: clk_altera_a10_fpll.c:61
altera_a10_fpll_remove
int32_t altera_a10_fpll_remove(struct altera_a10_fpll *fpll)
altera_a10_fpll_remove
Definition: clk_altera_a10_fpll.c:487
altera_a10_fpll_lookup_cp_current
int32_t altera_a10_fpll_lookup_cp_current(uint32_t fvco, uint32_t m)
altera_a10_fpll_lookup_cp_current
Definition: clk_altera_a10_fpll.c:176
altera_a10_fpll_read
uint32_t altera_a10_fpll_read(struct altera_a10_fpll *fpll, uint32_t addr)
altera_a10_fpll_read
Definition: clk_altera_a10_fpll.c:73
no_os_error.h
Error codes definition.
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
FPLL_REG_C_COUNTER3
#define FPLL_REG_C_COUNTER3
Definition: clk_altera_a10_fpll.c:55
altera_a10_fpll_lookup_lf_resistance
uint32_t altera_a10_fpll_lookup_lf_resistance(uint32_t fvco, uint32_t m)
altera_a10_fpll_lookup_lf_resistance
Definition: clk_altera_a10_fpll.c:136
A10_FPLL_VCO_MAX
#define A10_FPLL_VCO_MAX
Definition: clk_altera_a10_fpll.c:64
altera_a10_fpll_init::parent_rate
uint32_t parent_rate
Definition: clk_altera_a10_fpll.h:54
altera_a10_fpll_round_rate
int32_t altera_a10_fpll_round_rate(struct altera_a10_fpll *fpll, uint32_t rate)
altera_a10_fpll_round_rate
Definition: clk_altera_a10_fpll.c:293
clk_altera_a10_fpll.h
Driver for the Altera FPLL.
altera_a10_fpll::name
const char * name
Definition: clk_altera_a10_fpll.h:45
A10_FPLL_VCO_MIN
#define A10_FPLL_VCO_MIN
Definition: clk_altera_a10_fpll.c:63
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
no_os_clamp_t
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:71
altera_a10_fpll_disable
void altera_a10_fpll_disable(struct altera_a10_fpll *fpll)
altera_a10_fpll_disable
Definition: clk_altera_a10_fpll.c:458
no_os_max_t
#define no_os_max_t(type, x, y)
Definition: no_os_util.h:66
altera_a10_fpll_init
Definition: clk_altera_a10_fpll.h:51
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
A10_FPLL_PFD_MAX
#define A10_FPLL_PFD_MAX
Definition: clk_altera_a10_fpll.c:62
altera_a10_fpll_recalc_rate
uint32_t altera_a10_fpll_recalc_rate(struct altera_a10_fpll *fpll)
altera_a10_fpll_recalc_rate
Definition: clk_altera_a10_fpll.c:397
altera_a10_fpll::initial_recalc
bool initial_recalc
Definition: clk_altera_a10_fpll.h:48
altera_a10_fpll_init
int32_t altera_a10_fpll_init(struct altera_a10_fpll **a10_fpll, const struct altera_a10_fpll_init *init)
altera_a10_fpll_init
Definition: clk_altera_a10_fpll.c:466
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
altera_a10_fpll
Definition: clk_altera_a10_fpll.h:44
altera_a10_fpll_init
int32_t altera_a10_fpll_init(struct altera_a10_fpll **a10_fpll, const struct altera_a10_fpll_init *init)
altera_a10_fpll_init
Definition: clk_altera_a10_fpll.c:466
no_os_round_up
#define no_os_round_up(x, y)
Definition: no_os_util.h:77
altera_a10_fpll_disable
void altera_a10_fpll_disable(struct altera_a10_fpll *fpll)
altera_a10_fpll_disable
Definition: clk_altera_a10_fpll.c:458
no_os_util.h
Header file of utility functions.
altera_a10_fpll::base
uint32_t base
Definition: clk_altera_a10_fpll.h:46
altera_a10_fpll_init::base
uint32_t base
Definition: clk_altera_a10_fpll.h:53
altera_a10_fpll_update
void altera_a10_fpll_update(struct altera_a10_fpll *fpll, uint32_t addr, uint32_t mask, uint32_t val)
altera_a10_fpll_update
Definition: clk_altera_a10_fpll.c:91
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
altera_a10_fpll_is_enabled
int32_t altera_a10_fpll_is_enabled(struct altera_a10_fpll *fpll)
altera_a10_fpll_is_enabled
Definition: clk_altera_a10_fpll.c:440
FPLL_REG_C_COUNTER4
#define FPLL_REG_C_COUNTER4
Definition: clk_altera_a10_fpll.c:56