Go to the documentation of this file.
50 #define AD5629R_I2C_ADDR_0 0x54 // A1=0 and A0=0 (A0_Pin=High)
51 #define AD5629R_I2C_ADDR_1 0x56 // A1=1 and A0=0 (A0_Pin=NC)
52 #define AD5629R_I2C_ADDR_2 0x57 // A1=1 and A0=1 (A0_Pin=Low)
54 #define MAX_RESOLUTION 16
57 #define AD5629R_WRITE_N 0x0
58 #define AD5629R_UPDATE_N 0x1
59 #define AD5629R_WRITE_N_UPDATE_ALL 0x2
60 #define AD5629R_WRITE_N_UPDATE_N 0x3
61 #define AD5629R_POWER 0x4
62 #define AD5629R_LOAD_CLEAR_REG 0x5
63 #define AD5629R_LOAD_LDAC_REG 0x6
64 #define AD5629R_RESET 0x7
65 #define AD5629R_REFERENCE 0x8
69 #define AD5629R_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
71 #define AD5629R_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
73 #define AD5629R_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
76 #define AD5629R_CLR_OUT no_os_gpio_direction_output(dev->gpio_clr, \
78 #define AD5629R_CLR_LOW no_os_gpio_set_value(dev->gpio_clr, \
80 #define AD5629R_CLR_HIGH no_os_gpio_set_value(dev->gpio_clr, \
84 #define AD5629R_DAC_A_ADDR 0x0
85 #define AD5629R_DAC_B_ADDR 0x1
86 #define AD5629R_DAC_C_ADDR 0x2
87 #define AD5629R_DAC_D_ADDR 0x3
88 #define AD5629R_DAC_E_ADDR 0x4
89 #define AD5629R_DAC_F_ADDR 0x5
90 #define AD5629R_DAC_G_ADDR 0x6
91 #define AD5629R_DAC_H_ADDR 0x7
92 #define AD5629R_DAC_ALL_ADDR 0xF
102 #define DAC_H_SEL 128
106 #define PWR_1K_TO_GND 1
107 #define PWR_100K_TO_GND 2
108 #define PWR_3_STATE 3
111 #define CLR_TO_ZEROSCALE 0
112 #define CLR_TO_MIDSCALE 1
113 #define CLR_TO_FULLSCALE 2
195 uint8_t clear_value);
enum ad5629r_type act_device
Definition: ad5629r.h:151
Definition: ad5629r.h:154
@ ID_AD5668
Definition: ad5629r.h:127
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int32_t ad5629r_remove(struct ad5629r_dev *dev)
Free the resources allocated by AD5629R_Init().
Definition: ad5629r.c:123
#define AD5629R_LOAD_LDAC_REG
Definition: ad5629r.h:63
void ad5629r_set_ctrl(struct ad5629r_dev *dev, uint8_t function, uint8_t dac_n, uint32_t data)
Write to input register and read from output register via SPI.
Definition: ad5629r.c:153
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
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
void ad5629r_write_reg_nupdate_all(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N of selected DAC channel, then updates all.
Definition: ad5629r.c:274
struct no_os_spi_desc * spi_desc
Definition: ad5629r.h:146
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
void ad5629r_reset(struct ad5629r_dev *dev)
Makes a power-on reset.
Definition: ad5629r.c:395
void ad5629r_write_reg_nupdate_n(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N and updates the respective DAC channel.
Definition: ad5629r.c:294
Header file of SPI Interface.
void ad5629r_set_power_mode(struct ad5629r_dev *dev, uint8_t dac_sel, uint8_t mode)
Sets the power mode for one or more selected DAC channels.
Definition: ad5629r.c:321
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
comm_type_t
Definition: ad5629r.h:132
enum comm_type_t communication
Definition: ad5629r.h:139
#define AD5629R_WRITE_N_UPDATE_ALL
Definition: ad5629r.h:59
int8_t ad5629r_init(struct ad5629r_dev **device, struct ad5629r_init_param init_param)
Initializes the communication with the device.
Definition: ad5629r.c:85
struct no_os_i2c_init_param i2c_init
Definition: ad5629r.h:156
Definition: ad9361_util.h:69
@ ID_AD5628
Definition: ad5629r.h:129
@ ID_AD5629R
Definition: ad5629r.h:125
struct no_os_gpio_desc * gpio_ldac
Definition: ad5629r.h:148
#define AD5629R_LDAC_LOW
Definition: ad5629r.h:71
@ com_spi
Definition: ad5629r.h:133
ad5629r_type
Definition: ad5629r.h:124
Header file of AD5629R Driver for Microblaze processor.
int8_t ad5629r_init(struct ad5629r_dev **device, struct ad5629r_init_param init_param)
Initializes the communication with the device.
Definition: ad5629r.c:85
void ad5629r_write_reg_n(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N of selected DAC channel.
Definition: ad5629r.c:237
enum ad5629r_type act_device
Definition: ad5629r.h:163
void ad5629r_write_reg_nupdate_all(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N of selected DAC channel, then updates all.
Definition: ad5629r.c:274
void ad5629r_set_input_reg(struct ad5629r_dev *dev, uint8_t function, uint8_t dac_n, uint16_t dac_value)
Write to input register and read from output register via SPI.
Definition: ad5629r.c:195
void ad5629r_update_dac_n(struct ad5629r_dev *dev, uint8_t dac_n)
Updates selected DAC register.
Definition: ad5629r.c:255
#define AD5629R_WRITE_N
Definition: ad5629r.h:57
#define AD5629R_LDAC_OUT
Definition: ad5629r.h:69
struct no_os_spi_init_param spi_init
Definition: ad5629r.h:158
#define AD5629R_CLR_HIGH
Definition: ad5629r.h:80
@ ID_AD5669R
Definition: ad5629r.h:126
void ad5629r_load_clear_code_reg(struct ad5629r_dev *dev, uint8_t clear_value)
Loads the Clear Code Register with a certain value.
Definition: ad5629r.c:348
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
@ com_i2c
Definition: ad5629r.h:134
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
void ad5629r_load_ldac_reg(struct ad5629r_dev *dev, uint8_t dac_sel)
Loads the LDAC register with a certain value.
Definition: ad5629r.c:375
void ad5629r_load_clear_code_reg(struct ad5629r_dev *dev, uint8_t clear_value)
Loads the Clear Code Register with a certain value.
Definition: ad5629r.c:348
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
void ad5629r_set_ref(struct ad5629r_dev *dev, uint8_t status)
Turns on/off the internal reference.
Definition: ad5629r.c:413
struct no_os_gpio_desc * gpio_clr
Definition: ad5629r.h:149
struct no_os_gpio_init_param gpio_clr
Definition: ad5629r.h:161
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
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
Header file of I2C Interface.
#define AD5629R_LOAD_CLEAR_REG
Definition: ad5629r.h:62
#define AD5629R_REFERENCE
Definition: ad5629r.h:65
Definition: ad5629r.h:142
@ ID_AD5648
Definition: ad5629r.h:128
#define AD5629R_RESET
Definition: ad5629r.h:64
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
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
#define AD5629R_POWER
Definition: ad5629r.h:61
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define AD5629R_UPDATE_N
Definition: ad5629r.h:58
#define MAX_RESOLUTION
Definition: ad5446.c:43
void ad5629r_load_ldac_reg(struct ad5629r_dev *dev, uint8_t dac_sel)
Loads the LDAC register with a certain value.
Definition: ad5629r.c:375
#define AD5629R_CLR_OUT
Definition: ad5629r.h:76
int32_t ad5629r_remove(struct ad5629r_dev *dev)
Free the resources allocated by AD5629R_Init().
Definition: ad5629r.c:123
Definition: ad5629r.h:137
void ad5629r_set_ref(struct ad5629r_dev *dev, uint8_t status)
Turns on/off the internal reference.
Definition: ad5629r.c:413
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 AD5629R_WRITE_N_UPDATE_N
Definition: ad5629r.h:60
Header file of GPIO Interface.
struct no_os_i2c_desc * i2c_desc
Definition: ad5629r.h:144
void ad5629r_write_reg_n(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N of selected DAC channel.
Definition: ad5629r.c:237
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
struct no_os_gpio_init_param gpio_ldac
Definition: ad5629r.h:160
void ad5629r_update_dac_n(struct ad5629r_dev *dev, uint8_t dac_n)
Updates selected DAC register.
Definition: ad5629r.c:255
void ad5629r_set_power_mode(struct ad5629r_dev *dev, uint8_t dac_sel, uint8_t mode)
Sets the power mode for one or more selected DAC channels.
Definition: ad5629r.c:321
uint32_t resolution
Definition: ad5629r.h:138
void ad5629r_reset(struct ad5629r_dev *dev)
Makes a power-on reset.
Definition: ad5629r.c:395
void ad5629r_write_reg_nupdate_n(struct ad5629r_dev *dev, uint8_t dac_n, uint16_t dac_value)
Writes a value to Input Register N and updates the respective DAC channel.
Definition: ad5629r.c:294
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140