no-OS
Functions | Variables
ad5758_sdz.c File Reference

Implementation of Main Function. More...

#include "ad5758.h"
#include "no_os_error.h"
#include "no_os_gpio.h"
#include "xilinx_gpio.h"
#include "parameters.h"
#include "sleep.h"
#include "no_os_spi.h"
#include "xilinx_spi.h"
#include "stdint.h"
#include "stdio.h"
#include "stdlib.h"
#include "xil_cache.h"
#include "xil_printf.h"
#include "xparameters.h"
Include dependency graph for ad5758_sdz.c:

Functions

int main ()
 

Variables

const struct xil_spi_init_param spi_extra
 
const struct no_os_spi_init_param spi_ip
 
const struct xil_gpio_init_param gpio_extra
 
const struct no_os_gpio_init_param reset_ip
 
const struct no_os_gpio_init_param ldac_ip
 
struct ad5758_init_param ad5758_default_init_param
 

Detailed Description

Implementation of Main Function.

Author
SPopa (stefa.nosp@m.n.po.nosp@m.pa@an.nosp@m.alog.nosp@m..com)

Copyright 2021(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.

Function Documentation

◆ main()

int main ( )

Variable Documentation

◆ ad5758_default_init_param

struct ad5758_init_param ad5758_default_init_param
Initial value:
= {
.spi_init = spi_ip,
.reset_n = reset_ip,
.ldac_n = ldac_ip,
.crc_en = true,
.dc_dc_mode = DPC_VOLTAGE_MODE,
.clkout_config = CLKOUT_DISABLE,
.clkout_freq = CLKOUT_FREQ_500_KHZ,
.dc_dc_ilimit = ILIMIT_200_mA,
.output_range = RANGE_0V_10V,
.slew_rate_clk = SR_CLOCK_240_KHZ,
}

◆ gpio_extra

const struct xil_gpio_init_param gpio_extra
Initial value:
= {
.type = GPIO_PS,
.device_id = GPIO_DEVICE_ID
}

◆ ldac_ip

const struct no_os_gpio_init_param ldac_ip
Initial value:
= {
.number = GPIO_DAC_LDAC_N,
.platform_ops = &xil_gpio_ops,
.extra = &gpio_extra
}

◆ reset_ip

const struct no_os_gpio_init_param reset_ip
Initial value:
= {
.number = GPIO_DAC_RESET_N,
.platform_ops = &xil_gpio_ops,
.extra = &gpio_extra
}

◆ spi_extra

const struct xil_spi_init_param spi_extra
Initial value:
= {
.type = SPI_PS,
.flags = NULL
}

◆ spi_ip

const struct no_os_spi_init_param spi_ip
Initial value:
= {
.device_id = SPI_DEVICE_ID,
.max_speed_hz = 10000,
.chip_select = AD5758_SPI_CS,
.platform_ops = &xil_spi_ops,
.extra = &spi_extra
}
NO_OS_SPI_MODE_1
@ NO_OS_SPI_MODE_1
Definition: no_os_spi.h:63
GPIO_PS
@ GPIO_PS
Definition: xilinx_gpio.h:56
SPI_PS
@ SPI_PS
Definition: xilinx_spi.h:62
spi_extra
const struct xil_spi_init_param spi_extra
Definition: ad5758_sdz.c:53
AD5758_SPI_CS
#define AD5758_SPI_CS
Definition: parameters.h:42
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
spi_ip
const struct no_os_spi_init_param spi_ip
Definition: ad5758_sdz.c:57
RANGE_0V_10V
@ RANGE_0V_10V
Definition: ad5758.h:332
DPC_VOLTAGE_MODE
@ DPC_VOLTAGE_MODE
Definition: ad5758.h:268
CLKOUT_DISABLE
@ CLKOUT_DISABLE
Definition: ad5758.h:287
GPIO_DEVICE_ID
#define GPIO_DEVICE_ID
Definition: parameters.h:87
gpio_extra
const struct xil_gpio_init_param gpio_extra
Definition: ad5758_sdz.c:67
CLKOUT_FREQ_500_KHZ
@ CLKOUT_FREQ_500_KHZ
Definition: ad5758.h:296
NO_OS_SPI_BIT_ORDER_MSB_FIRST
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition: no_os_spi.h:76
ILIMIT_200_mA
@ ILIMIT_200_mA
Definition: ad5758.h:323
NULL
#define NULL
Definition: wrapper.h:64
xil_spi_ops
const struct no_os_spi_platform_ops xil_spi_ops
Spi engine platform specific SPI platform ops structure.
Definition: xilinx_spi.c:453
SPI_DEVICE_ID
#define SPI_DEVICE_ID
Definition: parameters.h:69
SR_CLOCK_240_KHZ
@ SR_CLOCK_240_KHZ
Definition: ad5758.h:303
ldac_ip
const struct no_os_gpio_init_param ldac_ip
Definition: ad5758_sdz.c:76
reset_ip
const struct no_os_gpio_init_param reset_ip
Definition: ad5758_sdz.c:71
GPIO_DAC_LDAC_N
#define GPIO_DAC_LDAC_N
Definition: parameters.h:47
GPIO_DAC_RESET_N
#define GPIO_DAC_RESET_N
Definition: parameters.h:46