42#define AD5421_CMDWRDAC 1
43#define AD5421_CMDWRCTRL 2
44#define AD5421_CMDWROFFSET 3
45#define AD5421_CMDWRGAIN 4
46#define AD5421_CMDRST 7
47#define AD5421_CMDMEASVTEMP 8
49#define AD5421_CMDRDDAC 129
50#define AD5421_CMDRDCTRL 130
51#define AD5421_CMDRDOFFSET 131
52#define AD5421_CMDRDGAIN 132
53#define AD5421_CMDRDFAULT 133
56#define AD5421_CMD(x) ((x & 0xFF) << 16)
59#define AD5421_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
59#define AD5421_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \ …
61#define AD5421_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
61#define AD5421_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \ …
63#define AD5421_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
63#define AD5421_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \ …
65#define AD5421_FAULT_IN no_os_gpio_direction_input(dev->gpio_faultin)
68#define CTRL_SPI_WATCHDOG (1 << 12)
69#define CTRL_AUTO_FAULT_RDBK (1 << 11)
70#define CTRL_SEL_ADC_INPUT (1 << 8)
71#define CTRL_ONCHIP_ADC (1 << 7)
99 int32_t offset_value);
int32_t ad5421_get_temp(struct ad5421_dev *dev)
Read the temperature from Fault register.
Definition ad5421.c:273
int32_t ad5421_get_fault(struct ad5421_dev *dev)
Read from the Fault register.
Definition ad5421.c:251
int32_t ad5421_remove(struct ad5421_dev *dev)
Free the resources allocated by ad5421_init().
Definition ad5421.c:110
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:50
void ad5421_set_gain(struct ad5421_dev *dev, int32_t gain_value)
Write to the Gain Adjust register.
Definition ad5421.c:169
void ad5421_reset(struct ad5421_dev *dev)
Resets the ad5421 device.
Definition ad5421.c:407
int32_t ad5421_get_gain(struct ad5421_dev *dev)
Read from the Gain Adjust register.
Definition ad5421.c:230
int32_t ad5421_set(struct ad5421_dev *dev, int32_t *i_value)
Send data via SPI.
Definition ad5421.c:355
int32_t ad5421_get(struct ad5421_dev *dev)
Read data via SPI.
Definition ad5421.c:383
int32_t ad5421_get_offset(struct ad5421_dev *dev)
Read from the Offset Adjust register.
Definition ad5421.c:209
int32_t ad5421_get_dac(struct ad5421_dev *dev)
Read from the DAC register.
Definition ad5421.c:188
float ad5421_get_vloop(struct ad5421_dev *dev)
Read VLoop-COM from Fault register.
Definition ad5421.c:314
void ad5421_set_dac(struct ad5421_dev *dev, int32_t dac_value)
Write to the DAC register.
Definition ad5421.c:131
void ad5421_set_offset(struct ad5421_dev *dev, int32_t offset_value)
Write to the Offset Adjust register.
Definition ad5421.c:150
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
Header file of GPIO Interface.
Header file of SPI Interface.
struct no_os_gpio_desc * gpio_ldac
Definition ad5421.h:77
struct no_os_spi_desc * spi_desc
Definition ad5421.h:75
struct no_os_gpio_desc * gpio_faultin
Definition ad5421.h:78
struct no_os_gpio_init_param gpio_faultin
Definition ad5421.h:86
struct no_os_gpio_init_param gpio_ldac
Definition ad5421.h:85
struct no_os_spi_init_param spi_init
Definition ad5421.h:83
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128