#include "adf4350.h"
#include "si5351.h"
#include "custom_spi2.h"
#include "rational.h"
#include "stm32746g_discovery.h"
Macros | |
#define | ADF4350_MIN_OUT_FREQ 137500000ul |
#define | ADF4350_MAX_OUT_FREQ 4294000000ul |
#define | ADF4350_REF_CLK 27000000ul |
#define | ADF4350_FPFD 100000ul |
#define | ADF4350_R_VALUE (ADF4350_REF_CLK / ADF4350_FPFD) |
#define | ADF4350_FVCO_MIN 2200000000ull |
#define | ADF4350_FVCO_MAX 4400000000ull |
Functions | |
void | Sleep (uint32_t) |
static void | adf4350_calc_div (uint32_t fhz, uint32_t *rfdiv_out, uint32_t *div_int, uint32_t *div_frac, uint32_t *div_mod) |
static void | adf4350_SendDW (uint32_t dw, SPI2_Slave_t slave) |
static void | adf4350_SendR4 (uint32_t RF_Out_en, int32_t DBB, SPI2_Slave_t slave) |
Set ADF4350 R4 value. More... | |
static void | adf4350_SendR3 (uint32_t clkdiv, uint32_t clkdivmode, uint32_t csr, SPI2_Slave_t slave) |
Set ADF4350 R3 valueband select clock divider. More... | |
static void | adf4350_SendR2 (uint32_t pwrdown, uint32_t rcounter, SPI2_Slave_t slave) |
Set ADF4350 R2 value. More... | |
static void | adf4350_SendR1 (uint32_t mod, SPI2_Slave_t slave) |
Set ADF4350 R1 value. More... | |
static void | adf4350_SendR0 (uint32_t integ, uint32_t frac, SPI2_Slave_t slave) |
Set ADF4350 R0 value. More... | |
void | adf4350_Init (void) |
Initialize ADF4350 devices. More... | |
void | adf4350_Off (void) |
Turn off RF outputs and turn off clock for both ADF4350 devices. More... | |
void | adf4350_SetF0 (uint32_t fhz) |
Set given frequency at the output of ADF4350 generating F0. More... | |
void | adf4350_SetLO (uint32_t fhz) |
Set given frequency at the output of ADF4350 generating LO. More... | |
#define ADF4350_FPFD 100000ul |
#define ADF4350_FVCO_MAX 4400000000ull |
#define ADF4350_FVCO_MIN 2200000000ull |
#define ADF4350_MAX_OUT_FREQ 4294000000ul |
#define ADF4350_MIN_OUT_FREQ 137500000ul |
#define ADF4350_R_VALUE (ADF4350_REF_CLK / ADF4350_FPFD) |
#define ADF4350_REF_CLK 27000000ul |
|
static |
|
static |
|
static |
Set ADF4350 R0 value.
integ | 16-bit integer value (INT). Must be in the allowed range of 23..65535 (with prescaler 4/5) or 75..65535 (with prescaler 8/9). |
frac | 12-bit fractional value (FRAC) |
slave | SPI2 slave identificator |
|
static |
Set ADF4350 R1 value.
mod | 12-bit modulus (MOD) value |
slave | SPI2 slave identificator |
|
static |
Set ADF4350 R2 value.
pwrdown | 1 to power down device, 0 to power up |
rcounter | 10-bit R counter value (reference divider) |
slave | SPI2 slave identificator |
|
static |
Set ADF4350 R3 valueband select clock divider.
clkdiv | 12-bit clock divider value |
clkdivmode | 2-bit clock divider mode |
csr | 1-bit cycle slip reduction |
slave | SPI2 slave identificator |
|
static |
Set ADF4350 R4 value.
RF_Out_en | 0 to disable RF output, 1 to enable |
DBB | 3-bit RF divider select |
slave | SPI2 slave identificator |
void adf4350_SetF0 | ( | uint32_t | fhz | ) |
Set given frequency at the output of ADF4350 generating F0.
fhz | Desired frequency in Hz |
void adf4350_SetLO | ( | uint32_t | fhz | ) |
Set given frequency at the output of ADF4350 generating LO.
fhz | Desired frequency in Hz |
void Sleep | ( | uint32_t | ) |