no-OS
Loading...
Searching...
No Matches
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

int iio_axi_dac_prepare_transfer (void *dev, uint32_t mask)
 Update active channels.
 
int iio_axi_dac_write_data (void *dev, void *buff, uint32_t nb_samples)
 Update active channels.
 
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.
 
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.
 
int32_t iio_axi_dac_remove (struct iio_axi_dac_desc *desc)
 Release resources.
 

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.

SPDX-License-Identifier: BSD-3-Clause

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.

◆ 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.

◆ iio_axi_dac_prepare_transfer()

int 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()

int 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.