no-OS
iio_axi_adc.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IIO_AXI_ADC_H_
41 #define IIO_AXI_ADC_H_
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "iio_types.h"
48 #include "axi_adc_core.h"
49 #include "axi_dmac.h"
50 
51 /******************************************************************************/
52 /*************************** Types Declarations *******************************/
53 /******************************************************************************/
54 
61  struct axi_adc *adc;
63  uint32_t mask;
65  struct axi_dmac *dmac;
67  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
69  int (*get_sampling_frequency)(struct axi_adc *dev, uint32_t chan,
70  uint64_t *sampling_freq_hz);
74  char (*ch_names)[20];
75 };
76 
83  struct axi_adc *rx_adc;
85  struct axi_dmac *rx_dmac;
87  void (*dcache_invalidate_range)(uint32_t address, uint32_t bytes_count);
89  int (*get_sampling_frequency)(struct axi_adc *dev, uint32_t chan,
90  uint64_t *sampling_freq_hz);
91 };
92 
93 /******************************************************************************/
94 /************************ Functions Declarations ******************************/
95 /******************************************************************************/
96 
97 /* Init iio. */
98 int32_t iio_axi_adc_init(struct iio_axi_adc_desc **desc,
99  struct iio_axi_adc_init_param *param);
100 
103  struct iio_device **dev_descriptor);
104 
105 /* Free the resources allocated by iio_axi_adc_init(). */
106 int32_t iio_axi_adc_remove(struct iio_axi_adc_desc *desc);
107 
108 #endif // IIO_AXI_ADC_H_
axi_adc_core.h
Driver for the Analog Devices AXI-ADC-CORE module.
iio_device::read_dev
int32_t(* read_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition: iio_types.h:263
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:110
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
scan_type::sign
char sign
Definition: iio_types.h:158
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:250
iio_axi_adc_desc::dev_descriptor
struct iio_device dev_descriptor
Definition: iio_axi_adc.h:72
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:97
iio_axi_adc_init_param::rx_dmac
struct axi_dmac * rx_dmac
Definition: iio_axi_adc.h:85
axi_dmac_transfer_wait_completion
int32_t axi_dmac_transfer_wait_completion(struct axi_dmac *dmac, uint32_t timeout_ms)
Definition: axi_dmac.c:506
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:56
axi_adc
AXI ADC Device Descriptor.
Definition: axi_adc_core.h:125
iio_axi_adc_init_param::dcache_invalidate_range
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: iio_axi_adc.h:87
device
Definition: ad9361_util.h:75
iio_axi_adc_desc::dmac
struct axi_dmac * dmac
Definition: iio_axi_adc.h:65
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:177
iio_axi_adc_init_param
iio configuration.
Definition: iio_axi_adc.h:81
iio_axi_adc_remove
int32_t iio_axi_adc_remove(struct iio_axi_adc_desc *desc)
Release resources.
Definition: iio_axi_adc.c:524
iio_axi_adc_desc
iio_axi_adc_descriptor
Definition: iio_axi_adc.h:59
axi_adc_set_calib_phase
int32_t axi_adc_set_calib_phase(struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
Calibrate phase for specific AXI ADC channel.
Definition: axi_adc_core.c:409
axi_dma_transfer
Definition: axi_dmac.h:106
iio_channel::channel
int channel
Definition: iio_types.h:179
axi_adc::num_channels
uint8_t num_channels
Definition: axi_adc_core.h:131
iio_device::pre_enable
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition: iio_types.h:272
iio.h
Header file of iio.
iio_axi_adc_init
int32_t iio_axi_adc_init(struct iio_axi_adc_desc **desc, struct iio_axi_adc_init_param *init)
Registers a iio_axi_adc_desc for reading/writing and parameterization of axi_adc device.
Definition: iio_axi_adc.c:484
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:136
iio_axi_adc_desc::get_sampling_frequency
int(* get_sampling_frequency)(struct axi_adc *dev, uint32_t chan, uint64_t *sampling_freq_hz)
Definition: iio_axi_adc.h:69
iio_channel::name
const char * name
Definition: iio_types.h:175
iio_axi_adc_prepare_transfer
int32_t iio_axi_adc_prepare_transfer(void *dev, uint32_t mask)
Update active channels.
Definition: iio_axi_adc.c:333
axi_adc_get_calib_bias
int32_t axi_adc_get_calib_bias(struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
Get the scale calibration values for AXI ADC channel.
Definition: axi_adc_core.c:497
axi_dmac.h
Driver for the Analog Devices AXI-DMAC core.
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
iio_axi_adc.h
Header file of iio_axi_adc.
iio_axi_adc_remove
int32_t iio_axi_adc_remove(struct iio_axi_adc_desc *desc)
Release resources.
Definition: iio_axi_adc.c:524
no_os_str_to_int32
int32_t no_os_str_to_int32(const char *str)
axi_adc_get_calib_phase
int32_t axi_adc_get_calib_phase(struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
Get the phase calibration values for AXI ADC channel.
Definition: axi_adc_core.c:425
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:71
iio_axi_adc_desc::dcache_invalidate_range
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: iio_axi_adc.h:67
iio_axi_adc_desc::mask
uint32_t mask
Definition: iio_axi_adc.h:63
axi_adc_get_calib_scale
int32_t axi_adc_get_calib_scale(struct axi_adc *adc, uint32_t chan, int32_t *val, int32_t *val2)
Get the scale calibration values for AXI ADC channel.
Definition: axi_adc_core.c:457
axi_adc_update_active_channels
int32_t axi_adc_update_active_channels(struct axi_adc *adc, uint32_t mask)
Update active AXI ADC channels.
Definition: axi_adc_core.c:515
iio_axi_adc_init
int32_t iio_axi_adc_init(struct iio_axi_adc_desc **desc, struct iio_axi_adc_init_param *param)
Registers a iio_axi_adc_desc for reading/writing and parameterization of axi_adc device.
Definition: iio_axi_adc.c:484
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:248
iio_channel::scan_type
struct scan_type * scan_type
Definition: iio_types.h:189
NO
@ NO
Definition: axi_dmac.h:102
iio_axi_adc_init_param::rx_adc
struct axi_adc * rx_adc
Definition: iio_axi_adc.h:83
NULL
#define NULL
Definition: wrapper.h:64
iio_axi_adc_desc::ch_names
char(* ch_names)[20]
Definition: iio_axi_adc.h:74
iio_channel::scan_index
int scan_index
Definition: iio_types.h:187
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:99
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:243
iio_axi_adc_desc::adc
struct axi_adc * adc
Definition: iio_axi_adc.h:61
get_sampling_frequency
int get_sampling_frequency(struct axi_adc *dev, uint32_t chan, uint64_t *sampling_freq_hz)
Definition: headless.c:80
scan_type
Definition: iio_types.h:156
STORAGE_BITS
#define STORAGE_BITS
Definition: iio_axi_adc.c:57
axi_dmac_transfer_start
int32_t axi_dmac_transfer_start(struct axi_dmac *dmac, struct axi_dma_transfer *dma_transfer)
Definition: axi_dmac.c:378
iio_axi_adc_get_dev_descriptor
void iio_axi_adc_get_dev_descriptor(struct iio_axi_adc_desc *desc, struct iio_device **dev_descriptor)
Get device descriptor.
Definition: iio_axi_adc.c:471
no_os_hweight32
unsigned int no_os_hweight32(uint32_t word)
axi_adc_set_calib_bias
int32_t axi_adc_set_calib_bias(struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
Calibrate bias for specific AXI ADC channel.
Definition: axi_adc_core.c:473
iio_axi_adc_init_param::get_sampling_frequency
int(* get_sampling_frequency)(struct axi_adc *dev, uint32_t chan, uint64_t *sampling_freq_hz)
Definition: iio_axi_adc.h:89
axi_adc_set_calib_scale
int32_t axi_adc_set_calib_scale(struct axi_adc *adc, uint32_t chan, int32_t val, int32_t val2)
Calibrate scale for specific AXI ADC channel.
Definition: axi_adc_core.c:441
iio_axi_adc_get_dev_descriptor
void iio_axi_adc_get_dev_descriptor(struct iio_axi_adc_desc *desc, struct iio_device **dev_descriptor)
Get device descriptor.
Definition: iio_axi_adc.c:471
axi_dma_transfer::size
uint32_t size
Definition: axi_dmac.h:107
axi_adc_get_sampling_freq
int32_t axi_adc_get_sampling_freq(struct axi_adc *adc, uint32_t chan, uint64_t *sampling_freq)
Get the AXI ADC Sampling Frequency.
Definition: axi_adc_core.c:147
axi_dmac
Definition: axi_dmac.h:114
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:254
iio_axi_adc_read_dev
int32_t iio_axi_adc_read_dev(void *dev, void *buff, uint32_t nb_samples)
Update active channels.
Definition: iio_axi_adc.c:349