Go to the documentation of this file.
47 #define AD5766_CMD_NOP_MUX_OUT 0x00
48 #define AD5766_CMD_SDO_CNTRL 0x01
49 #define AD5766_CMD_WR_IN_REG(x) (0x10 | ((x) & 0xF))
50 #define AD5766_CMD_WR_DAC_REG(x) (0x20 | ((x) & 0xF))
51 #define AD5766_CMD_SW_LDAC 0x30
52 #define AD5766_CMD_SPAN_REG 0x40
53 #define AD5766_CMD_WR_PWR_DAC 0x50
54 #define AD5766_CMD_WR_PWR_DITHER 0x51
55 #define AD5766_CMD_WR_DAC_REG_ALL 0x60
56 #define AD5766_CMD_SW_FULL_RESET 0x70
57 #define AD5766_CMD_READBACK_REG(x) (0x80 | ((x) & 0xF))
58 #define AD5766_CMD_DITHER_SIG_1 0x90
59 #define AD5766_CMD_DITHER_SIG_2 0xA0
60 #define AD5766_CMD_INV_DITHER 0xB0
61 #define AD5766_CMD_DITHER_SCALE_1 0xC0
62 #define AD5766_CMD_DITHER_SCALE_2 0xD0
65 #define AD5766_SDO_EN (1 << 0)
68 #define AD5766_LDAC(x) (1 << ((x) & 0xF))
71 #define AD5766_CFG_CLR(x) (((x) & 0x3) << 3)
72 #define AD5766_SPAN(x) (((x) & 0x7) << 0)
75 #define AD5766_PWDN(x) (1 << ((x) & 0xF))
78 #define AD5766_RESET 0x1234
81 #define AD5766_N0(x) (1 << (2 * ((x) & 0xF)))
82 #define AD5766_N1(x) (2 << (2 * ((x) & 0xF)))
85 #define AD5766_INV_D(x) (1 << ((x) & 0xF))
88 #define AD5766_75(x) (1 << (2 * ((x) & 0xF)))
89 #define AD5766_50(x) (2 << (2 * ((x) & 0xF)))
90 #define AD5766_25(x) (3 << (2 * ((x) & 0xF)))
@ AD5766_DAC_4
Definition: ad5766.h:105
#define AD5766_CMD_WR_PWR_DITHER
Definition: ad5766.h:54
int32_t ad5766_remove(struct ad5766_dev *dev)
Free the resources allocated by ad5766_init().
Definition: ad5766.c:334
int32_t ad5766_set_dither_scale(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:212
uint32_t dither_signal_setting
Definition: ad5766.h:155
#define AD5766_CMD_SDO_CNTRL
Definition: ad5766.h:48
@ AD5766_DAC_0
Definition: ad5766.h:101
int32_t ad5766_set_pwr_dac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:147
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
uint16_t pwr_dac_setting
Definition: ad5766.h:153
@ AD5766_DAC_13
Definition: ad5766.h:114
int32_t ad5766_do_soft_reset(struct ad5766_dev *dev)
Definition: ad5766.c:230
ad5766_dac
Definition: ad5766.h:100
int32_t ad5766_set_dac_reg_all(struct ad5766_dev *dev, uint16_t data)
Definition: ad5766.c:272
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:159
int32_t ad5766_set_pwr_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:162
int32_t ad5766_set_inv_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:197
Header file of SPI Interface.
enum ad5766_clr clr
Definition: ad5766.h:151
int32_t ad5766_set_dither_signal(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:177
#define AD5766_CMD_WR_DAC_REG_ALL
Definition: ad5766.h:55
int32_t ad5766_remove(struct ad5766_dev *dev)
Free the resources allocated by ad5766_init().
Definition: ad5766.c:334
int32_t ad5766_spi_cmd_write(struct ad5766_dev *dev, uint8_t cmd, uint16_t data)
Definition: ad5766.c:53
Header file of Delay functions.
@ AD5766_ENABLE
Definition: ad5766.h:96
#define AD5766_CMD_DITHER_SIG_1
Definition: ad5766.h:58
Definition: ad9361_util.h:69
int32_t ad5766_set_inv_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:197
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
struct no_os_spi_desc * spi_desc
Definition: ad5766.h:137
#define AD5766_CMD_INV_DITHER
Definition: ad5766.h:60
ad5766_span
Definition: ad5766.h:119
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
#define AD5766_CMD_SW_LDAC
Definition: ad5766.h:51
@ AD5766_DAC_9
Definition: ad5766.h:110
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
struct no_os_spi_init_param spi_init
Definition: ad5766.h:146
#define AD5766_RESET
Definition: ad5766.h:78
@ AD5766_DAC_6
Definition: ad5766.h:107
@ AD5766_DAC_7
Definition: ad5766.h:108
#define AD5766_CMD_SPAN_REG
Definition: ad5766.h:52
#define AD5766_SDO_EN
Definition: ad5766.h:65
@ AD5766_DAC_11
Definition: ad5766.h:112
#define AD5766_CMD_DITHER_SCALE_2
Definition: ad5766.h:62
int32_t ad5766_set_in_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:243
@ AD5766_DAC_12
Definition: ad5766.h:113
#define AD5766_CMD_WR_PWR_DAC
Definition: ad5766.h:53
int32_t ad5766_set_pwr_dac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:147
@ AD5766_DAC_3
Definition: ad5766.h:104
int32_t ad5766_set_dac_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:258
enum ad5766_state daisy_chain_en
Definition: ad5766.h:141
@ AD5766_MID
Definition: ad5766.h:131
int32_t ad5766_set_in_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:243
int32_t ad5766_spi_readback_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint32_t *data)
Definition: ad5766.c:77
#define AD5766_CFG_CLR(x)
Definition: ad5766.h:71
ad5766_state
Definition: ad5766.h:95
@ AD5766_M_16V_TO_0V
Definition: ad5766.h:121
#define AD5766_SPAN(x)
Definition: ad5766.h:72
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
@ AD5766_DAC_10
Definition: ad5766.h:111
@ AD5766_M_5V_TO_P_6V
Definition: ad5766.h:125
@ AD5766_DAC_14
Definition: ad5766.h:115
struct no_os_gpio_init_param gpio_reset
Definition: ad5766.h:148
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
uint16_t pwr_dither_setting
Definition: ad5766.h:154
int32_t ad5766_spi_readback_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint32_t *data)
Definition: ad5766.c:77
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
int32_t ad5766_set_dac_reg_all(struct ad5766_dev *dev, uint16_t data)
Definition: ad5766.c:272
int32_t ad5766_set_pwr_dither(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:162
@ AD5766_M_10V_TO_P_10V
Definition: ad5766.h:126
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
int32_t ad5766_set_clr_span(struct ad5766_dev *dev, enum ad5766_clr clr, enum ad5766_span span)
Definition: ad5766.c:131
int32_t ad5766_init(struct ad5766_dev **device, struct ad5766_init_param init_param)
Definition: ad5766.c:286
@ AD5766_FULL
Definition: ad5766.h:132
#define AD5766_CMD_WR_IN_REG(x)
Definition: ad5766.h:49
enum ad5766_state daisy_chain_en
Definition: ad5766.h:150
@ AD5766_DAC_1
Definition: ad5766.h:102
@ AD5766_DISABLE
Definition: ad5766.h:97
#define AD5766_CMD_DITHER_SCALE_1
Definition: ad5766.h:61
@ AD5766_M_16V_TO_P_10V
Definition: ad5766.h:124
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:197
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
uint32_t dither_scale_setting
Definition: ad5766.h:157
ad5766_clr
Definition: ad5766.h:129
@ AD5766_M_10V_TO_0V
Definition: ad5766.h:122
int32_t ad5766_set_sw_ldac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:106
int32_t ad5766_set_dither_scale(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:212
#define AD5766_CMD_READBACK_REG(x)
Definition: ad5766.h:57
#define AD5766_CMD_DITHER_SIG_2
Definition: ad5766.h:59
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
int32_t ad5766_do_soft_reset(struct ad5766_dev *dev)
Definition: ad5766.c:230
int32_t ad5766_set_sw_ldac(struct ad5766_dev *dev, uint16_t setting)
Definition: ad5766.c:106
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:131
@ AD5766_M_12V_TO_P_14V
Definition: ad5766.h:123
#define AD5766_CMD_SW_FULL_RESET
Definition: ad5766.h:56
@ AD5766_DAC_2
Definition: ad5766.h:103
int32_t ad5766_set_dac_reg(struct ad5766_dev *dev, enum ad5766_dac dac, uint16_t data)
Definition: ad5766.c:258
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
enum ad5766_span span
Definition: ad5766.h:152
@ AD5766_ZERO
Definition: ad5766.h:130
int32_t ad5766_set_dither_signal(struct ad5766_dev *dev, uint32_t setting)
Definition: ad5766.c:177
@ AD5766_DAC_15
Definition: ad5766.h:116
@ AD5766_M_20V_TO_0V
Definition: ad5766.h:120
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:147
int32_t ad5766_init(struct ad5766_dev **device, struct ad5766_init_param init_param)
Definition: ad5766.c:286
@ AD5766_DAC_8
Definition: ad5766.h:109
int32_t ad5766_spi_cmd_write(struct ad5766_dev *dev, uint8_t cmd, uint16_t data)
Definition: ad5766.c:53
@ AD5766_DAC_5
Definition: ad5766.h:106
struct no_os_gpio_desc * gpio_reset
Definition: ad5766.h:139
uint16_t inv_dither_setting
Definition: ad5766.h:156
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define AD5766_CMD_WR_DAC_REG(x)
Definition: ad5766.h:50