no-OS
|
Implementation of adf4377 Driver. More...
#include <malloc.h>
#include "adf4377.h"
#include "no_os_error.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
Functions | |
int32_t | adf4377_spi_write (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t data) |
Writes data to ADF4377 over SPI. More... | |
int32_t | adf4377_spi_write_mask (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data) |
Update ADF4377 register. More... | |
int32_t | adf4377_spi_read (struct adf4377_dev *dev, uint8_t reg_addr, uint8_t *data) |
Reads data from ADF4377 over SPI. More... | |
int32_t | adf4377_check_scratchpad (struct adf4377_dev *dev) |
ADF4377 SPI Scratchpad check. More... | |
int32_t | adf4377_soft_reset (struct adf4377_dev *dev) |
Software reset. More... | |
int32_t | adf4377_set_freq (struct adf4377_dev *dev, uint64_t freq) |
int32_t | adf4377_init (struct adf4377_dev **device, struct adf4377_init_param *init_param) |
Initializes the ADF4377. More... | |
int32_t | adf4377_remove (struct adf4377_dev *dev) |
Free resoulces allocated for ADF4377. More... | |
Implementation of adf4377 Driver.
Copyright 2021(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.
int32_t adf4377_check_scratchpad | ( | struct adf4377_dev * | dev | ) |
ADF4377 SPI Scratchpad check.
dev | - The device structure. |
int32_t adf4377_init | ( | struct adf4377_dev ** | device, |
struct adf4377_init_param * | init_param | ||
) |
Initializes the ADF4377.
device | - The device structure. |
init_param | - The structure containing the device initial parameters. |
int32_t adf4377_remove | ( | struct adf4377_dev * | dev | ) |
Free resoulces allocated for ADF4377.
dev | - The device structure. |
int32_t adf4377_set_freq | ( | struct adf4377_dev * | dev, |
uint64_t | freq | ||
) |
Set the output frequency.
dev | - The device structure. |
freq | - The output frequency. |
Wait for VCO calibration to finish
int32_t adf4377_soft_reset | ( | struct adf4377_dev * | dev | ) |
Software reset.
dev | - The device structure. |
int32_t adf4377_spi_read | ( | struct adf4377_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t * | data | ||
) |
Reads data from ADF4377 over SPI.
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data read from the device. |
int32_t adf4377_spi_write | ( | struct adf4377_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | data | ||
) |
Writes data to ADF4377 over SPI.
dev | - The device structure. |
reg_addr | - The register address. |
data | - Data value to write. |
int32_t adf4377_spi_write_mask | ( | struct adf4377_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | data | ||
) |
Update ADF4377 register.
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Mask for specific register bits to be updated. |
data | - Data written to the device (requires prior bit shifting). |