no-OS
Loading...
Searching...
No Matches
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 "axi_adc_core.h"
Include dependency graph for iio_ad9361.c:

Macros

#define AXI_ADC_REG_CLOCKS_PER_PPS   0x00C0
 
#define AXI_ADC_REG_CLOCKS_PER_PPS_STATUS   0x00C4
 
#define AXI_ADC_CLOCKS_PER_PPS_STAT_INVAL   NO_OS_BIT(0)
 
#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.
 
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.
 
int32_t iio_ad9361_remove (struct iio_ad9361_desc *desc)
 Release resources.
 

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.

SPDX-License-Identifier: BSD-3-Clause

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,\
}
struct iio_attribute altvoltage_attributes[]
Definition iio_ad9361.c:2560
@ IIO_ALTVOLTAGE
Definition iio_types.h:35
#define NULL
Definition wrapper.h:67

◆ AD9361_OUT

#define AD9361_OUT ( )
Value:
{\
.name = "out",\
.attributes = out_attributes,\
.ch_out = false,\
.scan_type = NULL,\
}
struct iio_attribute out_attributes[]
Definition iio_ad9361.c:2604

◆ 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,\
}
struct iio_attribute temp0_attributes[]
Definition iio_ad9361.c:2613
@ IIO_TEMP
Definition iio_types.h:37

◆ 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,\
}
struct iio_attribute voltage_input_attributes[]
Definition iio_ad9361.c:2456
@ IIO_VOLTAGE
Definition iio_types.h:33

◆ 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,\
}
struct iio_attribute voltage_output_attributes[]
Definition iio_ad9361.c:2402

◆ AXI_ADC_CLOCKS_PER_PPS_STAT_INVAL

#define AXI_ADC_CLOCKS_PER_PPS_STAT_INVAL   NO_OS_BIT(0)

◆ AXI_ADC_REG_CLOCKS_PER_PPS

#define AXI_ADC_REG_CLOCKS_PER_PPS   0x00C0

◆ AXI_ADC_REG_CLOCKS_PER_PPS_STATUS

#define AXI_ADC_REG_CLOCKS_PER_PPS_STATUS   0x00C4

Function Documentation

◆ ad9361_parse_fir()

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

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.

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

◆ 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]
extern

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,
},
}
#define END_ATTRIBUTES_ARRAY
Definition iio_types.h:85

◆ 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[]