no-OS
|
Implementation of ADF4156 Driver for Microblaze processor. More...
#include <stdio.h>
#include <stdlib.h>
#include "adf4156.h"
#include "adf4156_cfg.h"
#include "no_os_alloc.h"
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... | |
Implementation of ADF4156 Driver for Microblaze processor.
Copyright 2013(c) Analog Devices, Inc.
All rights reserved.
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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.
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.