forked from 0xha0/datalink_repo
Initial version.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,89 @@
|
||||
#include "dev_profile.h"
|
||||
#include "../config/app_config.h"
|
||||
#include "../adi_noos/drivers/frequency/ad9516/ad9516.h"
|
||||
|
||||
|
||||
static spi_init_param ad9516_spi_init = {
|
||||
.device_id = SPI_DEVICE_ID,
|
||||
.max_speed_hz = SPI_ENGINE_MAX_SPEED,
|
||||
.mode = SPI_MODE_4,
|
||||
.chip_select = SPI_CS_AD9516,
|
||||
.platform_ops = SPI_OPS,
|
||||
.extra = SPI_PARAM
|
||||
};
|
||||
|
||||
struct ad9516_init_param ad9516_default_init_param = {
|
||||
/* SPI */
|
||||
.spi_init = &ad9516_spi_init
|
||||
};
|
||||
|
||||
const uint32_t ad9516_default_config_len = 66;
|
||||
const struct ad9516_config ad9516_default_config[] = {
|
||||
{0x0000,0x18}, // 16-bit instruction, MSB first, 3-wire SPI
|
||||
{0x0004,0x00}, // reads back buffer registers
|
||||
{0x0010,0x7C},
|
||||
{0x0011,0x04}, // R divider LSBs, R = 4
|
||||
{0x0012,0x00}, // R divider MSBs, R = 4
|
||||
{0x0013,0x08}, // A counter, A = 8
|
||||
{0x0014,0x09}, // B counter LSBs, B = 9
|
||||
{0x0015,0x00}, // B counter MSBs, B = 9
|
||||
{0x0016,0x04}, // Divide-by-8 (8/9 mode)
|
||||
{0x0017,0x10}, // STATUS pin output: Prescaler output
|
||||
{0x0018,0x06},
|
||||
{0x0019,0x80}, // R, A, B counters synchronous reset on SYNCB
|
||||
{0x001A,0x00}, // LD pin output: Digital lock detect (high = lock, low = unlock)
|
||||
{0x001B,0xA1}, // enables VCO, REF1 frequency monitor; REFMON pin output: REF1 clock
|
||||
{0x001C,0x07}, // selects REF1; REF1, REF2 power on; differential reference mode
|
||||
{0x001D,0x00},
|
||||
{0x001E,0x00},
|
||||
{0x00A0,0x01},
|
||||
{0x00A1,0x00},
|
||||
{0x00A2,0x00},
|
||||
{0x00A3,0x01},
|
||||
{0x00A4,0x00},
|
||||
{0x00A5,0x00},
|
||||
{0x00A6,0x01},
|
||||
{0x00A7,0x00},
|
||||
{0x00A8,0x00},
|
||||
{0x00A9,0x01},
|
||||
{0x00AA,0x00},
|
||||
{0x00AB,0x00},
|
||||
{0x00F0,0x08},
|
||||
{0x00F1,0x08},
|
||||
{0x00F2,0x08},
|
||||
{0x00F3,0x08},
|
||||
{0x00F4,0x08},
|
||||
{0x00F5,0x08},
|
||||
{0x0140,0x59},
|
||||
{0x0141,0x5A},
|
||||
{0x0142,0x5A},
|
||||
{0x0143,0x42},
|
||||
{0x0190,0x33},
|
||||
{0x0191,0x40},
|
||||
{0x0192,0x00},
|
||||
{0x0193,0x33},
|
||||
{0x0194,0x40},
|
||||
{0x0195,0x00},
|
||||
{0x0196,0x44},
|
||||
{0x0197,0x40},
|
||||
{0x0198,0x00},
|
||||
{0x0199,0x99}, // divider 3.1, Low Cycles = 10, High Cycles = 10
|
||||
{0x019A,0x00},
|
||||
{0x019B,0x00}, // divider 3.1, Low Cycles = 1, High Cycles = 1
|
||||
{0x019C,0x00},
|
||||
{0x019D,0x00},
|
||||
// {0x019E,0xFF},
|
||||
{0x019E,0x11},
|
||||
{0x019F,0x00},
|
||||
{0x01A0,0x11},
|
||||
{0x01A1,0x20},
|
||||
{0x01A2,0x00},
|
||||
{0x01A3,0x00},
|
||||
{0x01E0,0x00},
|
||||
{0x01E1,0x02},
|
||||
{0x0230,0x00},
|
||||
{0x0231,0x00},
|
||||
{0x0232,0x01}, // Update all registers
|
||||
{0x0018,0x07}, // initiate the VCO calibration
|
||||
{0x0232,0x01} // Update all registers
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef DEV_PROFILE_H_
|
||||
#define DEV_PROFILE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "../config/app_config.h"
|
||||
#include "../adi_noos/include/spi.h"
|
||||
#include "../adi_noos/include/gpio.h"
|
||||
#include "../adi_noos/include/delay.h"
|
||||
#include "../adi_noos/include/irq.h"
|
||||
#include "../adi_noos/include/error.h"
|
||||
#include "../adi_noos/drivers/rf-transceiver/ad9361_reg/ad9361_reg.h"
|
||||
#include "../adi_noos/drivers/frequency/ad9516/ad9516.h"
|
||||
|
||||
// Platform includes
|
||||
#include "../adi_noos/drivers/platform/spi_extra.h"
|
||||
#include "../adi_noos/drivers/platform/gpio_extra.h"
|
||||
#include "../adi_noos/drivers/platform/irq_extra.h"
|
||||
|
||||
// AXI-Cores includes
|
||||
#include "../adi_noos/drivers/axi_core/spi_engine/spi_engine.h"
|
||||
|
||||
// Declare in mian.c
|
||||
extern struct spi_engine_init_param spi_engine_param;
|
||||
extern struct xil_gpio_init_param xil_gpio_param;
|
||||
|
||||
#define GPIO_PARAM &xil_gpio_param
|
||||
#define SPI_PARAM &spi_engine_param
|
||||
#define GPIO_OPS &xil_gpio_ops
|
||||
#define SPI_OPS &spi_eng_platform_ops
|
||||
|
||||
extern struct ad9516_init_param ad9516_default_init_param;
|
||||
extern const struct ad9516_config ad9516_default_config[];
|
||||
extern const uint32_t ad9516_default_config_len;
|
||||
|
||||
extern struct ad9361_reg_init_param ad9361_1_reg_default_init_param;
|
||||
extern struct ad9361_reg_init_param ad9361_2_reg_default_init_param;
|
||||
|
||||
uint32_t ad9361_reg_config(struct ad9361_reg_dev *dev);
|
||||
uint32_t ad9361_1_reg_config(struct ad9361_reg_dev *dev);
|
||||
uint32_t ad9361_2_reg_config(struct ad9361_reg_dev *dev);
|
||||
|
||||
#endif /* SRC_DEV_PROFILE_H_ */
|
||||
Reference in New Issue
Block a user