Implementation of AD9517 Driver. More...
#include <stdlib.h>
#include <errno.h>
#include "no_os_delay.h"
#include "no_os_alloc.h"
#include "ad9517.h"
Functions | |
int32_t | ad9517_setup (struct ad9517_dev **device, struct ad9517_init_param init_param) |
Initializes the AD9517. | |
int32_t | ad9517_remove (struct ad9517_dev *dev) |
Free the resources allocated by ad9517_setup(). | |
int32_t | ad9517_write (struct ad9517_dev *dev, uint32_t reg_addr, uint16_t reg_val) |
Writes data into a register. | |
int32_t | ad9517_read (struct ad9517_dev *dev, uint32_t reg_addr, uint32_t *reg_value) |
Reads data from a register. | |
int32_t | ad9517_update (struct ad9517_dev *dev) |
Transfers the contents of the buffer registers into the active registers. | |
int64_t | ad9517_vco_frequency (struct ad9517_dev *dev, int64_t frequency) |
Sets the VCO frequency. | |
int8_t | dividers_checker (int32_t number) |
Checks if the number can be decomposed into a product of two numbers smaller or equal to 32 each one. | |
int64_t | ad9517_frequency (struct ad9517_dev *dev, int32_t channel, int64_t frequency) |
Sets the frequency on the specified channel. | |
int32_t | ad9517_phase (struct ad9517_dev *dev, int32_t channel, int32_t phase) |
Sets the phase on the specified channel. | |
int32_t | ad9517_power_mode (struct ad9517_dev *dev, int32_t channel, int32_t mode) |
Sets the power mode of the specified channel. | |
Implementation of AD9517 Driver.
Copyright 2012(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.
int64_t ad9517_frequency | ( | struct ad9517_dev * | dev, |
int32_t | channel, | ||
int64_t | frequency ) |
Sets the frequency on the specified channel.
dev | - The device structure. |
channel | - The channel. |
frequency | - The desired frequency value. |
int32_t ad9517_phase | ( | struct ad9517_dev * | dev, |
int32_t | channel, | ||
int32_t | phase ) |
Sets the phase on the specified channel.
dev | - The device structure. |
channel | - The channel. |
phase | - The desired phase value. |
int32_t ad9517_power_mode | ( | struct ad9517_dev * | dev, |
int32_t | channel, | ||
int32_t | mode ) |
Sets the power mode of the specified channel.
dev | - The device structure. |
channel | - The channel. |
mode | - Power mode. |
int32_t ad9517_read | ( | struct ad9517_dev * | dev, |
uint32_t | reg_addr, | ||
uint32_t * | reg_value ) |
Reads data from a register.
dev | - The device structure. |
reg_addr | - The address of the register to be read. |
reg_value | - Pointer to the value to be read from the register. |
int32_t ad9517_remove | ( | struct ad9517_dev * | dev | ) |
Free the resources allocated by ad9517_setup().
dev | - The device structure. |
int32_t ad9517_setup | ( | struct ad9517_dev ** | device, |
struct ad9517_init_param | init_param ) |
Initializes the AD9517.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t ad9517_update | ( | struct ad9517_dev * | dev | ) |
Transfers the contents of the buffer registers into the active registers.
dev | - The device structure. |
int64_t ad9517_vco_frequency | ( | struct ad9517_dev * | dev, |
int64_t | frequency ) |
Sets the VCO frequency.
dev | - The device structure. |
frequency | - The desired frequency value. |
int32_t ad9517_write | ( | struct ad9517_dev * | dev, |
uint32_t | reg_addr, | ||
uint16_t | reg_val ) |
Writes data into a register.
dev | - The device structure. |
reg_addr | - The address of the register to be written. |
reg_val | - The value to be written into the register. |
int8_t dividers_checker | ( | int32_t | number | ) |
Checks if the number can be decomposed into a product of two numbers smaller or equal to 32 each one.
number | - The number. |