no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 ( void )

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,
}
@ ILIMIT_200_mA
Definition ad5758.h:317
@ RANGE_0V_10V
Definition ad5758.h:326
@ CLKOUT_DISABLE
Definition ad5758.h:281
@ CLKOUT_FREQ_500_KHZ
Definition ad5758.h:290
@ SR_CLOCK_240_KHZ
Definition ad5758.h:297
@ DPC_VOLTAGE_MODE
Definition ad5758.h:262
const struct no_os_gpio_init_param reset_ip
Definition ad5758_sdz.c:67
const struct no_os_spi_init_param spi_ip
Definition ad5758_sdz.c:53
const struct no_os_gpio_init_param ldac_ip
Definition ad5758_sdz.c:72

◆ gpio_extra

const struct xil_gpio_init_param gpio_extra
Initial value:
= {
.type = GPIO_PS,
.device_id = GPIO_DEVICE_ID
}
#define GPIO_DEVICE_ID
Definition parameters.h:79
@ GPIO_PS
Definition xilinx_gpio.h:48

◆ 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
}
#define GPIO_DAC_LDAC_N
Definition parameters.h:43
const struct xil_gpio_init_param gpio_extra
Definition ad5758_sdz.c:63
const struct no_os_gpio_platform_ops xil_gpio_ops
Xilinx platform specific GPIO platform ops structure.
Definition xilinx_gpio.c:442

◆ 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
}
#define GPIO_DAC_RESET_N
Definition parameters.h:42

◆ spi_extra

const struct xil_spi_init_param spi_extra
Initial value:
= {
.type = SPI_PS,
.flags = NULL
}
#define NULL
Definition wrapper.h:64
@ SPI_PS
Definition xilinx_spi.h:50

◆ 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
}
#define SPI_DEVICE_ID
Definition parameters.h:63
#define AD5758_SPI_CS
Definition parameters.h:38
const struct xil_spi_init_param spi_extra
Definition ad5758_sdz.c:49
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition no_os_spi.h:64
@ NO_OS_SPI_MODE_1
Definition no_os_spi.h:51
const struct no_os_spi_platform_ops xil_spi_ops
Spi engine platform specific SPI platform ops structure.
Definition xilinx_spi.c:445