Go to the documentation of this file.
53 #define AD5766_CMD_NOP_MUX_OUT 0x00
54 #define AD5766_CMD_SDO_CNTRL 0x01
55 #define AD5766_CMD_WR_IN_REG(x) (0x10 | ((x) & 0xF))
56 #define AD5766_CMD_WR_DAC_REG(x) (0x20 | ((x) & 0xF))
57 #define AD5766_CMD_SW_LDAC 0x30
58 #define AD5766_CMD_SPAN_REG 0x40
59 #define AD5766_CMD_WR_PWR_DAC 0x50
60 #define AD5766_CMD_WR_PWR_DITHER 0x51
61 #define AD5766_CMD_WR_DAC_REG_ALL 0x60
62 #define AD5766_CMD_SW_FULL_RESET 0x70
63 #define AD5766_CMD_READBACK_REG(x) (0x80 | ((x) & 0xF))
64 #define AD5766_CMD_DITHER_SIG_1 0x90
65 #define AD5766_CMD_DITHER_SIG_2 0xA0
66 #define AD5766_CMD_INV_DITHER 0xB0
67 #define AD5766_CMD_DITHER_SCALE_1 0xC0
68 #define AD5766_CMD_DITHER_SCALE_2 0xD0
71 #define AD5766_SDO_EN (1 << 0)
74 #define AD5766_LDAC(x) (1 << ((x) & 0xF))
77 #define AD5766_CFG_CLR(x) (((x) & 0x3) << 3)
78 #define AD5766_SPAN(x) (((x) & 0x7) << 0)
81 #define AD5766_PWDN(x) (1 << ((x) & 0xF))
84 #define AD5766_RESET 0x1234
87 #define AD5766_N0(x) (1 << (2 * ((x) & 0xF)))
88 #define AD5766_N1(x) (2 << (2 * ((x) & 0xF)))
91 #define AD5766_INV_D(x) (1 << ((x) & 0xF))
94 #define AD5766_75(x) (1 << (2 * ((x) & 0xF)))
95 #define AD5766_50(x) (2 << (2 * ((x) & 0xF)))
96 #define AD5766_25(x) (3 << (2 * ((x) & 0xF)))
@ AD5766_DAC_4
Definition: ad5766.h:111
#define AD5766_CMD_WR_PWR_DITHER
Definition: ad5766.h:60
int32_t ad5766_remove(struct ad5766_dev *dev)
Free the resources allocated by ad5766_init().
Definition: ad5766.c:340
int32_t ad5766_set_dither_scale(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:218
uint32_t dither_signal_setting
Definition: ad5766.h:161
#define AD5766_CMD_SDO_CNTRL
Definition: ad5766.h:54
@ AD5766_DAC_0
Definition: ad5766.h:107
int32_t ad5766_set_pwr_dac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:153
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
uint16_t pwr_dac_setting
Definition: ad5766.h:159
@ AD5766_DAC_13
Definition: ad5766.h:120
int32_t ad5766_do_soft_reset(struct ad5766_dev *dev)
Definition: ad5766.c:236
ad5766_dac
Definition: ad5766.h:106
int32_t ad5766_set_dac_reg_all(struct ad5766_dev *dev, uint16_t data)
Definition: ad5766.c:278
Header file of AD5766 Driver.
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:165
int32_t ad5766_set_pwr_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:168
int32_t ad5766_set_inv_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:203
Header file of SPI Interface.
enum ad5766_clr clr
Definition: ad5766.h:157
int32_t ad5766_set_dither_signal(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:183
#define AD5766_CMD_WR_DAC_REG_ALL
Definition: ad5766.h:61
int32_t ad5766_remove(struct ad5766_dev *dev)
Free the resources allocated by ad5766_init().
Definition: ad5766.c:340
int32_t ad5766_spi_cmd_write(struct ad5766_dev *dev, uint8_t cmd, uint16_t data)
Definition: ad5766.c:59
Header file of Delay functions.
@ AD5766_ENABLE
Definition: ad5766.h:102
#define AD5766_CMD_DITHER_SIG_1
Definition: ad5766.h:64
Definition: ad9361_util.h:75
int32_t ad5766_set_inv_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:203
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
struct no_os_spi_desc * spi_desc
Definition: ad5766.h:143
#define AD5766_CMD_INV_DITHER
Definition: ad5766.h:66
ad5766_span
Definition: ad5766.h:125
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
#define AD5766_CMD_SW_LDAC
Definition: ad5766.h:57
@ AD5766_DAC_9
Definition: ad5766.h:116
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
struct no_os_spi_init_param spi_init
Definition: ad5766.h:152
#define AD5766_RESET
Definition: ad5766.h:84
@ AD5766_DAC_6
Definition: ad5766.h:113
@ AD5766_DAC_7
Definition: ad5766.h:114
#define AD5766_CMD_SPAN_REG
Definition: ad5766.h:58
#define AD5766_SDO_EN
Definition: ad5766.h:71
@ AD5766_DAC_11
Definition: ad5766.h:118
#define AD5766_CMD_DITHER_SCALE_2
Definition: ad5766.h:68
int32_t ad5766_set_in_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:249
@ AD5766_DAC_12
Definition: ad5766.h:119
#define AD5766_CMD_WR_PWR_DAC
Definition: ad5766.h:59
int32_t ad5766_set_pwr_dac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:153
@ AD5766_DAC_3
Definition: ad5766.h:110
int32_t ad5766_set_dac_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:264
enum ad5766_state daisy_chain_en
Definition: ad5766.h:147
@ AD5766_MID
Definition: ad5766.h:137
int32_t ad5766_set_in_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:249
int32_t ad5766_spi_readback_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint32_t *data)
Definition: ad5766.c:83
#define AD5766_CFG_CLR(x)
Definition: ad5766.h:77
ad5766_state
Definition: ad5766.h:101
@ AD5766_M_16V_TO_0V
Definition: ad5766.h:127
#define AD5766_SPAN(x)
Definition: ad5766.h:78
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:110
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
@ AD5766_DAC_10
Definition: ad5766.h:117
@ AD5766_M_5V_TO_P_6V
Definition: ad5766.h:131
@ AD5766_DAC_14
Definition: ad5766.h:121
struct no_os_gpio_init_param gpio_reset
Definition: ad5766.h:154
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
uint16_t pwr_dither_setting
Definition: ad5766.h:160
int32_t ad5766_spi_readback_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint32_t *data)
Definition: ad5766.c:83
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
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
int32_t ad5766_set_dac_reg_all(struct ad5766_dev *dev, uint16_t data)
Definition: ad5766.c:278
int32_t ad5766_set_pwr_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:168
@ AD5766_M_10V_TO_P_10V
Definition: ad5766.h:132
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:75
int32_t ad5766_set_clr_span(struct ad5766_dev *dev, enum ad5766_clr clr, enum ad5766_span span)
Definition: ad5766.c:137
int32_t ad5766_init(struct ad5766_dev **device, struct ad5766_init_param init_param)
Definition: ad5766.c:292
@ AD5766_FULL
Definition: ad5766.h:138
#define AD5766_CMD_WR_IN_REG(x)
Definition: ad5766.h:55
enum ad5766_state daisy_chain_en
Definition: ad5766.h:156
@ AD5766_DAC_1
Definition: ad5766.h:108
@ AD5766_DISABLE
Definition: ad5766.h:103
#define AD5766_CMD_DITHER_SCALE_1
Definition: ad5766.h:67
@ AD5766_M_16V_TO_P_10V
Definition: ad5766.h:130
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:203
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
uint32_t dither_scale_setting
Definition: ad5766.h:163
ad5766_clr
Definition: ad5766.h:135
@ AD5766_M_10V_TO_0V
Definition: ad5766.h:128
int32_t ad5766_set_sw_ldac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:112
int32_t ad5766_set_dither_scale(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:218
#define AD5766_CMD_READBACK_REG(x)
Definition: ad5766.h:63
#define AD5766_CMD_DITHER_SIG_2
Definition: ad5766.h:65
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:122
int32_t ad5766_do_soft_reset(struct ad5766_dev *dev)
Definition: ad5766.c:236
int32_t ad5766_set_sw_ldac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:112
Header file of GPIO Interface.
int32_t ad5766_set_clr_span(struct ad5766_dev *dev, enum ad5766_clr clr, enum ad5766_span span)
Definition: ad5766.c:137
@ AD5766_M_12V_TO_P_14V
Definition: ad5766.h:129
#define AD5766_CMD_SW_FULL_RESET
Definition: ad5766.h:62
@ AD5766_DAC_2
Definition: ad5766.h:109
int32_t ad5766_set_dac_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:264
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:58
enum ad5766_span span
Definition: ad5766.h:158
@ AD5766_ZERO
Definition: ad5766.h:136
int32_t ad5766_set_dither_signal(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:183
@ AD5766_DAC_15
Definition: ad5766.h:122
@ AD5766_M_20V_TO_0V
Definition: ad5766.h:126
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:153
int32_t ad5766_init(struct ad5766_dev **device, struct ad5766_init_param init_param)
Definition: ad5766.c:292
@ AD5766_DAC_8
Definition: ad5766.h:115
int32_t ad5766_spi_cmd_write(struct ad5766_dev *dev, uint8_t cmd, uint16_t data)
Definition: ad5766.c:59
@ AD5766_DAC_5
Definition: ad5766.h:112
struct no_os_gpio_desc * gpio_reset
Definition: ad5766.h:145
uint16_t inv_dither_setting
Definition: ad5766.h:162
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
#define AD5766_CMD_WR_DAC_REG(x)
Definition: ad5766.h:56