Header file of ADF4157 Driver for Microblaze processor.
More...
#include <stdint.h>
#include "no_os_gpio.h"
#include "no_os_spi.h"
Header file of ADF4157 Driver for Microblaze processor.
- Author
- Lucian Sin (Lucia.nosp@m.n.Si.nosp@m.n@ana.nosp@m.log..nosp@m.com)
Copyright 2013(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ ADF4157_CE2_HIGH
Value:
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition no_os_gpio.c:170
@ NO_OS_GPIO_HIGH
Definition no_os_gpio.h:82
◆ ADF4157_CE2_LOW
Value:
@ NO_OS_GPIO_LOW
Definition no_os_gpio.h:80
◆ ADF4157_CE2_OUT
Value:
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition no_os_gpio.c:120
◆ ADF4157_CE_HIGH
◆ ADF4157_CE_LOW
◆ ADF4157_CE_OUT
◆ ADF4157_CLK_DIV_OFF
| #define ADF4157_CLK_DIV_OFF (0x00 << 19) |
◆ ADF4157_CLK_DIV_VAL
| #define ADF4157_CLK_DIV_VAL |
( |
| x | ) |
|
◆ ADF4157_CLK_FAST_LOCK
| #define ADF4157_CLK_FAST_LOCK (0x01 << 19) |
◆ ADF4157_CLK_RESYNC_EN
| #define ADF4157_CLK_RESYNC_EN (0x02 << 19) |
◆ ADF4157_CNT_RST
| #define ADF4157_CNT_RST |
( |
| x | ) |
|
◆ ADF4157_CP_Z
| #define ADF4157_CP_Z |
( |
| x | ) |
|
◆ ADF4157_CSR_EN
| #define ADF4157_CSR_EN |
( |
| x | ) |
|
◆ ADF4157_CURR_SET
| #define ADF4157_CURR_SET |
( |
| x | ) |
|
◆ ADF4157_FIXED_MODULUS
| #define ADF4157_FIXED_MODULUS 33554432 /* 2^25 */ |
◆ ADF4157_FRAC_VAL_LSB
| #define ADF4157_FRAC_VAL_LSB |
( |
| x | ) |
|
◆ ADF4157_FRAC_VAL_MSB
| #define ADF4157_FRAC_VAL_MSB |
( |
| x | ) |
|
◆ ADF4157_INT_VAL
| #define ADF4157_INT_VAL |
( |
| x | ) |
|
◆ ADF4157_LDP
◆ ADF4157_LE2_HIGH
◆ ADF4157_LE2_LOW
◆ ADF4157_LE2_OUT
◆ ADF4157_LE_HIGH
◆ ADF4157_LE_LOW
◆ ADF4157_LE_OUT
◆ ADF4157_LOW_NOISE
| #define ADF4157_LOW_NOISE (0x00 << 29) |
◆ ADF4157_LOW_SPUR
| #define ADF4157_LOW_SPUR (0x03 << 29) |
◆ ADF4157_MAX_FREQ_45_PRESC
| #define ADF4157_MAX_FREQ_45_PRESC 3000 /* MHz */ |
◆ ADF4157_MAX_FREQ_PFD
| #define ADF4157_MAX_FREQ_PFD 32000000 /* Hz */ |
◆ ADF4157_MAX_FREQ_REFIN
| #define ADF4157_MAX_FREQ_REFIN 300000000 /* Hz */ |
◆ ADF4157_MAX_OUT_FREQ
| #define ADF4157_MAX_OUT_FREQ 6000 /* MHz */ |
◆ ADF4157_MAX_R_CNT
| #define ADF4157_MAX_R_CNT 32 |
◆ ADF4157_MAX_REG_VAL
| #define ADF4157_MAX_REG_VAL 0x1FFFFFFF |
◆ ADF4157_MIN_FREQ_REFIN
| #define ADF4157_MIN_FREQ_REFIN 10000000 /* Hz */ |
◆ ADF4157_MIN_OUT_FREQ
| #define ADF4157_MIN_OUT_FREQ 500 /* MHz */ |
◆ ADF4157_MUX_HIGH
◆ ADF4157_MUX_LOW
◆ ADF4157_MUX_OUT
◆ ADF4157_MUXOUT_ALOCK
| #define ADF4157_MUXOUT_ALOCK (0x05 << 27) |
◆ ADF4157_MUXOUT_CLKDIV
| #define ADF4157_MUXOUT_CLKDIV (0x0A << 27) |
◆ ADF4157_MUXOUT_DGND
| #define ADF4157_MUXOUT_DGND (0x02 << 27) |
◆ ADF4157_MUXOUT_DLOCK
| #define ADF4157_MUXOUT_DLOCK (0x06 << 27) |
◆ ADF4157_MUXOUT_DVdd
| #define ADF4157_MUXOUT_DVdd (0x01 << 27) |
◆ ADF4157_MUXOUT_FLS
| #define ADF4157_MUXOUT_FLS (0x0C << 27) |
◆ ADF4157_MUXOUT_NDIV
| #define ADF4157_MUXOUT_NDIV (0x04 << 27) |
◆ ADF4157_MUXOUT_NDIV2
| #define ADF4157_MUXOUT_NDIV2 (0x0E << 27) |
◆ ADF4157_MUXOUT_RDIV
| #define ADF4157_MUXOUT_RDIV (0x03 << 27) |
◆ ADF4157_MUXOUT_RDIV2
| #define ADF4157_MUXOUT_RDIV2 (0x0D << 27) |
◆ ADF4157_MUXOUT_RESERVED
| #define ADF4157_MUXOUT_RESERVED (0x0F << 27) |
◆ ADF4157_MUXOUT_SDO
| #define ADF4157_MUXOUT_SDO (0x07 << 27) |
◆ ADF4157_MUXOUT_Z
| #define ADF4157_MUXOUT_Z (0x00 << 27) |
◆ ADF4157_NEG_BLEED_CUR
| #define ADF4157_NEG_BLEED_CUR |
( |
| x | ) |
|
◆ ADF4157_PD
| #define ADF4157_PD ((x & 0x1) << 5) |
◆ ADF4157_PD_POL
| #define ADF4157_PD_POL |
( |
| x | ) |
|
◆ ADF4157_PRESCALER
| #define ADF4157_PRESCALER |
( |
| x | ) |
|
◆ ADF4157_R0_CTRL
| #define ADF4157_R0_CTRL 0x00 |
◆ ADF4157_R1_CTRL
| #define ADF4157_R1_CTRL 0x01 |
◆ ADF4157_R2_CTRL
| #define ADF4157_R2_CTRL 0x02 |
◆ ADF4157_R3_CTRL
| #define ADF4157_R3_CTRL 0x03 |
◆ ADF4157_R4_CTRL
| #define ADF4157_R4_CTRL 0x04 |
◆ ADF4157_R_CNT
| #define ADF4157_R_CNT |
( |
| x | ) |
|
◆ ADF4157_RDIV2
| #define ADF4157_RDIV2 |
( |
| x | ) |
|
◆ ADF4157_REF_DBL
| #define ADF4157_REF_DBL |
( |
| x | ) |
|
◆ ADF4157_REG0
◆ ADF4157_REG1
◆ ADF4157_REG2
◆ ADF4157_REG3
◆ ADF4157_REG4
◆ ADF4157_SIG_DEL_RST
| #define ADF4157_SIG_DEL_RST |
( |
| x | ) |
|
◆ adf4157_init()
Initialize the SPI communication with the device.
- Parameters
-
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
- Returns
- status - Result of the initialization procedure. Example: 0 - if initialization was successful; -1 - if initialization was unsuccessful.
◆ adf4157_remove()
Free the resources allocated by adf4157_init().
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adf4157_set()
| int8_t adf4157_set |
( |
struct adf4157_dev * | dev, |
|
|
uint32_t | value ) |
Transmits 32 bits on SPI.
- Parameters
-
| dev | - The device structure. |
| value | - Data which will be transmitted. |
◆ adf4157_set_freq()
| double adf4157_set_freq |
( |
struct adf4157_dev * | dev, |
|
|
double | freq ) |
Sets the ADF4157 output frequency.
- Parameters
-
| dev | - The device structure. |
| freq | - The desired frequency value. |
- Returns
- calculatedFrequency - The actual frequency value that was set.
◆ adf4157_tune_r_cnt()
| int32_t adf4157_tune_r_cnt |
( |
struct adf4157_dev * | dev, |
|
|
int32_t | r_cnt ) |
Increases the R counter value until the PFD frequency is smaller than ADF4351_MAX_FREQ_PFD.
- Parameters
-
| dev | - The device structure. |
| r_cnt | - Initial r_cnt value. |
- Returns
- Final r_cnt value.
◆ gcd()
| uint32_t gcd |
( |
uint32_t | x, |
|
|
uint32_t | y ) |
Computes the greatest common divider of two numbers.
- Returns
- Returns the gcd.