no-OS
Macros | Functions | Variables
adf4106.c File Reference
#include <stdlib.h>
#include "adf4106.h"
Include dependency graph for adf4106.c:

Macros

#define DATA_MASK_MSB8   0xFF0000
 
#define DATA_OFFSET_MSB8   16
 
#define DATA_MASK_MID8   0xFF00
 
#define DATA_OFFSET_MID8   8
 
#define DATA_MASK_LSB8   0xFF
 
#define DATA_OFFSET_LSB8   0
 
#define ADDRESS_MASK   3
 
#define FREQ_2_4_GHZ   2400000000u
 
#define FREQ_5_2_GHZ   5200000000u
 

Functions

int8_t adf4106_init (struct adf4106_dev **device, struct adf4106_init_param init_param)
 Initialize SPI and Initial Values for ADF4106 Board. More...
 
int32_t adf4106_remove (struct adf4106_dev *dev)
 Free the resources allocated by adf4106_init(). More...
 
void adf4106_update_latch (struct adf4106_dev *dev, uint32_t latch_data)
 Update one of the latch via the SPI interface. More...
 
void adf4106_init_latch_method (struct adf4106_dev *dev)
 Initialization latch method. More...
 
void adf4106_init_cepin_method (struct adf4106_dev *dev)
 CE Pin method. More...
 
void adf4106_init_counte_reset_method (struct adf4106_dev *dev)
 Counter reset method. More...
 
uint32_t adf4106_read_latch (struct adf4106_dev *dev, uint8_t latch_type)
 Return the value of a desired latch. More...
 
uint16_t adf4106_tune_rcounter (struct adf4106_dev *dev, uint16_t r_counter)
 Increases the R counter value until the ADF4106_PDF_MAX_FREQ is greater than PFD frequency. More...
 
uint64_t adf4106_set_frequency (struct adf4106_dev *dev, uint64_t frequency)
 Sets the output frequency. More...
 

Variables

const struct adf4106_chip_info chip_info []
 

Macro Definition Documentation

◆ ADDRESS_MASK

#define ADDRESS_MASK   3

◆ DATA_MASK_LSB8

#define DATA_MASK_LSB8   0xFF

◆ DATA_MASK_MID8

#define DATA_MASK_MID8   0xFF00

◆ DATA_MASK_MSB8

#define DATA_MASK_MSB8   0xFF0000

◆ DATA_OFFSET_LSB8

#define DATA_OFFSET_LSB8   0

◆ DATA_OFFSET_MID8

#define DATA_OFFSET_MID8   8

◆ DATA_OFFSET_MSB8

#define DATA_OFFSET_MSB8   16

◆ FREQ_2_4_GHZ

#define FREQ_2_4_GHZ   2400000000u

◆ FREQ_5_2_GHZ

#define FREQ_5_2_GHZ   5200000000u

Function Documentation

◆ adf4106_init()

int8_t adf4106_init ( struct adf4106_dev **  device,
struct adf4106_init_param  init_param 
)

Initialize SPI and Initial Values for ADF4106 Board.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
success

◆ adf4106_init_cepin_method()

void adf4106_init_cepin_method ( struct adf4106_dev dev)

CE Pin method.

Parameters
dev- The device structure.
Returns
Here is the caller graph for this function:

◆ adf4106_init_counte_reset_method()

void adf4106_init_counte_reset_method ( struct adf4106_dev dev)

Counter reset method.

Parameters
dev- The device structure.
Returns
Here is the caller graph for this function:

◆ adf4106_init_latch_method()

void adf4106_init_latch_method ( struct adf4106_dev dev)

Initialization latch method.

Parameters
dev- The device structure.
Returns
Here is the caller graph for this function:

◆ adf4106_read_latch()

uint32_t adf4106_read_latch ( struct adf4106_dev dev,
uint8_t  latch_type 
)

Return the value of a desired latch.

Parameters
dev- The device structure.
latch_type- the type of the latch: 0 - 'ADF4106_CTRL_R_COUNTER' 1 - 'ADF4106_CTRL_N_COUNTER' 2 - 'ADF4106_CTRL_FUNCTION_LATCH' 3 - 'ADF4106_CTRL_INIT_LATCH'
Returns
latchValue - the value of the desired latch

◆ adf4106_remove()

int32_t adf4106_remove ( struct adf4106_dev dev)

Free the resources allocated by adf4106_init().

Parameters
dev- The device structure.
Returns
SUCCESS in case of success, negative error code otherwise.

◆ adf4106_set_frequency()

uint64_t adf4106_set_frequency ( struct adf4106_dev dev,
uint64_t  frequency 
)

Sets the output frequency.

Parameters
dev- The device structure.
frequency- The desired frequency value.
Returns
calculatedFrequency - The actual frequency value that was set.

◆ adf4106_tune_rcounter()

uint16_t adf4106_tune_rcounter ( struct adf4106_dev dev,
uint16_t  r_counter 
)

Increases the R counter value until the ADF4106_PDF_MAX_FREQ is greater than PFD frequency.

Parameters
dev- The device structure.
r_counter- R counter value.
Returns
rCounter - modified R counter value.
Here is the caller graph for this function:

◆ adf4106_update_latch()

void adf4106_update_latch ( struct adf4106_dev dev,
uint32_t  latch_data 
)

Update one of the latch via the SPI interface.

Parameters
dev- The device structure.
latch_data- the data which will be written to the latch
Returns
Here is the caller graph for this function:

Variable Documentation

◆ chip_info

const struct adf4106_chip_info chip_info[]
Initial value:
= {
[ID_ADF4001] = {
.vco_max_frequency = 200000000,
.pfd_max_frequency = 55000000,
.vco_min_frequency = 5000000,
.pfd_min_frequency = 5000000,
},
[ID_ADF4002] = {
.vco_max_frequency = 400000000,
.pfd_max_frequency = 104000000,
.vco_min_frequency = 5000000,
.pfd_min_frequency = 20000000,
},
[ID_ADF4106] = {
.vco_max_frequency = 6000000000,
.pfd_max_frequency = 104000000,
.vco_min_frequency = 500000000,
.pfd_min_frequency = 20000000,
}
}
ID_ADF4106
@ ID_ADF4106
Definition: adf4106.h:332
ID_ADF4002
@ ID_ADF4002
Definition: adf4106.h:331
ID_ADF4001
@ ID_ADF4001
Definition: adf4106.h:330