Header file of ADF4156 Driver for Microblaze processor.
More...
#include <stdint.h>
#include "no_os_gpio.h"
#include "no_os_spi.h"
Header file of ADF4156 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
◆ ADF4156_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
◆ ADF4156_CE2_LOW
Value:
@ NO_OS_GPIO_LOW
Definition no_os_gpio.h:80
◆ ADF4156_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
◆ ADF4156_CE_HIGH
◆ ADF4156_CE_LOW
◆ ADF4156_CE_OUT
◆ ADF4156_CLK_DIV_OFF
| #define ADF4156_CLK_DIV_OFF (0x00 << 19) |
◆ ADF4156_CLK_DIV_VAL
| #define ADF4156_CLK_DIV_VAL |
( |
| x | ) |
|
◆ ADF4156_CLK_FAST_LOCK
| #define ADF4156_CLK_FAST_LOCK (0x01 << 19) |
◆ ADF4156_CLK_RESYNC_EN
| #define ADF4156_CLK_RESYNC_EN (0x02 << 19) |
◆ ADF4156_CNT_RST
| #define ADF4156_CNT_RST |
( |
| x | ) |
|
◆ ADF4156_CP_Z
| #define ADF4156_CP_Z |
( |
| x | ) |
|
◆ ADF4156_CSR_EN
| #define ADF4156_CSR_EN |
( |
| x | ) |
|
◆ ADF4156_CURR_SET
| #define ADF4156_CURR_SET |
( |
| x | ) |
|
◆ ADF4156_FRAC_VAL
| #define ADF4156_FRAC_VAL |
( |
| x | ) |
|
◆ ADF4156_INT_VAL
| #define ADF4156_INT_VAL |
( |
| x | ) |
|
◆ ADF4156_LDP
◆ ADF4156_LE2_HIGH
◆ ADF4156_LE2_LOW
◆ ADF4156_LE2_OUT
◆ ADF4156_LE_HIGH
◆ ADF4156_LE_LOW
◆ ADF4156_LE_OUT
◆ ADF4156_LOW_NOISE
| #define ADF4156_LOW_NOISE (0x00 << 29) |
◆ ADF4156_LOW_SPUR
| #define ADF4156_LOW_SPUR (0x03 << 29) |
◆ ADF4156_MAX_FREQ_45_PRESC
| #define ADF4156_MAX_FREQ_45_PRESC 3000 /* MHz */ |
◆ ADF4156_MAX_FREQ_PFD
| #define ADF4156_MAX_FREQ_PFD 32000000 /* Hz */ |
◆ ADF4156_MAX_FREQ_REFIN
| #define ADF4156_MAX_FREQ_REFIN 250000000 /* Hz */ |
◆ ADF4156_MAX_MODULUS
| #define ADF4156_MAX_MODULUS 4095 /* (2^12)-1 */ |
◆ ADF4156_MAX_OUT_FREQ
| #define ADF4156_MAX_OUT_FREQ 6200 /* MHz */ |
◆ ADF4156_MAX_R_CNT
| #define ADF4156_MAX_R_CNT 32 |
◆ ADF4156_MAX_REG_VAL
| #define ADF4156_MAX_REG_VAL 0x1FFFFFFF |
◆ ADF4156_MIN_FREQ_REFIN
| #define ADF4156_MIN_FREQ_REFIN 10000000 /* Hz */ |
◆ ADF4156_MIN_OUT_FREQ
| #define ADF4156_MIN_OUT_FREQ 500 /* MHz */ |
◆ ADF4156_MOD_WORD
| #define ADF4156_MOD_WORD |
( |
| x | ) |
|
◆ ADF4156_MUX_HIGH
◆ ADF4156_MUX_LOW
◆ ADF4156_MUX_OUT
◆ ADF4156_MUXOUT_ALOCK
| #define ADF4156_MUXOUT_ALOCK (0x05 << 27) |
◆ ADF4156_MUXOUT_CLKDIV
| #define ADF4156_MUXOUT_CLKDIV (0x0A << 27) |
◆ ADF4156_MUXOUT_DGND
| #define ADF4156_MUXOUT_DGND (0x02 << 27) |
◆ ADF4156_MUXOUT_DLOCK
| #define ADF4156_MUXOUT_DLOCK (0x06 << 27) |
◆ ADF4156_MUXOUT_DVdd
| #define ADF4156_MUXOUT_DVdd (0x01 << 27) |
◆ ADF4156_MUXOUT_FLS
| #define ADF4156_MUXOUT_FLS (0x0C << 27) |
◆ ADF4156_MUXOUT_NDIV
| #define ADF4156_MUXOUT_NDIV (0x04 << 27) |
◆ ADF4156_MUXOUT_NDIV2
| #define ADF4156_MUXOUT_NDIV2 (0x0E << 27) |
◆ ADF4156_MUXOUT_RDIV
| #define ADF4156_MUXOUT_RDIV (0x03 << 27) |
◆ ADF4156_MUXOUT_RDIV2
| #define ADF4156_MUXOUT_RDIV2 (0x0D << 27) |
◆ ADF4156_MUXOUT_RESERVED
| #define ADF4156_MUXOUT_RESERVED (0x0F << 27) |
◆ ADF4156_MUXOUT_SDO
| #define ADF4156_MUXOUT_SDO (0x07 << 27) |
◆ ADF4156_MUXOUT_Z
| #define ADF4156_MUXOUT_Z (0x00 << 27) |
◆ ADF4156_PD
| #define ADF4156_PD ((x & 0x1) << 5) |
◆ ADF4156_PD_POL
| #define ADF4156_PD_POL |
( |
| x | ) |
|
◆ ADF4156_PHASE_VAL
| #define ADF4156_PHASE_VAL |
( |
| x | ) |
|
◆ ADF4156_PRESCALER
| #define ADF4156_PRESCALER |
( |
| x | ) |
|
◆ ADF4156_R0_CTRL
| #define ADF4156_R0_CTRL 0x00 |
◆ ADF4156_R1_CTRL
| #define ADF4156_R1_CTRL 0x01 |
◆ ADF4156_R2_CTRL
| #define ADF4156_R2_CTRL 0x02 |
◆ ADF4156_R3_CTRL
| #define ADF4156_R3_CTRL 0x03 |
◆ ADF4156_R4_CTRL
| #define ADF4156_R4_CTRL 0x04 |
◆ ADF4156_R_CNT
| #define ADF4156_R_CNT |
( |
| x | ) |
|
◆ ADF4156_RDIV2
| #define ADF4156_RDIV2 |
( |
| x | ) |
|
◆ ADF4156_REF_DBL
| #define ADF4156_REF_DBL |
( |
| x | ) |
|
◆ ADF4156_REG0
◆ ADF4156_REG1
◆ ADF4156_REG2
◆ ADF4156_REG3
◆ ADF4156_REG4
◆ ADF4156_SIG_DEL_RST
| #define ADF4156_SIG_DEL_RST |
( |
| x | ) |
|
◆ adf4156_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.
◆ adf4156_remove()
Free the resources allocated by adf4156_init().
- Parameters
-
| dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ adf4156_set()
| int8_t adf4156_set |
( |
struct adf4156_dev * | dev, |
|
|
uint32_t | value ) |
Transmits 32 bits on SPI.
- Parameters
-
| dev | - The device structure. |
| value | - Data which will be transmitted. |
◆ adf4156_set_freq()
| double adf4156_set_freq |
( |
struct adf4156_dev * | dev, |
|
|
double | freq ) |
Sets the ADF4156 output frequency.
- Parameters
-
| dev | - The device structure. |
| freq | - The desired frequency value. |
- Returns
- calculatedFrequency - The actual frequency value that was set.
◆ adf4156_tune_r_cnt()
| 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.
- 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.