Implementation of ADF4157 Driver for Microblaze processor.
More...
#include <stdlib.h>
#include "adf4157.h"
#include "adf4157_cfg.h"
#include "no_os_alloc.h"
Implementation 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_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.