no-OS
Macros | Enumerations | Functions
iio_axi_dac.c File Reference

Implementation of iio_axi_dac. Instantiates iio_axi_adc and iio_axi_dac devices, for reading/writing and parameterization. More...

#include <string.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "no_os_error.h"
#include "no_os_alloc.h"
#include "iio.h"
#include "iio_axi_dac.h"
Include dependency graph for iio_axi_dac.c:

Macros

#define STORAGE_BITS   16
 

Enumerations

enum  ch_type {
  CH_VOLTGE,
  CH_ALTVOLTGE
}
 

Functions

int32_t iio_axi_dac_prepare_transfer (void *dev, uint32_t mask)
 Update active channels. More...
 
int32_t iio_axi_dac_write_data (void *dev, void *buff, uint32_t nb_samples)
 Update active channels. More...
 
void iio_axi_dac_get_dev_descriptor (struct iio_axi_dac_desc *desc, struct iio_device **dev_descriptor)
 Create structure describing a device, channels and attributes. More...
 
int32_t iio_axi_dac_init (struct iio_axi_dac_desc **desc, struct iio_axi_dac_init_param *init)
 Registers a iio_axi_dac_desc for reading/writing and parameterization of axi_dac device. More...
 
int32_t iio_axi_dac_remove (struct iio_axi_dac_desc *desc)
 Release resources. More...
 

Detailed Description

Implementation of iio_axi_dac. Instantiates iio_axi_adc and iio_axi_dac devices, for reading/writing and parameterization.

Author
Cristian Pop (crist.nosp@m.ian..nosp@m.pop@a.nosp@m.nalo.nosp@m.g.com)

Copyright 2019(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.

Macro Definition Documentation

◆ STORAGE_BITS

#define STORAGE_BITS   16

Enumeration Type Documentation

◆ ch_type

enum ch_type
Enumerator
CH_VOLTGE 
CH_ALTVOLTGE 

Function Documentation

◆ iio_axi_dac_get_dev_descriptor()

void iio_axi_dac_get_dev_descriptor ( struct iio_axi_dac_desc desc,
struct iio_device **  dev_descriptor 
)

Create structure describing a device, channels and attributes.

Parameters
desc- Descriptor.
dev_descriptor- device descriptor.
Returns
None.
Here is the caller graph for this function:

◆ iio_axi_dac_init()

int32_t iio_axi_dac_init ( struct iio_axi_dac_desc **  desc,
struct iio_axi_dac_init_param init 
)

Registers a iio_axi_dac_desc for reading/writing and parameterization of axi_dac device.

Parameters
desc- Descriptor.
init- Configuration structure.
Returns
0 in case of success, -1 otherwise.
Here is the caller graph for this function:

◆ iio_axi_dac_prepare_transfer()

int32_t iio_axi_dac_prepare_transfer ( void *  dev,
uint32_t  mask 
)

Update active channels.

Parameters
dev- Instance of the iio_axi_dac
mask- Mask with new channels to activate
Returns
axi_dac_update_active_channels result.

◆ iio_axi_dac_remove()

int32_t iio_axi_dac_remove ( struct iio_axi_dac_desc desc)

Release resources.

Parameters
desc- Descriptor.
Returns
0 in case of success, -1 otherwise.

◆ iio_axi_dac_write_data()

int32_t iio_axi_dac_write_data ( void *  dev,
void *  buff,
uint32_t  nb_samples 
)

Update active channels.

Parameters
dev- Instance of the iio_axi_dac
buff- Buffer where to read samples
nb_samples- Number of samples
Returns
0 in case of success or negative value otherwise.