no-OS
|
Implementation of AD5593R driver. More...
Macros | |
#define | AD5593R_MODE_CONF (0 << 4) |
#define | AD5593R_MODE_DAC_WRITE (1 << 4) |
#define | AD5593R_MODE_ADC_READBACK (4 << 4) |
#define | AD5593R_MODE_DAC_READBACK (5 << 4) |
#define | AD5593R_MODE_GPIO_READBACK (6 << 4) |
#define | AD5593R_MODE_REG_READBACK (7 << 4) |
#define | STOP_BIT 1 |
#define | RESTART_BIT 0 |
#define | AD5593R_ADC_VALUES_BUFF_SIZE 18 |
Functions | |
int32_t | ad5593r_write_dac (struct ad5592r_dev *dev, uint8_t chan, uint16_t value) |
int32_t | ad5593r_read_adc (struct ad5592r_dev *dev, uint8_t chan, uint16_t *value) |
int32_t | ad5593r_multi_read_adc (struct ad5592r_dev *dev, uint16_t chans, uint16_t *values) |
int32_t | ad5593r_reg_write (struct ad5592r_dev *dev, uint8_t reg, uint16_t value) |
int32_t | ad5593r_reg_read (struct ad5592r_dev *dev, uint8_t reg, uint16_t *value) |
int32_t | ad5593r_gpio_read (struct ad5592r_dev *dev, uint8_t *value) |
int32_t | ad5593r_init (struct ad5592r_dev *dev, struct ad5592r_init_param *init_param) |
Variables | |
const struct ad5592r_rw_ops | ad5593r_rw_ops |
Implementation of AD5593R driver.
Copyright 2018, 2020(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AD5593R_ADC_VALUES_BUFF_SIZE 18 |
#define AD5593R_MODE_ADC_READBACK (4 << 4) |
#define AD5593R_MODE_CONF (0 << 4) |
#define AD5593R_MODE_DAC_READBACK (5 << 4) |
#define AD5593R_MODE_DAC_WRITE (1 << 4) |
#define AD5593R_MODE_GPIO_READBACK (6 << 4) |
#define AD5593R_MODE_REG_READBACK (7 << 4) |
#define RESTART_BIT 0 |
#define STOP_BIT 1 |
int32_t ad5593r_gpio_read | ( | struct ad5592r_dev * | dev, |
uint8_t * | value | ||
) |
Read GPIOs.
dev | - The device structure. |
value | - GPIOs value. |
int32_t ad5593r_init | ( | struct ad5592r_dev * | dev, |
struct ad5592r_init_param * | init_param | ||
) |
Initialize AD5593r device.
dev | - The device structure. |
init_param | - The initial parameters of the device. |
int32_t ad5593r_multi_read_adc | ( | struct ad5592r_dev * | dev, |
uint16_t | chans, | ||
uint16_t * | values | ||
) |
Read Multiple ADC Channels.
dev | - The device structure. |
chans | - The ADC channels to be readback |
values | - ADC value array |
int32_t ad5593r_read_adc | ( | struct ad5592r_dev * | dev, |
uint8_t | chan, | ||
uint16_t * | value | ||
) |
Read ADC channel.
dev | - The device structure. |
chan | - The channel number. |
value | - ADC value |
int32_t ad5593r_reg_read | ( | struct ad5592r_dev * | dev, |
uint8_t | reg, | ||
uint16_t * | value | ||
) |
Read register.
dev | - The device structure. |
reg | - The register address. |
value | - register value |
int32_t ad5593r_reg_write | ( | struct ad5592r_dev * | dev, |
uint8_t | reg, | ||
uint16_t | value | ||
) |
Write register.
dev | - The device structure. |
reg | - The register address. |
value | - register value |
int32_t ad5593r_write_dac | ( | struct ad5592r_dev * | dev, |
uint8_t | chan, | ||
uint16_t | value | ||
) |
Write DAC channel.
dev | - The device structure. |
chan | - The channel number. |
value | - DAC value |
const struct ad5592r_rw_ops ad5593r_rw_ops |