w3_clock_controller_axi Driver
Driver for WARP v3 clock controller pcore (w3_clock_controller_axi)
|
Functions | |
int | clk_init (u32 baseaddr, u8 clkDiv) |
int | clk_config_outputs (u32 baseaddr, u8 clkOutMode, u32 clkOutSel) |
int | clk_config_input_rf_ref (u32 baseaddr, u8 clkInSel) |
u32 | clk_config_read_clkmod_status (u32 baseaddr) |
int | clk_config_dividers (u32 baseaddr, u8 clkDiv, u32 clkOutSel) |
u32 | clk_spi_read (u32 baseaddr, u32 csMask, u8 regAddr) |
void | clk_spi_write (u32 baseaddr, u32 csMask, u8 regAddr, u8 txByte) |
Example:
int clk_init | ( | u32 | baseaddr, |
u8 | clkDiv | ||
) |
Initializes the clock controller. This function must be called once at boot before any AD or RF operations will work. The w3_clock_controller_axi HDL applies preliminary configuration values to the sampling and RF reference clock buffers, and (if preset) the PLL+buffer on the CM-PLL clock module.
The HDL applies the minimum set of configuration values to allow the MicroBlaze subsystem to boot. This function does not override any configuration values applied by the HDL.
Refer to the pcore user guide for details on the pre-boot configuration process: http://warpproject.org/trac/wiki/cores/w3_clock_controller
Default config is:
baseaddr | Base memory address of w3_clock_controller_axi pcore |
clkDiv | Clock divider for SPI serial clock (set to 3 for 160MHz bus) |
int clk_config_outputs | ( | u32 | baseaddr, |
u8 | clkOutMode, | ||
u32 | clkOutSel | ||
) |
Configures which outputs are en/disabled in both AD9512 clock buffers.
baseaddr | Base memory address of w3_clock_controller_axi pcore | ||||||||||||||||||
clkOutMode | New mode for selected clock outputs; must be CLK_OUTPUT_ON or CLK_OUTPUT_OFF | ||||||||||||||||||
clkOutSel | Masks to select which clock outputs to affect; must be OR'd combination of:
|
int clk_config_input_rf_ref | ( | u32 | baseaddr, |
u8 | clkInSel | ||
) |
Configures whether the RF Reference Buffer uses the on-board or off-board clock source.
baseaddr | Base memory address of w3_clock_controller_axi pcore | ||||||
clkInSel | Clock source mask, must be either CLK_INSEL_ONBOARD (for on-board oscillator) or CLK_INSEL_CLKMOD (for off-board clock via clock module header)
|
|
inline |
Reads the status pins of the currently installed clock module.
baseaddr | Base memory address of w3_clock_controller_axi pcore |
For the CM-MMCX, 2 LSB are value of 2-position SIP switch. For the CM-PLL, 3 LSB are the value of the 3 LSB of the DIP switch. Bit 0x8 is the PLL status.
int clk_config_dividers | ( | u32 | baseaddr, |
u8 | clkDiv, | ||
u32 | clkOutSel | ||
) |
Configures output dividers in both AD9512 clock buffers.
baseaddr | Base memory address of w3_clock_controller_axi pcore | ||||||||||||||||||
clkDiv | Divider value to set; must be 1 or even integer in [2,32] | ||||||||||||||||||
clkOutSel | Masks to select which clock outputs to affect; must be OR'd combination of:
|
u32 clk_spi_read | ( | u32 | baseaddr, |
u32 | csMask, | ||
u8 | regAddr | ||
) |
Reads the specified register from both AD9963s.
baseaddr | Base memory address of w3_clock_controller_axi pcore |
csMask | OR'd combination of CLK_SAMP_CS and CLK_RFREF_CS |
regAddr | Address of register to read, in [0x00, 0x5A] |
void clk_spi_write | ( | u32 | baseaddr, |
u32 | csMask, | ||
u8 | regAddr, | ||
u8 | txByte | ||
) |
Writes the specified register value to the selected AD9512 clock buffers.
baseaddr | Base memory address of w3_clock_controller_axi pcore |
csMask | OR'd combination of CLK_SAMP_CS and CLK_RFREF_CS |
regAddr | Address of register to write, in [0x00, 0x5A] |
txByte | 8-bit value to write |