no-OS
Macros | Functions
altera_adxcvr.c File Reference

Driver for the Altera ADXCVR Configuration. More...

#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "io.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "altera_a10_atx_pll.h"
#include "altera_a10_cdr_pll.h"
#include "altera_adxcvr.h"
Include dependency graph for altera_adxcvr.c:

Macros

#define ADXCVR_REG_VERSION   0x0000
 
#define VERSION(major, minor, letter)   ((major << 16) | (minor << 8) | letter)
 
#define VERSION_MAJOR(version)   (version >> 16)
 
#define VERSION_MINOR(version)   ((version >> 8) & 0xff)
 
#define VERSION_LETTER(version)   (version & 0xff)
 
#define ADXCVR_REG_ID   0x0004
 
#define ADXCVR_REG_SCRATCH   0x0008
 
#define ADXCVR_REG_RESETN   0x0010
 
#define ADXCVR_RESETN   (1 << 0)
 
#define ADXCVR_REG_STATUS   0x0014
 
#define ADXCVR_STATUS   (1 << 0)
 
#define ADXCVR_REG_STATUS2   0x0018
 
#define ADXCVR_STATUS2_XCVR(x)   NO_OS_BIT(x)
 
#define ADXCVR_REG_SYNTH_CONF   0x0024
 

Functions

int32_t adxcvr_write (struct adxcvr *xcvr, uint32_t reg_addr, uint32_t reg_val)
 adxcvr_write More...
 
int32_t adxcvr_read (struct adxcvr *xcvr, uint32_t reg_addr, uint32_t *reg_val)
 adxcvr_read More...
 
void adxcvr_acquire_arbitration (struct adxcvr *xcvr, uint32_t addr, uint32_t status_reg)
 adxcvr_acquire_arbitration More...
 
void adxcvr_release_arbitration (uint32_t addr, bool calibrate)
 adxcvr_release_arbitration More...
 
int32_t atx_pll_write (struct adxcvr *xcvr, uint32_t reg, uint32_t val)
 atx_pll_write More...
 
int32_t atx_pll_read (struct adxcvr *xcvr, uint32_t reg, uint32_t *val)
 atx_pll_read More...
 
void atx_pll_update (struct adxcvr *xcvr, uint32_t reg, uint32_t mask, uint32_t val)
 atx_pll_update More...
 
void atx_pll_acquire_arbitration (struct adxcvr *xcvr)
 atx_pll_acquire_arbitration More...
 
void atx_pll_release_arbitration (struct adxcvr *xcvr, bool calibrate)
 atx_pll_release_arbitration More...
 
int32_t adxcfg_write (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t val)
 adxcfg_write More...
 
int32_t adxcfg_read (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t *val)
 adxcfg_read More...
 
void adxcfg_update (struct adxcvr *xcvr, uint32_t lane, uint32_t reg, uint32_t mask, uint32_t val)
 adxcfg_update More...
 
void adxcfg_acquire_arbitration (struct adxcvr *xcvr, uint32_t lane)
 adxcfg_acquire_arbitration More...
 
void adxcfg_release_arbitration (struct adxcvr *xcvr, uint32_t lane, bool calibrate)
 adxcfg_release_arbitration More...
 
int32_t atx_pll_calibration_check (struct adxcvr *xcvr)
 atx_pll_calibration_check More...
 
int32_t adxcfg_calibration_check (struct adxcvr *xcvr, uint32_t lane, bool tx)
 adxcfg_calibration_check More...
 
int32_t xcvr_calib_tx (struct adxcvr *xcvr)
 xcvr_calib_tx More...
 
void adxcvr_pre_lane_rate_change (struct adxcvr *xcvr)
 adxcvr_pre_lane_rate_change More...
 
void adxcvr_finalize_lane_rate_change (struct adxcvr *xcvr)
 adxcvr_finalize_lane_rate_change More...
 
void adxcvr_post_lane_rate_change (struct adxcvr *xcvr, unsigned int lane_rate_khz)
 adxcvr_post_lane_rate_change More...
 
int32_t adxcvr_round_rate (struct adxcvr *xcvr, uint32_t rate_khz)
 adxcvr_round_rate More...
 
int32_t adxcvr_set_rate (struct adxcvr *xcvr, uint32_t rate_khz)
 adxcvr_init More...
 
uint32_t adxcvr_recalc_rate (struct adxcvr *xcvr)
 adxcvr_recalc_rate More...
 
int32_t adxcvr_init (struct adxcvr **ad_xcvr, const struct adxcvr_init *init)
 adxcvr_init More...
 
int32_t adxcvr_remove (struct adxcvr *xcvr)
 adxcvr_remove More...
 

Detailed Description

Driver for the Altera ADXCVR Configuration.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2018(c) Analog Devices, Inc.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

Macro Definition Documentation

◆ ADXCVR_REG_ID

#define ADXCVR_REG_ID   0x0004

◆ ADXCVR_REG_RESETN

#define ADXCVR_REG_RESETN   0x0010

◆ ADXCVR_REG_SCRATCH

#define ADXCVR_REG_SCRATCH   0x0008

◆ ADXCVR_REG_STATUS

#define ADXCVR_REG_STATUS   0x0014

◆ ADXCVR_REG_STATUS2

#define ADXCVR_REG_STATUS2   0x0018

◆ ADXCVR_REG_SYNTH_CONF

#define ADXCVR_REG_SYNTH_CONF   0x0024

◆ ADXCVR_REG_VERSION

#define ADXCVR_REG_VERSION   0x0000

◆ ADXCVR_RESETN

#define ADXCVR_RESETN   (1 << 0)

◆ ADXCVR_STATUS

#define ADXCVR_STATUS   (1 << 0)

◆ ADXCVR_STATUS2_XCVR

#define ADXCVR_STATUS2_XCVR (   x)    NO_OS_BIT(x)

◆ VERSION

#define VERSION (   major,
  minor,
  letter 
)    ((major << 16) | (minor << 8) | letter)

◆ VERSION_LETTER

#define VERSION_LETTER (   version)    (version & 0xff)

◆ VERSION_MAJOR

#define VERSION_MAJOR (   version)    (version >> 16)

◆ VERSION_MINOR

#define VERSION_MINOR (   version)    ((version >> 8) & 0xff)

Function Documentation

◆ adxcfg_acquire_arbitration()

void adxcfg_acquire_arbitration ( struct adxcvr xcvr,
uint32_t  lane 
)

adxcfg_acquire_arbitration

Here is the caller graph for this function:

◆ adxcfg_calibration_check()

int32_t adxcfg_calibration_check ( struct adxcvr xcvr,
uint32_t  lane,
bool  tx 
)

adxcfg_calibration_check

Here is the caller graph for this function:

◆ adxcfg_read()

int32_t adxcfg_read ( struct adxcvr xcvr,
uint32_t  lane,
uint32_t  reg,
uint32_t *  val 
)

adxcfg_read

Here is the caller graph for this function:

◆ adxcfg_release_arbitration()

void adxcfg_release_arbitration ( struct adxcvr xcvr,
uint32_t  lane,
bool  calibrate 
)

adxcfg_release_arbitration

Here is the caller graph for this function:

◆ adxcfg_update()

void adxcfg_update ( struct adxcvr xcvr,
uint32_t  lane,
uint32_t  reg,
uint32_t  mask,
uint32_t  val 
)

adxcfg_update

Here is the caller graph for this function:

◆ adxcfg_write()

int32_t adxcfg_write ( struct adxcvr xcvr,
uint32_t  lane,
uint32_t  reg,
uint32_t  val 
)

adxcfg_write

Here is the caller graph for this function:

◆ adxcvr_acquire_arbitration()

