45#define AD525X_RESET_OUT no_os_gpio_direction_output(dev->gpio_reset, \
45#define AD525X_RESET_OUT no_os_gpio_direction_output(dev->gpio_reset, \ …
47#define AD525X_RESET_LOW no_os_gpio_set_value(dev->gpio_reset, \
47#define AD525X_RESET_LOW no_os_gpio_set_value(dev->gpio_reset, \ …
49#define AD525X_RESET_HIGH no_os_gpio_set_value(dev->gpio_reset, \
49#define AD525X_RESET_HIGH no_os_gpio_set_value(dev->gpio_reset, \ …
51#define AD525X_SHUTDOWN_OUT no_os_gpio_direction_output(dev->gpio_shutdown, \
51#define AD525X_SHUTDOWN_OUT no_os_gpio_direction_output(dev->gpio_shutdown, \ …
53#define AD525X_SHUTDOWN_LOW no_os_gpio_set_value(dev->gpio_shutdown, \
53#define AD525X_SHUTDOWN_LOW no_os_gpio_set_value(dev->gpio_shutdown, \ …
55#define AD525X_SHUTDOWN_HIGH no_os_gpio_set_value(dev->gpio_shutdown, \
55#define AD525X_SHUTDOWN_HIGH no_os_gpio_set_value(dev->gpio_shutdown, \ …
57#define AD525X_READY_IN no_os_gpio_direction_input(dev->gpio_ready)
58#define AD525X_READY_LOW no_os_gpio_set_value(dev->gpio_ready, \
58#define AD525X_READY_LOW no_os_gpio_set_value(dev->gpio_ready, \ …
60#define AD525X_READY_HIGH no_os_gpio_set_value(dev->gpio_ready, \
60#define AD525X_READY_HIGH no_os_gpio_set_value(dev->gpio_ready, \ …
62#define AD525X_WP_BF_OUT no_os_gpio_direction_output(dev->gpio_wpbf, \
62#define AD525X_WP_BF_OUT no_os_gpio_direction_output(dev->gpio_wpbf, \ …
64#define AD525X_WP_BF_LOW no_os_gpio_set_value(dev->gpio_wpbf, \
64#define AD525X_WP_BF_LOW no_os_gpio_set_value(dev->gpio_wpbf, \ …
66#define AD525X_WP_BF_HIGH no_os_gpio_set_value(dev->gpio_wpbf, \
66#define AD525X_WP_BF_HIGH no_os_gpio_set_value(dev->gpio_wpbf, \ …
70#define AD525X_MEM_ADDR_MASK 0xF
71#define AD525X_RDAC_ADDR_MASK_1BIT 0x1
72#define AD525X_RDAC_ADDR_MASK_3BIT 0x7
73#define AD525X_DATA8_MASK 0xFF
74#define AD525X_DATA10_MASK 0x3FF
77#define AD525X_CMD_NOP 0x0
78#define AD525X_CMD_MEM2RDAC 0x1
79#define AD525X_CMD_RDAC2MEM 0x2
80#define AD525X_CMD_DECRDAC_6DB 0x3
81#define AD525X_CMD_DECALLRDAC_6DB 0x4
82#define AD525X_CMD_DECRDAC_ONE 0x5
83#define AD525X_CMD_DECALLRDAC_ONE 0x6
84#define AD525X_CMD_RESET 0x7
85#define AD525X_CMD_INCRDAC_6DB 0x8
86#define AD525X_CMD_INCALLRDAC_6DB 0x9
87#define AD525X_CMD_INCRDAC_ONE 0xA
88#define AD525X_CMD_INCALLRDAC_ONE 0xB
92#define AD525X_CMD_SPI_OFFSET 0x4
93#define AD525X_CMD_MASK 0xF
95#define AD525X_CMD_SPI_SREG2MEM 0x3
96#define AD525X_CMD_SPI_MEM2SREG 0x9
97#define AD525X_CMD_SPI_RDAC2SREG 0xA
98#define AD525X_CMD_SPI_SREG2RDAC 0xB
102#define AD525X_I2C_HARD_ADDR 0x2C
104#define AD525X_I2C_PIN_ADDR_MASK 0x03
106#define AD525X_I2C_CNTR_MASK 0xBF
108#define AD525X_I2C_CMD_OR_REG 0x80
109#define AD525X_I2C_EE_OR_RDAC 0x20
111#define AD525X_I2C_MEM_ADDR_MASK 0x1F
113#define AD525X_CMD_I2C_OFFSET 0x3
117#define AD525x_RDAC_TOLERANCE 0x0F
118#define AD525X_RDAC0_SIGN_TOL 0x18
119#define AD525X_RDAC0_DECIMAL_TOL 0x19
120#define AD525X_RDAC1_SIGN_TOL 0x1A
121#define AD525X_RDAC1_DECIMAL_TOL 0x1B
122#define AD525X_RDAC2_SIGN_TOL 0x1C
123#define AD525X_RDAC2_DECIMAL_TOL 0x1D
124#define AD525X_RDAC3_SIGN_TOL 0x1E
125#define AD525X_RDAC4_DECIMAL_TOL 0x1F
int32_t ad525x_remove(struct ad525x_dev *dev)
Free the resources allocated by ad525x_init().
Definition ad525x.c:137
uint16_t ad525x_read_rdac(struct ad525x_dev *dev, uint8_t address)
Read data from the RDAC register.
Definition ad525x.c:271
ad525_x_type_t
Definition ad525x.h:134
@ ID_AD5254
Definition ad525x.h:140
@ ID_AD5232
Definition ad525x.h:135
@ ID_ADN2850
Definition ad525x.h:137
@ ID_AD5252
Definition ad525x.h:138
@ ID_AD5253
Definition ad525x.h:141
@ ID_AD5235
Definition ad525x.h:136
@ ID_AD5251
Definition ad525x.h:139
comm_type_t
Definition ad525x.h:145
uint16_t ad525x_read_mem(struct ad525x_dev *dev, uint8_t address)
Read data from the EEMEM.
Definition ad525x.c:172
void ad525x_write_rdac(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to RDAC register.
Definition ad525x.c:332
void ad525x_write_mem(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to EEMEM.
Definition ad525x.c:226
int8_t ad525x_init(struct ad525x_dev **device, struct ad525x_init_param init_param)
Initialize SPI and Initial Values for AD5172 Board.
Definition ad525x.c:89
void ad525x_write_command(struct ad525x_dev *dev, uint8_t command, uint8_t address)
Write quick commands to the device.
Definition ad525x.c:377
bool_t
Definition ad5446.h:48
comm_type_t
Definition ad5629r.h:123
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
@ I2C
Definition adxl372.h:311
@ SPI
Definition adxl372.h:310
Header file of Delay functions.
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of SPI Interface.
uint8_t num_channels
Definition ad525x.h:151
uint16_t num_position
Definition ad525x.h:153
enum comm_type_t comm_type
Definition ad525x.h:152
struct no_os_gpio_desc * gpio_wpbf
Definition ad525x.h:165
struct no_os_i2c_desc * i2c_desc
Definition ad525x.h:158
struct no_os_gpio_desc * gpio_ready
Definition ad525x.h:164
enum ad525_x_type_t this_device
Definition ad525x.h:167
struct no_os_gpio_desc * gpio_reset
Definition ad525x.h:162
struct no_os_spi_desc * spi_desc
Definition ad525x.h:160
struct no_os_gpio_desc * gpio_shutdown
Definition ad525x.h:163
struct no_os_spi_init_param spi_init
Definition ad525x.h:174
struct no_os_i2c_init_param i2c_init
Definition ad525x.h:172
struct no_os_gpio_init_param gpio_wpbf
Definition ad525x.h:179
struct no_os_gpio_init_param gpio_shutdown
Definition ad525x.h:177
struct no_os_gpio_init_param gpio_reset
Definition ad525x.h:176
enum ad525_x_type_t this_device
Definition ad525x.h:181
struct no_os_gpio_init_param gpio_ready
Definition ad525x.h:178
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 I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128