no-OS
Functions
axi_adc_core.c File Reference

Driver for the Analog Devices AXI-ADC-CORE module. More...

#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "no_os_error.h"
#include "no_os_delay.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
#include "axi_adc_core.h"
#include "no_os_axi_io.h"
Include dependency graph for axi_adc_core.c:

Functions

int32_t axi_adc_read (struct axi_adc *adc, uint32_t reg_addr, uint32_t *reg_data)
 AXI ADC Data read. More...
 
int32_t axi_adc_write (struct axi_adc *adc, uint32_t reg_addr, uint32_t reg_data)
 AXI ADC Data Write. More...
 
int32_t axi_slave_adc_read (struct axi_adc *adc, uint32_t reg_addr, uint32_t *reg_data)
 Slave AXI ADC Data read. More...
 
int32_t axi_slave_adc_write (struct axi_adc *adc, uint32_t reg_addr, uint32_t reg_data)
 Slave AXI ADC Data Write. More...
 
int32_t axi_adc_set_pnsel (struct axi_adc *adc, uint32_t chan, enum axi_adc_pn_sel sel)
 Set AXI ADC PN sequence. More...
 
int32_t axi_adc_pn_mon (struct axi_adc *adc, enum axi_adc_pn_sel sel, uint32_t delay_ms)
 Monitor the AXI ADC PN Sequence. More...
 
int32_t axi_adc_get_sampling_freq (struct axi_adc *adc, uint32_t chan, uint64_t *sampling_freq)
 Get the AXI ADC Sampling Frequency. More...
 
void axi_adc_idelay_set (struct axi_adc *adc, uint32_t lane, uint32_t val)
 Set input/output delay primitive for specific interface line. More...
 
int32_t axi_adc_delay_set (struct axi_adc *adc, uint32_t no_of_lanes, uint32_t delay)
 Set input/output delay primitive for number of lines. More...
 
int32_t axi_adc_delay_calibrate (struct axi_adc *adc, uint32_t no_of_lanes, enum axi_adc_pn_sel sel)
 Calibrate Delay using specific PN sequence. More...
 
int32_t axi_adc_set_calib_phase_scale (struct axi_adc *adc, uint32_t phase, uint32_t chan, int32_t val, int32_t val2)
 Calibrate phase for specific AXI ADC channel. More...
 
int32_t axi_adc_get_calib_phase_scale (struct axi_adc *adc, uint32_t phase, uint32_t chan, int32_t *val, int32_t *val2)
 Get the phase calibration values for AXI ADC channel. More...
 