void adxcvr_acquire_arbitration ( struct adxcvr xcvr,
uint32_t  addr,
uint32_t  status_reg 
)

adxcvr_acquire_arbitration

Here is the caller graph for this function:

◆ adxcvr_finalize_lane_rate_change()

void adxcvr_finalize_lane_rate_change ( struct adxcvr xcvr)

adxcvr_finalize_lane_rate_change

Here is the caller graph for this function:

◆ adxcvr_init()

int32_t adxcvr_init ( struct adxcvr **  ad_xcvr,
const struct adxcvr_init init 
)

adxcvr_init

AXI ADXCVR Device Initialization

Here is the caller graph for this function:

◆ adxcvr_post_lane_rate_change()

void adxcvr_post_lane_rate_change ( struct adxcvr xcvr,
unsigned int  lane_rate_khz 
)

adxcvr_post_lane_rate_change

Here is the caller graph for this function:

◆ adxcvr_pre_lane_rate_change()

void adxcvr_pre_lane_rate_change ( struct adxcvr xcvr)

adxcvr_pre_lane_rate_change

Here is the caller graph for this function:

◆ adxcvr_read()

int32_t adxcvr_read ( struct adxcvr xcvr,
uint32_t  reg_addr,
uint32_t *  reg_val 
)

adxcvr_read

AXI ADXCVR Read

Here is the caller graph for this function:

◆ adxcvr_recalc_rate()

uint32_t adxcvr_recalc_rate ( struct adxcvr xcvr)

adxcvr_recalc_rate

◆ adxcvr_release_arbitration()

void adxcvr_release_arbitration ( uint32_t  addr,
bool  calibrate 
)

adxcvr_release_arbitration

Here is the caller graph for this function:

◆ adxcvr_remove()

int32_t adxcvr_remove ( struct adxcvr xcvr)

adxcvr_remove

AXI ADXCVR Resources Deallocation

Here is the caller graph for this function:

◆ adxcvr_round_rate()

int32_t adxcvr_round_rate ( struct adxcvr xcvr,
uint32_t  rate_khz 
)

adxcvr_round_rate

Here is the caller graph for this function:

◆ adxcvr_set_rate()

int32_t adxcvr_set_rate ( struct adxcvr xcvr,
uint32_t  rate_khz 
)

adxcvr_init

Here is the caller graph for this function:

◆ adxcvr_write()

int32_t adxcvr_write ( struct adxcvr xcvr,
uint32_t  reg_addr,
uint32_t  reg_val 
)

adxcvr_write

AXI ADXCVR Write

Here is the caller graph for this function:

◆ atx_pll_acquire_arbitration()

void atx_pll_acquire_arbitration ( struct adxcvr xcvr)

atx_pll_acquire_arbitration

Here is the caller graph for this function:

◆ atx_pll_calibration_check()

int32_t atx_pll_calibration_check ( struct adxcvr xcvr)

atx_pll_calibration_check

◆ atx_pll_read()

int32_t atx_pll_read ( struct adxcvr xcvr,
uint32_t  reg,
uint32_t *  val 
)

atx_pll_read

Here is the caller graph for this function:

◆ atx_pll_release_arbitration()

void atx_pll_release_arbitration ( struct adxcvr xcvr,
bool  calibrate 
)

atx_pll_release_arbitration

Here is the caller graph for this function:

◆ atx_pll_update()

void atx_pll_update ( struct adxcvr xcvr,
uint32_t  reg,
uint32_t  mask,
uint32_t  val 
)

atx_pll_update

◆ atx_pll_write()

int32_t atx_pll_write ( struct adxcvr xcvr,
uint32_t  reg,
uint32_t  val 
)

atx_pll_write

Here is the caller graph for this function:

◆ xcvr_calib_tx()

int32_t xcvr_calib_tx ( struct adxcvr xcvr)

xcvr_calib_tx