no-OS
Macros | Functions | Variables
ad7616_sdz.c File Reference

Implementation of Main Function. More...

#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "spi_engine.h"
#include <xil_cache.h>
#include <xparameters.h>
#include "no_os_error.h"
#include "no_os_spi.h"
#include "xilinx_spi.h"
#include "no_os_gpio.h"
#include "xilinx_gpio.h"
#include "ad7616.h"
#include "parameters.h"
#include "no_os_pwm.h"
#include "axi_pwm_extra.h"
#include "clk_axi_clkgen.h"
#include "xil_io.h"
#include "no_os_print_log.h"
Include dependency graph for ad7616_sdz.c:

Macros

#define AD7616_SDZ_SAMPLE_NO   1000
 

Functions

int main (void)
 main More...
 

Variables

struct spi_engine_offload_init_param spi_engine_offload_init_param
 
struct spi_engine_init_param spi_eng_init_param
 
struct axi_clkgen_init clkgen_init
 
struct axi_pwm_init_param axi_pwm_init_params
 
struct no_os_pwm_init_param trigger_pwm_init
 
struct no_os_spi_init_param ad7616_spi_init
 
struct xil_gpio_init_param xil_gpio_param
 
struct no_os_gpio_init_param ad7616_gpio_reset
 
struct ad7616_init_param init_param
 

Detailed Description

Implementation of Main Function.

Author
DBogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2020(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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

◆ AD7616_SDZ_SAMPLE_NO

#define AD7616_SDZ_SAMPLE_NO   1000

Function Documentation

◆ main()

int main ( void  )

main

Variable Documentation

◆ ad7616_gpio_reset

struct no_os_gpio_init_param ad7616_gpio_reset
Initial value:
= {
.number = GPIO_ADC_RESET_N,
.platform_ops = &xil_gpio_ops,
.extra = &xil_gpio_param
}

◆ ad7616_spi_init

struct no_os_spi_init_param ad7616_spi_init
Initial value:
= {
.chip_select = SPI_AD7616_CS,
.max_speed_hz = 50000000,
.platform_ops = &spi_eng_platform_ops,
.extra = (void*)&spi_eng_init_param,
}

◆ axi_pwm_init_params

struct axi_pwm_init_param axi_pwm_init_params
Initial value:
= {
.base_addr = AXI_PWMGEN_BASEADDR,
.ref_clock_Hz = 100000000,
}

◆ clkgen_init

struct axi_clkgen_init clkgen_init
Initial value:
= {
.name = "rx_clkgen",
.parent_rate = 100000000,
}

◆ init_param

struct ad7616_init_param init_param

◆ spi_eng_init_param

struct spi_engine_init_param spi_eng_init_param
Initial value:
= {
.ref_clk_hz = 100000000,
.type = SPI_ENGINE,
.spi_engine_baseaddr = AD7616_SPI_ENGINE_BASEADDR,
.cs_delay = 1,
.data_width = 16,
}

◆ spi_engine_offload_init_param

Initial value:
= {
.offload_config = OFFLOAD_RX_EN,
.rx_dma_baseaddr = AD7616_DMA_BASEADDR,
}

◆ trigger_pwm_init

struct no_os_pwm_init_param trigger_pwm_init
Initial value:
= {
.period_ns = 1000,
.duty_cycle_ns = AD7616_TRIGGER_PULSE_WIDTH_NS,
.platform_ops = &axi_pwm_ops,
}

◆ xil_gpio_param

struct xil_gpio_init_param xil_gpio_param
Initial value:
= {
.device_id = GPIO_DEVICE_ID,
.type = GPIO_PS,
}
SPI_AD7616_CS
#define SPI_AD7616_CS
Definition: parameters.h:44
GPIO_PS
@ GPIO_PS
Definition: xilinx_gpio.h:56
xil_gpio_ops
const struct no_os_gpio_platform_ops xil_gpio_ops
Xilinx platform specific GPIO platform ops structure.
Definition: xilinx_gpio.c:450
xil_gpio_param
struct xil_gpio_init_param xil_gpio_param
Definition: ad7616_sdz.c:103
NO_OS_SPI_MODE_2
@ NO_OS_SPI_MODE_2
Definition: no_os_spi.h:65
axi_pwm_ops
const struct no_os_pwm_platform_ops axi_pwm_ops
AXI platform specific PWM platform ops structure.
Definition: axi_pwm.c:406
AD7616_RX_CLKGEN_BASEADDR
#define AD7616_RX_CLKGEN_BASEADDR
Definition: parameters.h:42
AD7616_TRIGGER_PULSE_WIDTH_NS
#define AD7616_TRIGGER_PULSE_WIDTH_NS
Definition: ad7616.h:109
GPIO_DEVICE_ID
#define GPIO_DEVICE_ID
Definition: parameters.h:87
NO_OS_PWM_POLARITY_HIGH
@ NO_OS_PWM_POLARITY_HIGH
Definition: no_os_pwm.h:57
spi_eng_init_param
struct spi_engine_init_param spi_eng_init_param
Definition: ad7616_sdz.c:68
SPI_ENGINE
@ SPI_ENGINE
Definition: xilinx_spi.h:64
OFFLOAD_RX_EN
#define OFFLOAD_RX_EN
Definition: spi_engine.h:53
GPIO_ADC_RESET_N
#define GPIO_ADC_RESET_N
Definition: parameters.h:58
axi_pwm_init_params
struct axi_pwm_init_param axi_pwm_init_params
Definition: ad7616_sdz.c:82
spi_eng_platform_ops
const struct no_os_spi_platform_ops spi_eng_platform_ops
Spi engine platform specific SPI platform ops structure.
Definition: spi_engine.c:61
AD7616_DMA_BASEADDR
#define AD7616_DMA_BASEADDR
Definition: parameters.h:41
AD7616_SPI_ENGINE_BASEADDR
#define AD7616_SPI_ENGINE_BASEADDR
Definition: parameters.h:40
AXI_PWMGEN_BASEADDR
#define AXI_PWMGEN_BASEADDR
Definition: parameters.h:98