Go to the documentation of this file.
98 #define AD5449_CTRL_NOP 0
99 #define AD5449_CTRL_LOADUPDATE(x) (1 + 3 * (x))
100 #define AD5449_CTRL_READBACK(x) (2 + 3 * (x))
101 #define AD5449_CTRL_LOAD(x) (3 + 3 * (x))
102 #define AD5449_CTRL_UPDATEALL 7
103 #define AD5449_CTRL_LOADALL 8
104 #define AD5449_CTRL_DAISY_CHAIN 9
105 #define AD5449_CTRL_CLK_EDGE 10
106 #define AD5449_CTRL_CLR_ZERO 11
107 #define AD5449_CTRL_CLR_MID 12
108 #define AD5449_CTRL_REG 13
111 #define AD5449_CH_A 0
112 #define AD5449_CH_B 1
115 #define AD5449_ZERO_SCALE 0
116 #define AD5449_MID_SCALE 1
119 #define AD5449_CLOCK_NEGEDGE 0
120 #define AD5449_CLOCK_POSEDGE 1
123 #define AD5449_DAISY_CHAIN_DIS 0
124 #define AD5449_DAISY_CHAIN_EN 1
127 #define AD5449_SDO_MASK (3 << 10)
128 #define AD5449_DSY_MASK (1 << 9)
129 #define AD5449_HCLR_MASK (1 << 8)
130 #define AD5449_SCLK_MASK (1 << 7)
131 #define AD5449_SDO_BIT 10
132 #define AD5449_DSY_BIT 9
133 #define AD5449_HCLR_BIT 8
134 #define AD5449_SCLK_BIT 7
137 #define AD5449_LDAC_OUT no_os_gpio_direction_output(dev->gpio_ldac, \
139 #define AD5449_LDAC_LOW no_os_gpio_set_value(dev->gpio_ldac, \
141 #define AD5449_LDAC_HIGH no_os_gpio_set_value(dev->gpio_ldac, \
144 #define AD5449_CLR_OUT no_os_gpio_direction_output(dev->gpio_clr, \
146 #define AD5449_CLR_LOW no_os_gpio_set_value(dev->gpio_clr, \
148 #define AD5449_CLR_HIGH no_os_gpio_set_value(dev->gpio_clr, \
152 #define AD5449_SDO_FULL 0
153 #define AD5449_SDO_WEAK 1
154 #define AD5449_SDO_OPEN_DRAIN 2
155 #define AD5449_SDO_DISABLE 3
204 int8_t control_bits);
void ad5449_sclksetup(struct ad5449_dev *dev, int8_t value)
Set up the active clock edge of the SPI interface.
Definition: ad5449.c:455
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
void ad5449_load_all(struct ad5449_dev *dev, int16_t dac_value)
Load the DAC input registers. This function has a physical result just with devices with two channels...
Definition: ad5449.c:327
#define AD5449_CLOCK_POSEDGE
Definition: ad5449.h:120
void ad5449_update_all(struct ad5449_dev *dev)
Update the DAC outputs. This function has a physical result just with devices with two channels.
Definition: ad5449.c:309
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:82
struct no_os_gpio_init_param gpio_ldac
Definition: ad5449.h:91
#define AD5449_CTRL_REG
Definition: ad5449.h:108
#define AD5449_SDO_BIT
Definition: ad5449.h:131
Header file of SPI Interface.
#define LSB_OFFSET
Definition: ad5449.c:55
#define AD5449_CH_A
Definition: ad5449.h:111
void ad5449_daisy_chain_setup(struct ad5449_dev *dev, int8_t value)
Enable/disable the Daisy-Chain mode.
Definition: ad5449.c:388
@ ID_AD5415
Definition: ad5449.h:61
#define AD5449_CLR_HIGH
Definition: ad5449.h:148
uint8_t num_channels
Definition: ad5449.h:71
#define AD5449_CTRL_DAISY_CHAIN
Definition: ad5449.h:104
void ad5449_daisy_chain_setup(struct ad5449_dev *dev, int8_t value)
Enable/disable the Daisy-Chain mode.
Definition: ad5449.c:388
Definition: ad9361_util.h:75
#define CMD_OFFSET
Definition: ad5449.c:51
void ad5449_load_channel(struct ad5449_dev *dev, uint8_t channel, uint16_t dac_value)
Load selected DAC input register with a given value.
Definition: ad5449.c:253
uint16_t ad5449_set_input_shift_reg(struct ad5449_dev *dev, uint16_t command, uint16_t data)
Write to input register and read from output register via SPI.
Definition: ad5449.c:186
#define AD5449_LDAC_OUT
Definition: ad5449.h:137
#define AD5449_ZERO_SCALE
Definition: ad5449.h:115
#define AD5449_DSY_BIT
Definition: ad5449.h:132
bool_t
Definition: ad5446.h:63
#define DATA_MASK
Definition: ad5449.c:49
void ad5449_load_update_channel(struct ad5449_dev *dev, uint8_t channel, uint16_t dac_value)
Loads and updates the selected DAC with a given value.
Definition: ad5449.c:227
#define PKT_LENGTH
Definition: ad5449.c:56
enum bool_t has_ctrl
Definition: ad5449.h:73
void ad5449_load_channel(struct ad5449_dev *dev, uint8_t channel, uint16_t dac_value)
Load selected DAC input register with a given value.
Definition: ad5449.c:253
uint16_t ad5449_readback_channel(struct ad5449_dev *dev, uint8_t channel)
Read from the selected DAC register.
Definition: ad5449.c:278
#define MSB_OFFSET
Definition: ad5449.c:53
#define AD5449_LDAC_LOW
Definition: ad5449.h:139
struct no_os_gpio_desc * gpio_ldac
Definition: ad5449.h:80
Header file of AD5449 Driver. This driver supporting the following devices: AD5415,...
uint8_t resolution
Definition: ad5449.h:72
#define AD5449_CTRL_LOAD(x)
Definition: ad5449.h:101
@ ID_AD5443
Definition: ad5449.h:66
no_os_spi_desc * spi_desc
Definition: ad5449.h:78
#define AD5449_HCLR_MASK
Definition: ad5449.h:129
void ad5449_load_update_channel(struct ad5449_dev *dev, uint8_t channel, uint16_t dac_value)
Loads and updates the selected DAC with a given value.
Definition: ad5449.c:227
uint16_t ad5449_readback_channel(struct ad5449_dev *dev, uint8_t channel)
Read from the selected DAC register.
Definition: ad5449.c:278
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:95
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
#define AD5449_MID_SCALE
Definition: ad5449.h:116
#define AD5449_CTRL_LOADALL
Definition: ad5449.h:103
#define AD5449_CTRL_CLR_ZERO
Definition: ad5449.h:106
void ad5449_sdocontrol(struct ad5449_dev *dev, int8_t control_bits)
Control the SDO output driver strength. This function is supported by the devices : AD5415,...
Definition: ad5449.c:427
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
enum ad5449_type_t act_device
Definition: ad5449.h:94
#define MAX_RESOLUTION
Definition: ad5449.c:48
int8_t ad5449_init(struct ad5449_dev **device, struct ad5449_init_param init_param)
Initialize SPI and Initial Values for AD5449 Board.
Definition: ad5449.c:112
#define TWO_BIT_MASK
Definition: ad5449.c:58
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
#define AD5449_DSY_MASK
Definition: ad5449.h:128
#define AD5449_CTRL_UPDATEALL
Definition: ad5449.h:102
#define AD5449_CTRL_CLR_MID
Definition: ad5449.h:107
@ ID_AD5449
Definition: ad5449.h:67
ad5449_type_t
Definition: ad5449.h:60
#define MSB_MASK
Definition: ad5449.c:52
uint16_t ad5449_set_input_shift_reg(struct ad5449_dev *dev, uint16_t command, uint16_t data)
Write to input register and read from output register via SPI.
Definition: ad5449.c:186
@ ID_AD5426
Definition: ad5449.h:62
#define AD5449_SCLK_BIT
Definition: ad5449.h:134
#define AD5449_CTRL_LOADUPDATE(x)
Definition: ad5449.h:99
#define AD5449_CLR_OUT
Definition: ad5449.h:144
void ad5449_clear_scale_setup(struct ad5449_dev *dev, int8_t type)
Set up the scale where to the output will be cleared on active CLR signal.
Definition: ad5449.c:348
#define AD5449_DAISY_CHAIN_EN
Definition: ad5449.h:124
@ ID_AD5432
Definition: ad5449.h:64
#define AD5449_HCLR_BIT
Definition: ad5449.h:133
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
int8_t ad5449_init(struct ad5449_dev **device, struct ad5449_init_param init_param)
Initialize SPI and Initial Values for AD5449 Board.
Definition: ad5449.c:112
void ad5449_sclksetup(struct ad5449_dev *dev, int8_t value)
Set up the active clock edge of the SPI interface.
Definition: ad5449.c:455
@ ID_AD5429
Definition: ad5449.h:63
enum ad5449_type_t act_device
Definition: ad5449.h:83
void ad5449_load_all(struct ad5449_dev *dev, int16_t dac_value)
Load the DAC input registers. This function has a physical result just with devices with two channels...
Definition: ad5449.c:327
void ad5449_sdocontrol(struct ad5449_dev *dev, int8_t control_bits)
Control the SDO output driver strength. This function is supported by the devices : AD5415,...
Definition: ad5449.c:427
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:70
Header file of GPIO Interface.
@ ID_AD5439
Definition: ad5449.h:65
#define AD5449_SDO_FULL
Definition: ad5449.h:152
int32_t ad5449_remove(struct ad5449_dev *dev)
Free the resources allocated by ad5449_init().
Definition: ad5449.c:163
uint16_t control_reg
Definition: ad5449.h:84
void ad5449_update_all(struct ad5449_dev *dev)
Update the DAC outputs. This function has a physical result just with devices with two channels.
Definition: ad5449.c:309
struct no_os_gpio_init_param gpio_clr
Definition: ad5449.h:92
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:51
#define AD5449_SCLK_MASK
Definition: ad5449.h:130
struct no_os_gpio_desc * gpio_clr
Definition: ad5449.h:81
#define AD5449_CTRL_READBACK(x)
Definition: ad5449.h:100
#define CMD_MASK
Definition: ad5449.c:50
int32_t ad5449_remove(struct ad5449_dev *dev)
Free the resources allocated by ad5449_init().
Definition: ad5449.c:163
#define AD5449_DAISY_CHAIN_DIS
Definition: ad5449.h:123
no_os_spi_init_param spi_init
Definition: ad5449.h:89
#define AD5449_CTRL_CLK_EDGE
Definition: ad5449.h:105
#define AD5449_CLOCK_NEGEDGE
Definition: ad5449.h:119
void ad5449_clear_scale_setup(struct ad5449_dev *dev, int8_t type)
Set up the scale where to the output will be cleared on active CLR signal.
Definition: ad5449.c:348
#define AD5449_CTRL_NOP
Definition: ad5449.h:98
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112
#define AD5449_SDO_MASK
Definition: ad5449.h:127
#define LSB_MASK
Definition: ad5449.c:54