no-OS
|
Implementation of AD5766 Driver. More...
#include <stdio.h>
#include <stdlib.h>
#include "ad5766.h"
#include "no_os_error.h"
#include "no_os_alloc.h"
Functions | |
int32_t | ad5766_spi_cmd_write (struct ad5766_dev *dev, uint8_t cmd, uint16_t data) |
int32_t | ad5766_spi_readback_reg (struct ad5766_dev *dev, enum ad5766_dac dac, uint32_t *data) |
int32_t | ad5766_set_sw_ldac (struct ad5766_dev *dev, uint16_t setting) |
int32_t | ad5766_set_clr_span (struct ad5766_dev *dev, enum ad5766_clr clr, enum ad5766_span span) |
int32_t | ad5766_set_pwr_dac (struct ad5766_dev *dev, uint16_t setting) |
int32_t | ad5766_set_pwr_dither (struct ad5766_dev *dev, uint16_t setting) |
int32_t | ad5766_set_dither_signal (struct ad5766_dev *dev, uint32_t setting) |
int32_t | ad5766_set_inv_dither (struct ad5766_dev *dev, uint16_t setting) |
int32_t | ad5766_set_dither_scale (struct ad5766_dev *dev, uint32_t setting) |
int32_t | ad5766_do_soft_reset (struct ad5766_dev *dev) |
int32_t | ad5766_set_in_reg (struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data) |
int32_t | ad5766_set_dac_reg (struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data) |
int32_t | ad5766_set_dac_reg_all (struct ad5766_dev *dev, uint16_t data) |
int32_t | ad5766_init (struct ad5766_dev **device, struct ad5766_init_param init_param) |
int32_t | ad5766_remove (struct ad5766_dev *dev) |
Free the resources allocated by ad5766_init(). More... | |
Implementation of AD5766 Driver.
Copyright 2016(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:
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.
int32_t ad5766_do_soft_reset | ( | struct ad5766_dev * | dev | ) |
Do a software reset.
dev | - The device structure. |
int32_t ad5766_init | ( | struct ad5766_dev ** | device, |
struct ad5766_init_param | init_param | ||
) |
Initialize the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t ad5766_remove | ( | struct ad5766_dev * | dev | ) |
Free the resources allocated by ad5766_init().
dev | - The device structure. |
int32_t ad5766_set_clr_span | ( | struct ad5766_dev * | dev, |
enum ad5766_clr | clr, | ||
enum ad5766_span | span | ||
) |
Set clear code and span settings.
dev | - The device structure. |
clr | - The clear code setting. Accepted values: AD5766_ZERO AD5766_MID AD5766_FULL |
span | - The span setting. Accepted values: AD5766_M_20V_TO_0V AD5766_M_16V_TO_0V AD5766_M_10V_TO_0V AD5766_M_12V_TO_P_14V AD5766_M_16V_TO_P_10V AD5766_M_5V_TO_P_6V AD5766_M_10V_TO_P_10V |
int32_t ad5766_set_dac_reg | ( | struct ad5766_dev * | dev, |
enum ad5766_dac | dac, | ||
uint16_t | data | ||
) |
Set the DAC register for the selected channel.
dev | - The device structure. |
dac | - The selected channel. |
data | - The register data. |
int32_t ad5766_set_dac_reg_all | ( | struct ad5766_dev * | dev, |
uint16_t | data | ||
) |
Set the DAC register for all channels.
dev | - The device structure. |
data | - The register data. |
int32_t ad5766_set_dither_scale | ( | struct ad5766_dev * | dev, |
uint32_t | setting | ||
) |
Enable the dither scaling for the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_75(x) | AD5766_50(y) | AD5766_25(z) | ... |
int32_t ad5766_set_dither_signal | ( | struct ad5766_dev * | dev, |
uint32_t | setting | ||
) |
Enable the dither signal for the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_N0(x) | AD5766_N1(y) | ... |
int32_t ad5766_set_in_reg | ( | struct ad5766_dev * | dev, |
enum ad5766_dac | dac, | ||
uint16_t | data | ||
) |
Set the input register for the selected channel.
dev | - The device structure. |
dac | - The selected channel. |
data | - The register data. |
int32_t ad5766_set_inv_dither | ( | struct ad5766_dev * | dev, |
uint16_t | setting | ||
) |
Invert the dither signal for the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_INV_D(x) | AD5766_INV_D(y) | ... |
int32_t ad5766_set_pwr_dac | ( | struct ad5766_dev * | dev, |
uint16_t | setting | ||
) |
Power down the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_PWDN(x) | AD5766_PWDN(y) | ... |
int32_t ad5766_set_pwr_dither | ( | struct ad5766_dev * | dev, |
uint16_t | setting | ||
) |
Power down the dither block for the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_PWDN(x) | AD5766_PWDN(y) | ... |
int32_t ad5766_set_sw_ldac | ( | struct ad5766_dev * | dev, |
uint16_t | setting | ||
) |
Set software LDAC for the selected channels.
dev | - The device structure. |
setting | - The setting. Accepted values: AD5766_LDAC(x) | AD5766_LDAC(y) | ... |
int32_t ad5766_spi_cmd_write | ( | struct ad5766_dev * | dev, |
uint8_t | cmd, | ||
uint16_t | data | ||
) |
SPI command write to device.
dev | - The device structure. |
cmd | - The command. |
data | - The data. |
int32_t ad5766_spi_readback_reg | ( | struct ad5766_dev * | dev, |
enum ad5766_dac | dac, | ||
uint32_t * | data | ||
) |
SPI readback register from device.
dev | - The device structure. |
dac | - The dac address. |
data | - The register data. |