no-OS
|
Header file of AD5421 Driver for Microblaze processor. More...
Go to the source code of this file.
Classes | |
struct | ad5421_dev |
struct | ad5421_init_param |
Macros | |
#define | AD5421_CMDWRDAC 1 |
#define | AD5421_CMDWRCTRL 2 |
#define | AD5421_CMDWROFFSET 3 |
#define | AD5421_CMDWRGAIN 4 |
#define | AD5421_CMDRST 7 |
#define | AD5421_CMDMEASVTEMP 8 |
#define | AD5421_NO_OP 9 |
#define | AD5421_CMDRDDAC 129 |
#define | AD5421_CMDRDCTRL 130 |
#define | AD5421_CMDRDOFFSET 131 |
#define | AD5421_CMDRDGAIN 132 |
#define | AD5421_CMDRDFAULT 133 |
#define | AD5421_CMD(x) ((x & 0xFF) << 16) |
#define | AD5421_LDAC_OUT |
#define | AD5421_LDAC_LOW |
#define | AD5421_LDAC_HIGH |
#define | AD5421_FAULT_IN no_os_gpio_direction_input(dev->gpio_faultin) |
#define | CTRL_SPI_WATCHDOG (1 << 12) |
#define | CTRL_AUTO_FAULT_RDBK (1 << 11) |
#define | CTRL_SEL_ADC_INPUT (1 << 8) |
#define | CTRL_ONCHIP_ADC (1 << 7) |
Functions | |
int32_t | ad5421_init (struct ad5421_dev **device, struct ad5421_init_param init_param) |
Initialize SPI and Initial Values for AD5421 Board. More... | |
int32_t | ad5421_remove (struct ad5421_dev *dev) |
Free the resources allocated by ad5421_init(). More... | |
void | ad5421_set_dac (struct ad5421_dev *dev, int32_t dac_value) |
Write to the DAC register. More... | |
void | ad5421_set_offset (struct ad5421_dev *dev, int32_t offset_value) |
Write to the Offset Adjust register. More... | |
void | ad5421_set_gain (struct ad5421_dev *dev, int32_t gain_value) |
Write to the Gain Adjust register. More... | |
int32_t | ad5421_get_dac (struct ad5421_dev *dev) |
Read from the DAC register. More... | |
int32_t | ad5421_get_offset (struct ad5421_dev *dev) |
Read from the Offset Adjust register. More... | |
int32_t | ad5421_get_gain (struct ad5421_dev *dev) |
Read from the Gain Adjust register. More... | |
int32_t | ad5421_get_fault (struct ad5421_dev *dev) |
Read from the Fault register. More... | |
int32_t | ad5421_get_temp (struct ad5421_dev *dev) |
Read the temperature from Fault register. More... | |
float | ad5421_get_vloop (struct ad5421_dev *dev) |
Read VLoop-COM from Fault register. More... | |
int32_t | ad5421_set (struct ad5421_dev *dev, int32_t *i_value) |
Send data via SPI. More... | |
int32_t | ad5421_get (struct ad5421_dev *dev) |
Read data via SPI. More... | |
void | ad5421_reset (struct ad5421_dev *dev) |
Resets the ad5421 device. More... | |
Header file of AD5421 Driver for Microblaze processor.
Copyright 2013(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.
#define AD5421_CMD | ( | x | ) | ((x & 0xFF) << 16) |
#define AD5421_CMDMEASVTEMP 8 |
#define AD5421_CMDRDCTRL 130 |
#define AD5421_CMDRDDAC 129 |
#define AD5421_CMDRDFAULT 133 |
#define AD5421_CMDRDGAIN 132 |
#define AD5421_CMDRDOFFSET 131 |
#define AD5421_CMDRST 7 |
#define AD5421_CMDWRCTRL 2 |
#define AD5421_CMDWRDAC 1 |
#define AD5421_CMDWRGAIN 4 |
#define AD5421_CMDWROFFSET 3 |
#define AD5421_FAULT_IN no_os_gpio_direction_input(dev->gpio_faultin) |
#define AD5421_LDAC_HIGH |
#define AD5421_LDAC_LOW |
#define AD5421_LDAC_OUT |
#define AD5421_NO_OP 9 |
#define CTRL_AUTO_FAULT_RDBK (1 << 11) |
#define CTRL_ONCHIP_ADC (1 << 7) |
#define CTRL_SEL_ADC_INPUT (1 << 8) |
#define CTRL_SPI_WATCHDOG (1 << 12) |
int32_t ad5421_get | ( | struct ad5421_dev * | dev | ) |
Read data via SPI.
dev | - The device structure. |
int32_t ad5421_get_dac | ( | struct ad5421_dev * | dev | ) |
Read from the DAC register.
dev | - The device structure. |
int32_t ad5421_get_fault | ( | struct ad5421_dev * | dev | ) |
Read from the Fault register.
dev | - The device structure. |
int32_t ad5421_get_gain | ( | struct ad5421_dev * | dev | ) |
Read from the Gain Adjust register.
dev | - The device structure. |
int32_t ad5421_get_offset | ( | struct ad5421_dev * | dev | ) |
Read from the Offset Adjust register.
dev | - The device structure. |
int32_t ad5421_get_temp | ( | struct ad5421_dev * | dev | ) |
Read the temperature from Fault register.
dev | - The device structure. |
float ad5421_get_vloop | ( | struct ad5421_dev * | dev | ) |
Read VLoop-COM from Fault register.
dev | - The device structure. |
int32_t ad5421_init | ( | struct ad5421_dev ** | device, |
struct ad5421_init_param | init_param | ||
) |
Initialize SPI and Initial Values for AD5421 Board.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t ad5421_remove | ( | struct ad5421_dev * | dev | ) |
Free the resources allocated by ad5421_init().
dev | - The device structure. |
void ad5421_reset | ( | struct ad5421_dev * | dev | ) |
Resets the ad5421 device.
dev | - The device structure. |
int32_t ad5421_set | ( | struct ad5421_dev * | dev, |
int32_t * | value | ||
) |
Send data via SPI.
dev | - The device structure. |
value | - value to be sent via SPI |
void ad5421_set_dac | ( | struct ad5421_dev * | dev, |
int32_t | dac_value | ||
) |
Write to the DAC register.
dev | - The device structure. |
dac_value | - desired value to be written in register. |
void ad5421_set_gain | ( | struct ad5421_dev * | dev, |
int32_t | gain_value | ||
) |
Write to the Gain Adjust register.
dev | - The device structure. |
gain_value | - desired value to be written in register. |
void ad5421_set_offset | ( | struct ad5421_dev * | dev, |
int32_t | offset_value | ||
) |
Write to the Offset Adjust register.
dev | - The device structure. |
offset_value | - desired value to be written in register. |