Go to the documentation of this file.
56 #define AD5421_CMDWRDAC 1
57 #define AD5421_CMDWRCTRL 2
58 #define AD5421_CMDWROFFSET 3
59 #define AD5421_CMDWRGAIN 4
60 #define AD5421_CMDRST 7
61 #define AD5421_CMDMEASVTEMP 8
62 #define AD5421_CMDRDDAC 129
63 #define AD5421_CMDRDCTRL 130
64 #define AD5421_CMDRDOFFSET 131
65 #define AD5421_CMDRDGAIN 132
66 #define AD5421_CMDRDFAULT 133
69 #define AD5421_CMD(x) ((x & 0xFF) << 16)
72 #define AD5421_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
74 #define AD5421_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
76 #define AD5421_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
78 #define AD5421_FAULT_IN no_os_gpio_direction_input(dev->gpio_faultin)
81 #define CTRL_SPI_WATCHDOG (1 << 12)
82 #define CTRL_AUTO_FAULT_RDBK (1 << 11)
83 #define CTRL_SEL_ADC_INPUT (1 << 8)
84 #define CTRL_ONCHIP_ADC (1 << 7)
119 int32_t offset_value);
#define AD5421_CMDWRGAIN
Definition: ad5421.h:59
no_os_spi_init_param spi_init
Definition: ad5421.h:100
#define AD5421_CMDRDGAIN
Definition: ad5421.h:65
struct no_os_gpio_desc * gpio_faultin
Definition: ad5421.h:95
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
struct no_os_gpio_init_param gpio_faultin
Definition: ad5421.h:103
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:82
float ad5421_get_vloop(struct ad5421_dev *dev)
Read VLoop-COM from Fault register.
Definition: ad5421.c:331
int32_t ad5421_get(struct ad5421_dev *dev)
Read data via SPI.
Definition: ad5421.c:400
Header file of SPI Interface.
int32_t ad5421_get(struct ad5421_dev *dev)
Read data via SPI.
Definition: ad5421.c:400
#define AD5421_CMDWROFFSET
Definition: ad5421.h:58
#define AD5421_CMDWRCTRL
Definition: ad5421.h:57
void ad5421_reset(struct ad5421_dev *dev)
Resets the ad5421 device.
Definition: ad5421.c:425
int32_t ad5421_get_dac(struct ad5421_dev *dev)
Read from the DAC register.
Definition: ad5421.c:205
int32_t ad5421_set(struct ad5421_dev *dev, int32_t *value)
Send data via SPI.
Definition: ad5421.c:372
Definition: ad9361_util.h:75
#define CTRL_ONCHIP_ADC
Definition: ad5421.h:84
struct no_os_gpio_desc * gpio_ldac
Definition: ad5421.h:94
struct no_os_gpio_init_param gpio_ldac
Definition: ad5421.h:102
#define AD5421_CMDMEASVTEMP
Definition: ad5421.h:61
#define CTRL_SPI_WATCHDOG
Definition: ad5421.h:81
int32_t ad5421_init(struct ad5421_dev **device, struct ad5421_init_param init_param)
Initialize SPI and Initial Values for AD5421 Board.
Definition: ad5421.c:64
#define CTRL_AUTO_FAULT_RDBK
Definition: ad5421.h:82
int32_t ad5421_get_fault(struct ad5421_dev *dev)
Read from the Fault register.
Definition: ad5421.c:268
int32_t ad5421_get_dac(struct ad5421_dev *dev)
Read from the DAC register.
Definition: ad5421.c:205
#define AD5421_CMDRDDAC
Definition: ad5421.h:62
int32_t ad5421_get_gain(struct ad5421_dev *dev)
Read from the Gain Adjust register.
Definition: ad5421.c:247
#define AD5421_CMDRDOFFSET
Definition: ad5421.h:64
int32_t ad5421_init(struct ad5421_dev **device, struct ad5421_init_param init_param)
Initialize SPI and Initial Values for AD5421 Board.
Definition: ad5421.c:64
int32_t ad5421_get_fault(struct ad5421_dev *dev)
Read from the Fault register.
Definition: ad5421.c:268
#define AD5421_CMD(x)
Definition: ad5421.h:69
#define AD5421_CMDRST
Definition: ad5421.h:60
int32_t ad5421_set(struct ad5421_dev *dev, int32_t *i_value)
Send data via SPI.
Definition: ad5421.c:372
void ad5421_set_dac(struct ad5421_dev *dev, int32_t dac_value)
Write to the DAC register.
Definition: ad5421.c:146
void ad5421_set_gain(struct ad5421_dev *dev, int32_t gain_value)
Write to the Gain Adjust register.
Definition: ad5421.c:186
int32_t ad5421_get_temp(struct ad5421_dev *dev)
Read the temperature from Fault register.
Definition: ad5421.c:290
int32_t ad5421_remove(struct ad5421_dev *dev)
Free the resources allocated by ad5421_init().
Definition: ad5421.c:124
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:95
void ad5421_set_gain(struct ad5421_dev *dev, int32_t gain_value)
Write to the Gain Adjust register.
Definition: ad5421.c:186
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
int32_t ad5421_get_gain(struct ad5421_dev *dev)
Read from the Gain Adjust register.
Definition: ad5421.c:247
int32_t ad5421_get_temp(struct ad5421_dev *dev)
Read the temperature from Fault register.
Definition: ad5421.c:290
#define AD5421_FAULT_IN
Definition: ad5421.h:78
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
int32_t ad5421_get_offset(struct ad5421_dev *dev)
Read from the Offset Adjust register.
Definition: ad5421.c:226
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:55
int32_t ad5421_get_offset(struct ad5421_dev *dev)
Read from the Offset Adjust register.
Definition: ad5421.c:226
#define AD5421_LDAC_OUT
Definition: ad5421.h:72
#define CTRL_SEL_ADC_INPUT
Definition: ad5421.h:83
#define AD5421_CMDRDFAULT
Definition: ad5421.h:66
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:70
Header file of GPIO Interface.
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:51
no_os_spi_desc * spi_desc
Definition: ad5421.h:92
float ad5421_get_vloop(struct ad5421_dev *dev)
Read VLoop-COM from Fault register.
Definition: ad5421.c:331
Header file of AD5421 Driver for Microblaze processor.
#define AD5421_CMDWRDAC
Definition: ad5421.h:56
void ad5421_set_dac(struct ad5421_dev *dev, int32_t dac_value)
Write to the DAC register.
Definition: ad5421.c:146
#define AD5421_CMDRDCTRL
Definition: ad5421.h:63
void ad5421_set_offset(struct ad5421_dev *dev, int32_t offset_value)
Write to the Offset Adjust register.
Definition: ad5421.c:166
int32_t ad5421_remove(struct ad5421_dev *dev)
Free the resources allocated by ad5421_init().
Definition: ad5421.c:124
void ad5421_reset(struct ad5421_dev *dev)
Resets the ad5421 device.
Definition: ad5421.c:425
#define AD5421_LDAC_LOW
Definition: ad5421.h:74
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112
void ad5421_set_offset(struct ad5421_dev *dev, int32_t offset_value)
Write to the Offset Adjust register.
Definition: ad5421.c:166