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 "spi_extra.h"
#include "no-os/gpio.h"
#include "gpio_extra.h"
#include "ad7616.h"
#include "parameters.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 spi_init_param ad7616_spi_init
 
struct xil_gpio_init_param xil_gpio_param
 
struct 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.

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

◆ AD7616_SDZ_SAMPLE_NO

#define AD7616_SDZ_SAMPLE_NO   1000

Function Documentation

◆ main()

int main ( void  )

main

Variable Documentation

◆ ad7616_gpio_reset

struct 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 spi_init_param ad7616_spi_init
Initial value:
= {
.chip_select = SPI_AD7616_CS,
.max_speed_hz = 50000000,
.mode = SPI_MODE_2,
.platform_ops = &spi_eng_platform_ops,
.extra = (void*)&spi_eng_init_param,
}

◆ init_param

struct ad7616_init_param init_param
Initial value:
= {
.spi_param = &ad7616_spi_init,
.offload_init_param = &spi_engine_offload_init_param,
.reg_access_speed = 1000000,
.gpio_hw_rngsel0_param = NULL,
.gpio_hw_rngsel1_param = NULL,
.gpio_os0_param = NULL,
.gpio_os1_param = NULL,
.gpio_os2_param = NULL,
.gpio_reset_param = &ad7616_gpio_reset,
.core_baseaddr = AD7616_CORE_BASEADDR,
.mode = AD7616_SW,
.va = {
},
.vb = {
},
.osr = AD7616_OSR_0,
.dcache_invalidate_range =
(void (*)(uint32_t, uint32_t))Xil_DCacheInvalidateRange,
}

◆ 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_CORE_BASEADDR,
.cs_delay = 1,
.data_width = 8,
}

◆ spi_engine_offload_init_param

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

◆ 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:48
xil_gpio_param
struct xil_gpio_init_param xil_gpio_param
Definition: ad7616_sdz.c:86
ad7616_gpio_reset
struct gpio_init_param ad7616_gpio_reset
Definition: ad7616_sdz.c:90
spi_eng_platform_ops
const struct spi_platform_ops spi_eng_platform_ops
Spi engine platform specific SPI platform ops structure.
Definition: spi_engine.c:63
spi_engine_offload_init_param
struct spi_engine_offload_init_param spi_engine_offload_init_param
Definition: ad7616_sdz.c:65
AD7616_OSR_0
@ AD7616_OSR_0
Definition: ad7616.h:132
GPIO_DEVICE_ID
#define GPIO_DEVICE_ID
Definition: parameters.h:57
spi_eng_init_param
struct spi_engine_init_param spi_eng_init_param
Definition: ad7616_sdz.c:70
OFFLOAD_RX_EN
#define OFFLOAD_RX_EN
Definition: spi_engine.h:58
AD7616_SW
@ AD7616_SW
Definition: ad7616.h:97
GPIO_ADC_RESET_N
#define GPIO_ADC_RESET_N
Definition: parameters.h:62
AD7616_10V
@ AD7616_10V
Definition: ad7616.h:128
NULL
#define NULL
Definition: wrapper.h:64
xil_gpio_ops
const struct gpio_platform_ops xil_gpio_ops
Xilinx platform specific gpio platform ops structure.
Definition: xilinx_gpio.c:455
SPI_MODE_2
@ SPI_MODE_2
Definition: spi.h:70
ad7616_spi_init
struct spi_init_param ad7616_spi_init
Definition: ad7616_sdz.c:78
AD7616_CORE_BASEADDR
#define AD7616_CORE_BASEADDR
Definition: parameters.h:46
AD7616_DMA_BASEADDR
#define AD7616_DMA_BASEADDR
Definition: parameters.h:47
GPIO_PS
@ GPIO_PS
Definition: gpio_extra.h:62
SPI_ENGINE
@ SPI_ENGINE
Definition: spi_extra.h:70