int32_t axi_adc_set_calib_phase (struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
 Calibrate phase for specific AXI ADC channel. More...
 
int32_t axi_adc_get_calib_phase (struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
 Get the phase calibration values for AXI ADC channel. More...
 
int32_t axi_adc_set_calib_scale (struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
 Calibrate scale for specific AXI ADC channel. More...
 
int32_t axi_adc_get_calib_scale (struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
 Get the scale calibration values for AXI ADC channel. More...
 
int32_t axi_adc_set_calib_bias (struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
 Calibrate bias for specific AXI ADC channel. More...
 
int32_t axi_adc_get_calib_bias (struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
 Get the scale calibration values for AXI ADC channel. More...
 
int32_t axi_adc_update_active_channels (struct axi_adc *adc, uint32_t mask)
 Update active AXI ADC channels. More...
 
int32_t axi_adc_init_begin (struct axi_adc **adc_core, const struct axi_adc_init *init)
 Begin AXI ADC Initialization. More...
 
int32_t axi_adc_init_finish (struct axi_adc *adc)
 Begin AXI ADC Initialization. More...
 
int32_t axi_adc_init (struct axi_adc **adc_core, const struct axi_adc_init *init)
 AXI ADC Main Initialization. More...
 
int32_t axi_adc_remove (struct axi_adc *adc)
 AXI ADC Resources deallocation. More...
 

Detailed Description

Driver for the Analog Devices AXI-ADC-CORE module.

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.

Function Documentation

◆ axi_adc_delay_calibrate()

int32_t axi_adc_delay_calibrate ( struct axi_adc adc,
uint32_t  no_of_lanes,
enum axi_adc_pn_sel  sel 
)

Calibrate Delay using specific PN sequence.

Parameters
adc- The device structure.
no_of_lanes- The AXI ADC number of lanes.
sel- PN sequence.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_delay_set()

int32_t axi_adc_delay_set ( struct axi_adc adc,
uint32_t  no_of_lanes,
uint32_t  delay 
)

Set input/output delay primitive for number of lines.

Parameters
adc- The device structure.
no_of_lanes- The AXI ADC number of lanes.
delay- Delay value.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_get_calib_bias()

int32_t axi_adc_get_calib_bias ( struct axi_adc adc,
uint32_t  chan,
int32_t *  val,
int32_t *  val2 
)

Get the scale calibration values for AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_get_calib_phase()

int32_t axi_adc_get_calib_phase ( struct axi_adc adc,
uint32_t  chan,
int32_t *  val,
int32_t *  val2 
)

Get the phase calibration values for AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_get_calib_phase_scale()

int32_t axi_adc_get_calib_phase_scale ( struct axi_adc adc,
uint32_t  phase,
uint32_t  chan,
int32_t *  val,
int32_t *  val2 
)

Get the phase calibration values for AXI ADC channel.

Parameters
adc- The device structure.
phase- The AXI ADC phase value.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_get_calib_scale()

int32_t axi_adc_get_calib_scale ( struct axi_adc adc,
uint32_t  chan,
int32_t *  val,
int32_t *  val2 
)

Get the scale calibration values for AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_get_sampling_freq()

int32_t axi_adc_get_sampling_freq ( struct axi_adc adc,
uint32_t  chan,
uint64_t *  sampling_freq 
)

Get the AXI ADC Sampling Frequency.

Parameters
adc- The device structure.
chan- The AXI ADC channel.
sampling_freq- Sampling frequency value.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_idelay_set()

void axi_adc_idelay_set ( struct axi_adc adc,
uint32_t  lane,
uint32_t  val 
)

Set input/output delay primitive for specific interface line.

Parameters
adc- The device structure.
lane- The AXI ADC interface line.
val- Delay value.
Here is the caller graph for this function:

◆ axi_adc_init()

int32_t axi_adc_init ( struct axi_adc **  adc_core,
const struct axi_adc_init init 
)

AXI ADC Main Initialization.

Parameters
adc_core- The device structure.
init- Initialization parameters.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_init_begin()

int32_t axi_adc_init_begin ( struct axi_adc **  adc_core,
const struct axi_adc_init init 
)

Begin AXI ADC Initialization.

Parameters
adc_core- The device structure.
init- Initialization parameters.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_init_finish()

int32_t axi_adc_init_finish ( struct axi_adc adc)

Begin AXI ADC Initialization.

Parameters
adc- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_pn_mon()

int32_t axi_adc_pn_mon ( struct axi_adc adc,
enum axi_adc_pn_sel  sel,
uint32_t  delay_ms 
)

Monitor the AXI ADC PN Sequence.

Parameters
adc- The device structure.
sel- PN sequence.
delay_ms- Delay in ms.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_read()

int32_t axi_adc_read ( struct axi_adc adc,
uint32_t  reg_addr,
uint32_t *  reg_data 
)

AXI ADC Data read.

Parameters
adc- The device structure.
reg_addr- The register address.
reg_data- Read data value.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_remove()

int32_t axi_adc_remove ( struct axi_adc adc)

AXI ADC Resources deallocation.

Parameters
adc- The device structure.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_set_calib_bias()

int32_t axi_adc_set_calib_bias ( struct axi_adc adc,
uint32_t  chan,
int32_t  val,
int32_t  val2 
)

Calibrate bias for specific AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_set_calib_phase()

int32_t axi_adc_set_calib_phase ( struct axi_adc adc,
uint32_t  chan,
int32_t  val,
int32_t  val2 
)

Calibrate phase for specific AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_set_calib_phase_scale()

int32_t axi_adc_set_calib_phase_scale ( struct axi_adc adc,
uint32_t  phase,
uint32_t  chan,
int32_t  val,
int32_t  val2 
)

Calibrate phase for specific AXI ADC channel.

Parameters
adc- The device structure.
phase- The AXI ADC phase value.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_set_calib_scale()

int32_t axi_adc_set_calib_scale ( struct axi_adc adc,
uint32_t  chan,
int32_t  val,
int32_t  val2 
)

Calibrate scale for specific AXI ADC channel.

Parameters
adc- The device structure.
chan- AXI ADC channel.
val- Integer value
val2- Fractional value
Returns
Returns 0 in case of success or negative error code otherwise.

◆ axi_adc_set_pnsel()

int32_t axi_adc_set_pnsel ( struct axi_adc adc,
uint32_t  chan,
enum axi_adc_pn_sel  sel 
)

Set AXI ADC PN sequence.

Parameters
adc- The device structure.
chan- The AXI ADC channel.
sel- PN sequence.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_update_active_channels()

int32_t axi_adc_update_active_channels ( struct axi_adc adc,
uint32_t  mask 
)

Update active AXI ADC channels.

Parameters
adc- The device structure.
mask- Channel mask.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_adc_write()

int32_t axi_adc_write ( struct axi_adc adc,
uint32_t  reg_addr,
uint32_t  reg_data 
)

AXI ADC Data Write.

Parameters
adc- The device structure.
reg_addr- The register address.
reg_data- Data value to be written.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_slave_adc_read()

int32_t axi_slave_adc_read ( struct axi_adc adc,
uint32_t  reg_addr,
uint32_t *  reg_data 
)

Slave AXI ADC Data read.

Parameters
adc- The device structure.
reg_addr- The register address.
reg_data- Read data value.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ axi_slave_adc_write()

int32_t axi_slave_adc_write ( struct axi_adc adc,
uint32_t  reg_addr,
uint32_t  reg_data 
)

Slave AXI ADC Data Write.

Parameters
adc- The device structure.
reg_addr- The register address.
reg_data- Data value to be written.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function: