no-OS
|
Header file of ADF4156 Driver for Microblaze processor. More...
Go to the source code of this file.
Classes | |
struct | adf4156_platform_data |
struct | adf4156_state |
struct | adf4156_dev |
struct | adf4156_init_param |
Macros | |
#define | ADF4156_MUXOUT_Z (0x00 << 27) |
#define | ADF4156_MUXOUT_DVdd (0x01 << 27) |
#define | ADF4156_MUXOUT_DGND (0x02 << 27) |
#define | ADF4156_MUXOUT_RDIV (0x03 << 27) |
#define | ADF4156_MUXOUT_NDIV (0x04 << 27) |
#define | ADF4156_MUXOUT_ALOCK (0x05 << 27) |
#define | ADF4156_MUXOUT_DLOCK (0x06 << 27) |
#define | ADF4156_MUXOUT_SDO (0x07 << 27) |
#define | ADF4156_MUXOUT_CLKDIV (0x0A << 27) |
#define | ADF4156_MUXOUT_FLS (0x0C << 27) |
#define | ADF4156_MUXOUT_RDIV2 (0x0D << 27) |
#define | ADF4156_MUXOUT_NDIV2 (0x0E << 27) |
#define | ADF4156_MUXOUT_RESERVED (0x0F << 27) |
#define | ADF4156_INT_VAL(x) ((x & 0xFFF) << 15) |
#define | ADF4156_FRAC_VAL(x) ((x & 0xFFF) << 3) |
#define | ADF4156_R0_CTRL 0x00 |
#define | ADF4156_PHASE_VAL(x) ((x & 0xFFF) << 3) |
#define | ADF4156_R1_CTRL 0x01 |
#define | ADF4156_LOW_NOISE (0x00 << 29) |
#define | ADF4156_LOW_SPUR (0x03 << 29) |
#define | ADF4156_CSR_EN(x) ((x & 0x1) << 28) |
#define | ADF4156_CURR_SET(x) ((x & 0xF) << 24) |
#define | ADF4156_PRESCALER(x) ((x & 0x1) << 22) |
#define | ADF4156_RDIV2(x) ((x & 0x1) << 21) |
#define | ADF4156_REF_DBL(x) ((x & 0x1) << 20) |
#define | ADF4156_R_CNT(x) ((x & 0x1F) << 15) |
#define | ADF4156_MOD_WORD(x) ((x & 0xFFF) << 3) |
#define | ADF4156_R2_CTRL 0x02 |
#define | ADF4156_SIG_DEL_RST(x) ((x & 0x1) << 14) |
#define | ADF4156_LDP(x) ((x & 0x1) << 7) |
#define | ADF4156_PD_POL(x) ((x & 0x1) << 6) |
#define | ADF4156_PD ((x & 0x1) << 5) |
#define | ADF4156_CP_Z(x) ((x & 0x1) << 4) |
#define | ADF4156_CNT_RST(x) ((x & 0x1) << 3) |
#define | ADF4156_R3_CTRL 0x03 |
#define | ADF4156_CLK_DIV_OFF (0x00 << 19) |
#define | ADF4156_CLK_FAST_LOCK (0x01 << 19) |
#define | ADF4156_CLK_RESYNC_EN (0x02 << 19) |
#define | ADF4156_CLK_DIV_VAL(x) ((x & 0xFFF) << 7) |
#define | ADF4156_R4_CTRL 0x04 |
#define | ADF4156_LE_OUT |
#define | ADF4156_LE_LOW |
#define | ADF4156_LE_HIGH |
#define | ADF4156_MUX_OUT |
#define | ADF4156_MUX_LOW |
#define | ADF4156_MUX_HIGH |
#define | ADF4156_CE_OUT |
#define | ADF4156_CE_LOW |
#define | ADF4156_CE_HIGH |
#define | ADF4156_LE2_OUT |
#define | ADF4156_LE2_LOW |
#define | ADF4156_LE2_HIGH |
#define | ADF4156_CE2_OUT |
#define | ADF4156_CE2_LOW |
#define | ADF4156_CE2_HIGH |
#define | ADF4156_MAX_OUT_FREQ 6200 /* MHz */ |
#define | ADF4156_MIN_OUT_FREQ 500 /* MHz */ |
#define | ADF4156_MAX_FREQ_45_PRESC 3000 /* MHz */ |
#define | ADF4156_MAX_FREQ_PFD 32000000 /* Hz */ |
#define | ADF4156_MAX_FREQ_REFIN 250000000 /* Hz */ |
#define | ADF4156_MIN_FREQ_REFIN 10000000 /* Hz */ |
#define | ADF4156_MAX_MODULUS 4095 /* (2^12)-1 */ |
#define | ADF4156_MAX_R_CNT 32 |
#define | ADF4156_MAX_REG_VAL 0x1FFFFFFF |
#define | ADF4156_REG0 0 |
#define | ADF4156_REG1 1 |
#define | ADF4156_REG2 2 |
#define | ADF4156_REG3 3 |
#define | ADF4156_REG4 4 |
Functions | |
int8_t | adf4156_init (struct adf4156_dev **device, struct adf4156_init_param init_param) |
Initialize the SPI communication with the device. More... | |
int32_t | adf4156_remove (struct adf4156_dev *dev) |
Free the resources allocated by adf4156_init(). More... | |
int8_t | adf4156_set (struct adf4156_dev *dev, uint32_t value) |
Transmits 32 bits on SPI. More... | |
int32_t | adf4156_tune_r_cnt (struct adf4156_dev *dev, int32_t r_cnt) |
Increases the R counter value until the PFD frequency is smaller than ADF4351_MAX_FREQ_PFD. More... | |
uint32_t | gcd (uint32_t x, uint32_t y) |
Computes the greatest common divider of two numbers. More... | |
double | adf4156_set_freq (struct adf4156_dev *dev, double freq) |
Sets the ADF4156 output frequency. More... | |
Header file of ADF4156 Driver for Microblaze processor.
Copyright 2013(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ADF4156_CE2_HIGH |
#define ADF4156_CE2_LOW |
#define ADF4156_CE2_OUT |
#define ADF4156_CE_HIGH |
#define ADF4156_CE_LOW |
#define ADF4156_CE_OUT |
#define ADF4156_CLK_DIV_OFF (0x00 << 19) |
#define ADF4156_CLK_DIV_VAL | ( | x | ) | ((x & 0xFFF) << 7) |
#define ADF4156_CLK_FAST_LOCK (0x01 << 19) |
#define ADF4156_CLK_RESYNC_EN (0x02 << 19) |
#define ADF4156_CNT_RST | ( | x | ) | ((x & 0x1) << 3) |
#define ADF4156_CP_Z | ( | x | ) | ((x & 0x1) << 4) |
#define ADF4156_CSR_EN | ( | x | ) | ((x & 0x1) << 28) |
#define ADF4156_CURR_SET | ( | x | ) | ((x & 0xF) << 24) |
#define ADF4156_FRAC_VAL | ( | x | ) | ((x & 0xFFF) << 3) |
#define ADF4156_INT_VAL | ( | x | ) | ((x & 0xFFF) << 15) |
#define ADF4156_LDP | ( | x | ) | ((x & 0x1) << 7) |
#define ADF4156_LE2_HIGH |
#define ADF4156_LE2_LOW |
#define ADF4156_LE2_OUT |
#define ADF4156_LE_HIGH |
#define ADF4156_LE_LOW |
#define ADF4156_LE_OUT |
#define ADF4156_LOW_NOISE (0x00 << 29) |
#define ADF4156_LOW_SPUR (0x03 << 29) |
#define ADF4156_MAX_FREQ_45_PRESC 3000 /* MHz */ |
#define ADF4156_MAX_FREQ_PFD 32000000 /* Hz */ |
#define ADF4156_MAX_FREQ_REFIN 250000000 /* Hz */ |
#define ADF4156_MAX_MODULUS 4095 /* (2^12)-1 */ |
#define ADF4156_MAX_OUT_FREQ 6200 /* MHz */ |
#define ADF4156_MAX_R_CNT 32 |
#define ADF4156_MAX_REG_VAL 0x1FFFFFFF |
#define ADF4156_MIN_FREQ_REFIN 10000000 /* Hz */ |
#define ADF4156_MIN_OUT_FREQ 500 /* MHz */ |
#define ADF4156_MOD_WORD | ( | x | ) | ((x & 0xFFF) << 3) |
#define ADF4156_MUX_HIGH |
#define ADF4156_MUX_LOW |
#define ADF4156_MUX_OUT |
#define ADF4156_MUXOUT_ALOCK (0x05 << 27) |
#define ADF4156_MUXOUT_CLKDIV (0x0A << 27) |
#define ADF4156_MUXOUT_DGND (0x02 << 27) |
#define ADF4156_MUXOUT_DLOCK (0x06 << 27) |
#define ADF4156_MUXOUT_DVdd (0x01 << 27) |
#define ADF4156_MUXOUT_FLS (0x0C << 27) |
#define ADF4156_MUXOUT_NDIV (0x04 << 27) |
#define ADF4156_MUXOUT_NDIV2 (0x0E << 27) |
#define ADF4156_MUXOUT_RDIV (0x03 << 27) |
#define ADF4156_MUXOUT_RDIV2 (0x0D << 27) |
#define ADF4156_MUXOUT_RESERVED (0x0F << 27) |
#define ADF4156_MUXOUT_SDO (0x07 << 27) |
#define ADF4156_MUXOUT_Z (0x00 << 27) |
#define ADF4156_PD ((x & 0x1) << 5) |
#define ADF4156_PD_POL | ( | x | ) | ((x & 0x1) << 6) |
#define ADF4156_PHASE_VAL | ( | x | ) | ((x & 0xFFF) << 3) |
#define ADF4156_PRESCALER | ( | x | ) | ((x & 0x1) << 22) |
#define ADF4156_R0_CTRL 0x00 |
#define ADF4156_R1_CTRL 0x01 |
#define ADF4156_R2_CTRL 0x02 |
#define ADF4156_R3_CTRL 0x03 |
#define ADF4156_R4_CTRL 0x04 |
#define ADF4156_R_CNT | ( | x | ) | ((x & 0x1F) << 15) |
#define ADF4156_RDIV2 | ( | x | ) | ((x & 0x1) << 21) |
#define ADF4156_REF_DBL | ( | x | ) | ((x & 0x1) << 20) |
#define ADF4156_REG0 0 |
#define ADF4156_REG1 1 |
#define ADF4156_REG2 2 |
#define ADF4156_REG3 3 |
#define ADF4156_REG4 4 |
#define ADF4156_SIG_DEL_RST | ( | x | ) | ((x & 0x1) << 14) |
int8_t adf4156_init | ( | struct adf4156_dev ** | device, |
struct adf4156_init_param | init_param | ||
) |
Initialize the SPI communication with the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t adf4156_remove | ( | struct adf4156_dev * | dev | ) |
Free the resources allocated by adf4156_init().
dev | - The device structure. |
int8_t adf4156_set | ( | struct adf4156_dev * | dev, |
uint32_t | value | ||
) |
Transmits 32 bits on SPI.
dev | - The device structure. |
value | - Data which will be transmitted. |
double adf4156_set_freq | ( | struct adf4156_dev * | dev, |
double | freq | ||
) |
Sets the ADF4156 output frequency.
dev | - The device structure. |
freq | - The desired frequency value. |
int32_t adf4156_tune_r_cnt | ( | struct adf4156_dev * | dev, |
int32_t | r_cnt | ||
) |
Increases the R counter value until the PFD frequency is smaller than ADF4351_MAX_FREQ_PFD.
dev | - The device structure. |
r_cnt | - Initial r_cnt value. |
uint32_t gcd | ( | uint32_t | x, |
uint32_t | y | ||
) |
Computes the greatest common divider of two numbers.