no-OS
Macros | Functions | Variables
iio_ad9361.c File Reference

Implementation of iio_ad9361 This module is a wrapper over "ad9361_api", and it is used by "iio". More...

#include <sys/types.h>
#include <inttypes.h>
#include <string.h>
#include <errno.h>
#include "no_os_error.h"
#include "iio_ad9361.h"
#include "ad9361_api.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for iio_ad9361.c:

Macros

#define AD9361_VOLTAGE_IN(_idx)
 
#define AD9361_VOLTAGE_OUT(_idx)
 
#define AD9361_ALTVOLTAGE_OUT(_idx)
 
#define AD9361_TEMP(_idx)
 
#define AD9361_OUT()
 

Functions

int32_t ad9361_parse_fir (struct ad9361_rf_phy *phy, char *data, uint32_t size)
 
void iio_ad9361_get_dev_descriptor (struct iio_ad9361_desc *desc, struct iio_device **dev_descriptor)
 Get iio device descriptor. More...
 
int32_t iio_ad9361_init (struct iio_ad9361_desc **desc, struct iio_ad9361_init_param *init)
 Init for reading/writing and parameterization of a ad9361 device. More...
 
int32_t iio_ad9361_remove (struct iio_ad9361_desc *desc)
 Release resources. More...
 

Variables

const char * ad9361_ensm_states [12]
 
struct iio_attribute voltage_output_attributes []
 
struct iio_attribute voltage_input_attributes []
 
struct iio_attribute altvoltage_attributes []
 
struct iio_attribute out_attributes []
 
struct iio_attribute temp0_attributes []
 

Detailed Description

Implementation of iio_ad9361 This module is a wrapper over "ad9361_api", and it is used by "iio".

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

◆ AD9361_ALTVOLTAGE_OUT

#define AD9361_ALTVOLTAGE_OUT (   _idx)
Value:
{\
.name = "altvoltage" # _idx,\
.attributes = altvoltage_attributes,\
.ch_out = true,\
.scan_type = NULL,\
.indexed = true,\
.channel = _idx,\
.ch_type = IIO_ALTVOLTAGE,\
}

◆ AD9361_OUT

#define AD9361_OUT ( )
Value:
{\
.name = "out",\
.attributes = out_attributes,\
.ch_out = false,\
.scan_type = NULL,\
}

◆ AD9361_TEMP

#define AD9361_TEMP (   _idx)
Value:
{\
.name = "temp" # _idx,\
.attributes = temp0_attributes,\
.ch_out = false,\
.scan_type = NULL,\
.indexed = true,\
.channel = _idx,\
.ch_type = IIO_TEMP,\
}

◆ AD9361_VOLTAGE_IN

#define AD9361_VOLTAGE_IN (   _idx)
Value:
{\
.name = "voltage" # _idx,\
.attributes = voltage_input_attributes,\
.ch_out = false,\
.scan_type = NULL,\
.indexed = true,\
.channel = _idx,\
.ch_type = IIO_VOLTAGE,\
}

◆ AD9361_VOLTAGE_OUT

#define AD9361_VOLTAGE_OUT (   _idx)
Value:
{\
.name = "voltage" # _idx,\
.attributes = voltage_output_attributes,\
.ch_out = true,\
.scan_type = NULL,\
.indexed = true,\
.channel = _idx,\
.ch_type = IIO_VOLTAGE,\
}

Function Documentation

◆ ad9361_parse_fir()

int32_t ad9361_parse_fir ( struct ad9361_rf_phy phy,
char *  data,
uint32_t  size 
)

Parse the FIR filter file/buffer.

Parameters
phyThe AD9361 state structure.
dataPointer to buffer.
sizeBuffer size.
Returns
0 in case of success, negative error code otherwise.

◆ iio_ad9361_get_dev_descriptor()

void iio_ad9361_get_dev_descriptor ( struct iio_ad9361_desc desc,
struct iio_device **  dev_descriptor 
)

Get iio device descriptor.

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

◆ iio_ad9361_init()

int32_t iio_ad9361_init ( struct iio_ad9361_desc **  desc,
struct iio_ad9361_init_param init 
)

Init for reading/writing and parameterization of a ad9361 device.

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

◆ iio_ad9361_remove()

int32_t iio_ad9361_remove ( struct iio_ad9361_desc desc)

Release resources.

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

Variable Documentation

◆ ad9361_ensm_states

const char* ad9361_ensm_states[12]

State machine modes.

◆ altvoltage_attributes

struct iio_attribute altvoltage_attributes[]

◆ out_attributes

struct iio_attribute out_attributes[]
Initial value:
= {
{
.name = "voltage_filter_fir_en",
.show = get_voltage_filter_fir_en,
.store = set_voltage_filter_fir_en,
},
}

◆ temp0_attributes

struct iio_attribute temp0_attributes[]
Initial value:
= {
{
.name = "input",
.show = get_temp0_input,
.store = NULL,
},
}

◆ voltage_input_attributes

struct iio_attribute voltage_input_attributes[]

◆ voltage_output_attributes

struct iio_attribute voltage_output_attributes[]
altvoltage_attributes
struct iio_attribute altvoltage_attributes[]
Definition: iio_ad9361.c:2011
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
IIO_ALTVOLTAGE
@ IIO_ALTVOLTAGE
Definition: iio_types.h:67
voltage_output_attributes
struct iio_attribute voltage_output_attributes[]
Definition: iio_ad9361.c:1878
voltage_input_attributes
struct iio_attribute voltage_input_attributes[]
Definition: iio_ad9361.c:1932
temp0_attributes
struct iio_attribute temp0_attributes[]
Definition: iio_ad9361.c:2064
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:65
IIO_TEMP
@ IIO_TEMP
Definition: iio_types.h:69
NULL
#define NULL
Definition: wrapper.h:64
out_attributes
struct iio_attribute out_attributes[]
Definition: iio_ad9361.c:2055