no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ad5593r.c File Reference

Implementation of AD5593R driver. More...

#include "ad5592r-base.h"
#include "no_os_error.h"
#include "ad5593r.h"
Include dependency graph for ad5593r.c:

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 **device, struct ad5592r_init_param *init_param)
 

Variables

const struct ad5592r_rw_ops ad5593r_rw_ops
 

Detailed Description

Implementation of AD5593R driver.

Author
Mircea Caprioru (mirce.nosp@m.a.ca.nosp@m.prior.nosp@m.u@an.nosp@m.alog..nosp@m.com)

Copyright 2018, 2020, 2025(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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Function Documentation

◆ ad5593r_gpio_read()

int32_t ad5593r_gpio_read ( struct ad5592r_dev * dev,
uint8_t * value )

Read GPIOs.

Parameters
dev- The device structure.
value- GPIOs value.
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_init()

int32_t ad5593r_init ( struct ad5592r_dev ** device,
struct ad5592r_init_param * init_param )

Initialize AD5593r device.

Parameters
device- The device structure.
init_param- The initial parameters of the device.
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_multi_read_adc()

int32_t ad5593r_multi_read_adc ( struct ad5592r_dev * dev,
uint16_t chans,
uint16_t * values )

Read Multiple ADC Channels.

Parameters
dev- The device structure.
chans- The ADC channels to be readback
values- ADC value array
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_read_adc()

int32_t ad5593r_read_adc ( struct ad5592r_dev * dev,
uint8_t chan,
uint16_t * value )

Read ADC channel.

Parameters
dev- The device structure.
chan- The channel number.
value- ADC value
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_reg_read()

int32_t ad5593r_reg_read ( struct ad5592r_dev * dev,
uint8_t reg,
uint16_t * value )

Read register.

Parameters
dev- The device structure.
reg- The register address.
value- register value
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_reg_write()

int32_t ad5593r_reg_write ( struct ad5592r_dev * dev,
uint8_t reg,
uint16_t value )

Write register.

Parameters
dev- The device structure.
reg- The register address.
value- register value
Returns
0 in case of success, negative error code otherwise

◆ ad5593r_write_dac()

int32_t ad5593r_write_dac ( struct ad5592r_dev * dev,
uint8_t chan,
uint16_t value )

Write DAC channel.

Parameters
dev- The device structure.
chan- The channel number.
value- DAC value
Returns
0 in case of success, negative error code otherwise

Variable Documentation

◆ ad5593r_rw_ops

const struct ad5592r_rw_ops ad5593r_rw_ops
Initial value:
= {
.write_dac = ad5593r_write_dac,
.read_adc = ad5593r_read_adc,
.multi_read_adc = ad5593r_multi_read_adc,
.reg_write = ad5593r_reg_write,
.reg_read = ad5593r_reg_read,
.gpio_read = ad5593r_gpio_read,
}
int32_t ad5593r_gpio_read(struct ad5592r_dev *dev, uint8_t *value)
Definition ad5593r.c:232
int32_t ad5593r_write_dac(struct ad5592r_dev *dev, uint8_t chan, uint16_t value)
Definition ad5593r.c:55
int32_t ad5593r_reg_write(struct ad5592r_dev *dev, uint8_t reg, uint16_t value)
Definition ad5593r.c:171
int32_t ad5593r_reg_read(struct ad5592r_dev *dev, uint8_t reg, uint16_t *value)
Definition ad5593r.c:201
int32_t ad5593r_read_adc(struct ad5592r_dev *dev, uint8_t chan, uint16_t *value)
Definition ad5593r.c:85
int32_t ad5593r_multi_read_adc(struct ad5592r_dev *dev, uint16_t chans, uint16_t *values)
Definition ad5593r.c:127