Go to the documentation of this file.
51 #define AD525X_RESET_OUT no_os_gpio_direction_output(dev->gpio_reset, \
53 #define AD525X_RESET_LOW no_os_gpio_set_value(dev->gpio_reset, \
55 #define AD525X_RESET_HIGH no_os_gpio_set_value(dev->gpio_reset, \
57 #define AD525X_SHUTDOWN_OUT no_os_gpio_direction_output(dev->gpio_shutdown, \
59 #define AD525X_SHUTDOWN_LOW no_os_gpio_set_value(dev->gpio_shutdown, \
61 #define AD525X_SHUTDOWN_HIGH no_os_gpio_set_value(dev->gpio_shutdown, \
63 #define AD525X_READY_IN no_os_gpio_direction_input(dev->gpio_ready)
64 #define AD525X_READY_LOW no_os_gpio_set_value(dev->gpio_ready, \
66 #define AD525X_READY_HIGH no_os_gpio_set_value(dev->gpio_ready, \
68 #define AD525X_WP_BF_OUT no_os_gpio_direction_output(dev->gpio_wpbf, \
70 #define AD525X_WP_BF_LOW no_os_gpio_set_value(dev->gpio_wpbf, \
72 #define AD525X_WP_BF_HIGH no_os_gpio_set_value(dev->gpio_wpbf, \
76 #define AD525X_MEM_ADDR_MASK 0xF
77 #define AD525X_RDAC_ADDR_MASK_1BIT 0x1
78 #define AD525X_RDAC_ADDR_MASK_3BIT 0x7
79 #define AD525X_DATA8_MASK 0xFF
80 #define AD525X_DATA10_MASK 0x3FF
83 #define AD525X_CMD_NOP 0x0
84 #define AD525X_CMD_MEM2RDAC 0x1
85 #define AD525X_CMD_RDAC2MEM 0x2
86 #define AD525X_CMD_DECRDAC_6DB 0x3
87 #define AD525X_CMD_DECALLRDAC_6DB 0x4
88 #define AD525X_CMD_DECRDAC_ONE 0x5
89 #define AD525X_CMD_DECALLRDAC_ONE 0x6
90 #define AD525X_CMD_RESET 0x7
91 #define AD525X_CMD_INCRDAC_6DB 0x8
92 #define AD525X_CMD_INCALLRDAC_6DB 0x9
93 #define AD525X_CMD_INCRDAC_ONE 0xA
94 #define AD525X_CMD_INCALLRDAC_ONE 0xB
98 #define AD525X_CMD_SPI_OFFSET 0x4
99 #define AD525X_CMD_MASK 0xF
101 #define AD525X_CMD_SPI_SREG2MEM 0x3
102 #define AD525X_CMD_SPI_MEM2SREG 0x9 // Result in the next frame
103 #define AD525X_CMD_SPI_RDAC2SREG 0xA // Result in the next frame
104 #define AD525X_CMD_SPI_SREG2RDAC 0xB
108 #define AD525X_I2C_HARD_ADDR 0x2C
110 #define AD525X_I2C_PIN_ADDR_MASK 0x03
112 #define AD525X_I2C_CNTR_MASK 0xBF
114 #define AD525X_I2C_CMD_OR_REG 0x80
115 #define AD525X_I2C_EE_OR_RDAC 0x20
117 #define AD525X_I2C_MEM_ADDR_MASK 0x1F
119 #define AD525X_CMD_I2C_OFFSET 0x3
123 #define AD525x_RDAC_TOLERANCE 0x0F
124 #define AD525X_RDAC0_SIGN_TOL 0x18
125 #define AD525X_RDAC0_DECIMAL_TOL 0x19
126 #define AD525X_RDAC1_SIGN_TOL 0x1A
127 #define AD525X_RDAC1_DECIMAL_TOL 0x1B
128 #define AD525X_RDAC2_SIGN_TOL 0x1C
129 #define AD525X_RDAC2_DECIMAL_TOL 0x1D
130 #define AD525X_RDAC3_SIGN_TOL 0x1E
131 #define AD525X_RDAC4_DECIMAL_TOL 0x1F
227 #endif // __AD525X_H__
#define AD525X_CMD_SPI_MEM2SREG
Definition: ad525x.h:102
#define AD525X_CMD_SPI_SREG2RDAC
Definition: ad525x.h:104
void ad525x_write_command(struct ad525x_dev *dev, uint8_t command, uint8_t address)
Write quick commands to the device.
Definition: ad525x.c:392
struct no_os_gpio_init_param gpio_wpbf
Definition: ad525x.h:189
uint16_t num_position
Definition: ad525x.h:163
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
void ad525x_write_mem(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to EEMEM.
Definition: ad525x.c:238
struct no_os_gpio_desc * gpio_ready
Definition: ad525x.h:174
#define AD525X_I2C_MEM_ADDR_MASK
Definition: ad525x.h:117
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
struct no_os_spi_init_param spi_init
Definition: ad525x.h:184
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:52
uint8_t num_channels
Definition: ad525x.h:161
@ ID_ADN2850
Definition: ad525x.h:147
int32_t ad525x_remove(struct ad525x_dev *dev)
Free the resources allocated by ad525x_init().
Definition: ad525x.c:147
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:159
Header file of SPI Interface.
@ ID_AD5254
Definition: ad525x.h:150
void ad525x_write_command(struct ad525x_dev *dev, uint8_t command, uint8_t address)
Write quick commands to the device.
Definition: ad525x.c:392
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:113
@ I2C
Definition: ad525x.h:157
comm_type_t
Definition: ad5629r.h:132
Header file of Delay functions.
@ ID_AD5235
Definition: ad525x.h:146
#define AD525X_CMD_SPI_OFFSET
Definition: ad525x.h:98
Definition: ad9361_util.h:69
struct no_os_gpio_desc * gpio_wpbf
Definition: ad525x.h:175
#define AD525X_CMD_SPI_RDAC2SREG
Definition: ad525x.h:103
void ad525x_write_mem(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to EEMEM.
Definition: ad525x.c:238
#define AD525X_I2C_EE_OR_RDAC
Definition: ad525x.h:115
struct no_os_gpio_init_param gpio_ready
Definition: ad525x.h:188
#define AD525X_RDAC_ADDR_MASK_3BIT
Definition: ad525x.h:78
@ ID_AD5232
Definition: ad525x.h:145
@ SPI
Definition: ad525x.h:156
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:99
int32_t ad525x_remove(struct ad525x_dev *dev)
Free the resources allocated by ad525x_init().
Definition: ad525x.c:147
#define AD525X_CMD_SPI_SREG2MEM
Definition: ad525x.h:101
#define AD525X_MEM_ADDR_MASK
Definition: ad525x.h:76
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
bool_t
Definition: ad5446.h:55
@ I2C
Definition: adxl372.h:317
struct no_os_i2c_desc * i2c_desc
Definition: ad525x.h:168
struct no_os_gpio_desc * gpio_reset
Definition: ad525x.h:172
#define LSB_BYTE_MASK
Definition: ad525x.c:42
struct no_os_gpio_init_param gpio_shutdown
Definition: ad525x.h:187
@ ID_AD5253
Definition: ad525x.h:151
#define AD525X_READY_IN
Definition: ad525x.h:63
#define AD525X_WP_BF_HIGH
Definition: ad525x.h:72
#define AD525X_WP_BF_OUT
Definition: ad525x.h:68
struct no_os_i2c_init_param i2c_init
Definition: ad525x.h:182
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:104
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define AD525X_SHUTDOWN_OUT
Definition: ad525x.h:57
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define ONEBYTE_OFFSET
Definition: ad525x.c:43
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
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:49
#define AD525X_RESET_HIGH
Definition: ad525x.h:55
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
@ ID_AD5252
Definition: ad525x.h:148
Header file of I2C Interface.
#define AD525X_RESET_OUT
Definition: ad525x.h:51
#define AD525X_CMD_MASK
Definition: ad525x.h:99
#define AD525X_CMD_NOP
Definition: ad525x.h:83
void ad525x_write_rdac(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to RDAC register.
Definition: ad525x.c:346
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
#define AD525X_CMD_MEM2RDAC
Definition: ad525x.h:84
uint16_t ad525x_read_rdac(struct ad525x_dev *dev, uint8_t address)
Read data from the RDAC register.
Definition: ad525x.c:283
struct no_os_gpio_desc * gpio_shutdown
Definition: ad525x.h:173
void ad525x_write_rdac(struct ad525x_dev *dev, uint8_t address, uint16_t data)
Write data to RDAC register.
Definition: ad525x.c:346
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
Header file of AD525X Driver for Microblaze processor. This driver supporting the following devices :...
#define AD525X_CMD_RESET
Definition: ad525x.h:90
#define AD525X_CMD_DECRDAC_6DB
Definition: ad525x.h:86
#define AD525X_SHUTDOWN_HIGH
Definition: ad525x.h:61
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
uint16_t ad525x_read_rdac(struct ad525x_dev *dev, uint8_t address)
Read data from the RDAC register.
Definition: ad525x.c:283
#define MSB_BYTE_MASK
Definition: ad525x.c:41
#define AD525X_DATA10_MASK
Definition: ad525x.h:80
enum ad525_x_type_t this_device
Definition: ad525x.h:177
#define AD525X_CMD_INCRDAC_6DB
Definition: ad525x.h:91
uint16_t ad525x_read_mem(struct ad525x_dev *dev, uint8_t address)
Read data from the EEMEM.
Definition: ad525x.c:182
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:116
#define AD525X_CMD_I2C_OFFSET
Definition: ad525x.h:119
Header file of GPIO Interface.
uint16_t ad525x_read_mem(struct ad525x_dev *dev, uint8_t address)
Read data from the EEMEM.
Definition: ad525x.c:182
const struct max538x_chip_info chip_info[]
Definition: max538x.c:46
struct no_os_spi_desc * spi_desc
Definition: ad525x.h:170
@ ID_AD5251
Definition: ad525x.h:149
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:52
#define AD525X_I2C_CMD_OR_REG
Definition: ad525x.h:114
#define AD525X_RDAC_ADDR_MASK_1BIT
Definition: ad525x.h:77
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:99
@ SPI
Definition: adxl372.h:316
enum comm_type_t comm_type
Definition: ad525x.h:162
enum ad525_x_type_t this_device
Definition: ad525x.h:191
ad525_x_type_t
Definition: ad525x.h:144
struct no_os_gpio_init_param gpio_reset
Definition: ad525x.h:186
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140