no-OS
clk_axi_clkgen.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef CLK_AXI_CLKGEN_H_
34 #define CLK_AXI_CLKGEN_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 
41 /******************************************************************************/
42 /*************************** Types Declarations *******************************/
43 /******************************************************************************/
44 struct axi_clkgen {
45  const char *name;
46  uint32_t base;
47  uint32_t parent_rate;
48 };
49 
51  const char *name;
52  uint32_t base;
53  uint32_t parent_rate;
54 };
55 
56 /******************************************************************************/
57 /************************ Functions Declarations ******************************/
58 /******************************************************************************/
59 int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate);
60 int32_t axi_clkgen_get_rate(struct axi_clkgen *clkgen, uint32_t *rate);
61 int32_t axi_clkgen_init(struct axi_clkgen **clk,
62  const struct axi_clkgen_init *init);
63 int32_t axi_clkgen_remove(struct axi_clkgen *clkgen);
64 
65 #endif
axi_clkgen::parent_rate
uint32_t parent_rate
Definition: clk_axi_clkgen.h:47
axi_clkgen_init::name
const char * name
Definition: clk_axi_clkgen.h:51
axi_clkgen::name
const char * name
Definition: clk_axi_clkgen.h:45
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
AXI_FPGA_TECH_UNKNOWN
@ AXI_FPGA_TECH_UNKNOWN
Definition: clk_axi_clkgen.c:126
AXI_FPGA_SPEED_2L
@ AXI_FPGA_SPEED_2L
Definition: clk_axi_clkgen.c:148
AXI_FPGA_SPEED_3
@ AXI_FPGA_SPEED_3
Definition: clk_axi_clkgen.c:150
AXI_CLKGEN_REG_STATUS
#define AXI_CLKGEN_REG_STATUS
Definition: clk_axi_clkgen.c:75
AXI_CLKGEN_REG_DRP_STATUS
#define AXI_CLKGEN_REG_DRP_STATUS
Definition: clk_axi_clkgen.c:82
AXI_FPGA_SPEED_1H
@ AXI_FPGA_SPEED_1H
Definition: clk_axi_clkgen.c:144
clk_axi_clkgen.h
Driver for the Analog Devices AXI CLKGEN.
AXI_FPGA_FAMILY_KINTEX
@ AXI_FPGA_FAMILY_KINTEX
Definition: clk_axi_clkgen.c:135
no_os_delay.h
Header file of Delay functions.
AXI_FPGA_SPEED_UNKNOWN
@ AXI_FPGA_SPEED_UNKNOWN
Definition: clk_axi_clkgen.c:141
no_os_max
#define no_os_max(x, y)
Definition: no_os_util.h:64
MMCM_REG_CLKOUT0_1
#define MMCM_REG_CLKOUT0_1
Definition: clk_axi_clkgen.c:85
axi_clkgen_init
Definition: clk_axi_clkgen.h:50
axi_clkgen_set_rate
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
axi_fgpa_technology
axi_fgpa_technology
Enum for technology/generation of the FPGA device.
Definition: clk_axi_clkgen.c:125
MMCM_REG_LOCK2
#define MMCM_REG_LOCK2
Definition: clk_axi_clkgen.c:93
axi_clkgen::base
uint32_t base
Definition: clk_axi_clkgen.h:46
axi_clkgen_init
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:520
axi_clkgen
Definition: clk_axi_clkgen.h:44
AXI_FPGA_TECH_ULTRASCALE
@ AXI_FPGA_TECH_ULTRASCALE
Definition: clk_axi_clkgen.c:128
no_os_axi_io.h
Header file of AXI IO.
MMCM_REG_CLK_FB1
#define MMCM_REG_CLK_FB1
Definition: clk_axi_clkgen.c:89
AXI_FPGA_FAMILY_VIRTEX
@ AXI_FPGA_FAMILY_VIRTEX
Definition: clk_axi_clkgen.c:136
axi_clkgen_get_rate
int32_t axi_clkgen_get_rate(struct axi_clkgen *clkgen, uint32_t *rate)
axi_clkgen_get_rate
Definition: clk_axi_clkgen.c:488
axi_clkgen_remove
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:541
AXI_FPGA_SPEED_2
@ AXI_FPGA_SPEED_2
Definition: clk_axi_clkgen.c:147
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
no_os_min
#define no_os_min(x, y)
Definition: no_os_util.h:59
AXI_REG_FPGA_INFO
#define AXI_REG_FPGA_INFO
Definition: clk_axi_clkgen.c:62
MMCM_REG_CLKOUT1_2
#define MMCM_REG_CLKOUT1_2
Definition: clk_axi_clkgen.c:88
AXI_FPGA_FAMILY_ARTIX
@ AXI_FPGA_FAMILY_ARTIX
Definition: clk_axi_clkgen.c:134
no_os_error.h
Error codes definition.
AXI_FPGA_FAMILY_UNKNOWN
@ AXI_FPGA_FAMILY_UNKNOWN
Definition: clk_axi_clkgen.c:133
AXI_FPGA_FAMILY_ZYNQ
@ AXI_FPGA_FAMILY_ZYNQ
Definition: clk_axi_clkgen.c:137
NO_OS_DIV_ROUND_UP
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
AXI_FPGA_SPEED_1HV
@ AXI_FPGA_SPEED_1HV
Definition: clk_axi_clkgen.c:145
MMCM_REG_CLK_FB2
#define MMCM_REG_CLK_FB2
Definition: clk_axi_clkgen.c:90
axi_clkgen_calc_params
void axi_clkgen_calc_params(struct axi_clkgen *axi_clkgen, uint32_t fin, uint32_t fout, uint32_t *best_d, uint32_t *best_m, uint32_t *best_dout)
axi_clkgen_calc_params
Definition: clk_axi_clkgen.c:314
MMCM_REG_CLKOUT1_1
#define MMCM_REG_CLKOUT1_1
Definition: clk_axi_clkgen.c:87
AXI_CLKGEN_REG_RESETN
#define AXI_CLKGEN_REG_RESETN
Definition: clk_axi_clkgen.c:71
axi_clkgen_get_rate
int32_t axi_clkgen_get_rate(struct axi_clkgen *clkgen, uint32_t *rate)
axi_clkgen_get_rate
Definition: clk_axi_clkgen.c:488
AXI_CLKGEN_RESETN
#define AXI_CLKGEN_RESETN
Definition: clk_axi_clkgen.c:73
axi_clkgen_init::base
uint32_t base
Definition: clk_axi_clkgen.h:52
AXI_FPGA_SPEED_1
@ AXI_FPGA_SPEED_1
Definition: clk_axi_clkgen.c:142
axi_clkgen_init
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:520
MMCM_REG_FILTER1
#define MMCM_REG_FILTER1
Definition: clk_axi_clkgen.c:95
axi_clkgen_init::parent_rate
uint32_t parent_rate
Definition: clk_axi_clkgen.h:53
AXI_CLKGEN_REG_DRP_CNTRL
#define AXI_CLKGEN_REG_DRP_CNTRL
Definition: clk_axi_clkgen.c:78
AXI_CLKGEN_DRP_CNTRL_READ
#define AXI_CLKGEN_DRP_CNTRL_READ
Definition: clk_axi_clkgen.c:80
AXI_REG_VERSION
#define AXI_REG_VERSION
Definition: clk_axi_clkgen.c:57
AXI_FPGA_SPEED_2LV
@ AXI_FPGA_SPEED_2LV
Definition: clk_axi_clkgen.c:149
MMCM_REG_CLKOUT0_2
#define MMCM_REG_CLKOUT0_2
Definition: clk_axi_clkgen.c:86
no_os_axi_io_read
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: altera_axi_io.c:53
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
axi_clkgen_read
int32_t axi_clkgen_read(struct axi_clkgen *clkgen, uint32_t reg_addr, uint32_t *reg_val)
axi_clkgen_read
Definition: clk_axi_clkgen.c:168
MMCM_REG_CLK_DIV
#define MMCM_REG_CLK_DIV
Definition: clk_axi_clkgen.c:91
AXI_REG_FPGA_VOLTAGE
#define AXI_REG_FPGA_VOLTAGE
Definition: clk_axi_clkgen.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
axi_clkgen_mmcm_write
void axi_clkgen_mmcm_write(struct axi_clkgen *clkgen, uint32_t reg, uint32_t val, uint32_t mask)
axi_clkgen_mmcm_write
Definition: clk_axi_clkgen.c:213
MMCM_REG_LOCK3
#define MMCM_REG_LOCK3
Definition: clk_axi_clkgen.c:94
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
axi_clkgen_calc_clk_params
void axi_clkgen_calc_clk_params(uint32_t divider, uint32_t *low, uint32_t *high, uint32_t *edge, uint32_t *nocount)
axi_clkgen_calc_clk_params
Definition: clk_axi_clkgen.c:382
MMCM_REG_FILTER2
#define MMCM_REG_FILTER2
Definition: clk_axi_clkgen.c:96
AXI_FPGA_TECH_SERIES7
@ AXI_FPGA_TECH_SERIES7
Definition: clk_axi_clkgen.c:127
AXI_CLKGEN_DRP_STATUS_BUSY
#define AXI_CLKGEN_DRP_STATUS_BUSY
Definition: clk_axi_clkgen.c:83
AXI_PCORE_VER_MAJOR
#define AXI_PCORE_VER_MAJOR(version)
Definition: clk_axi_clkgen.c:53
axi_clkgen_set_rate
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
no_os_axi_io_write
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: altera_axi_io.c:67
AXI_CLKGEN_MMCM_RESETN
#define AXI_CLKGEN_MMCM_RESETN
Definition: clk_axi_clkgen.c:72
AXI_INFO_FPGA_TECH
#define AXI_INFO_FPGA_TECH(info)
Definition: clk_axi_clkgen.c:65
axi_fpga_speed_grade
axi_fpga_speed_grade
Enum for FPGA's speed-grade.
Definition: clk_axi_clkgen.c:140
AXI_CLKGEN_STATUS
#define AXI_CLKGEN_STATUS
Definition: clk_axi_clkgen.c:76
AXI_CLKGEN_DRP_CNTRL_SEL
#define AXI_CLKGEN_DRP_CNTRL_SEL
Definition: clk_axi_clkgen.c:79
AXI_FPGA_TECH_ULTRASCALE_PLUS
@ AXI_FPGA_TECH_ULTRASCALE_PLUS
Definition: clk_axi_clkgen.c:129
axi_clkgen_remove
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:541
no_os_util.h
Header file of utility functions.
MMCM_REG_LOCK1
#define MMCM_REG_LOCK1
Definition: clk_axi_clkgen.c:92
axi_clkgen_write
int32_t axi_clkgen_write(struct axi_clkgen *clkgen, uint32_t reg_addr, uint32_t reg_val)
axi_clkgen_write
Definition: clk_axi_clkgen.c:156
axi_fpga_family
axi_fpga_family
Enum for family variant of the FPGA device.
Definition: clk_axi_clkgen.c:132
AXI_FPGA_SPEED_1L
@ AXI_FPGA_SPEED_1L
Definition: clk_axi_clkgen.c:143
AXI_INFO_FPGA_FAMILY
#define AXI_INFO_FPGA_FAMILY(info)
Definition: clk_axi_clkgen.c:66
NO_OS_DIV_ROUND_CLOSEST
#define NO_OS_DIV_ROUND_CLOSEST(x, y)
Definition: no_os_util.h:54
AXI_FPGA_SPEED_1LV
@ AXI_FPGA_SPEED_1LV
Definition: clk_axi_clkgen.c:146
AXI_INFO_FPGA_VOLTAGE
#define AXI_INFO_FPGA_VOLTAGE(val)
Definition: clk_axi_clkgen.c:69
AXI_INFO_FPGA_SPEED_GRADE
#define AXI_INFO_FPGA_SPEED_GRADE(info)
Definition: clk_axi_clkgen.c:67