no-OS
iio_axi_dac.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IIO_AXI_DAC_H_
41 #define IIO_AXI_DAC_H_
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "iio_types.h"
48 #include "axi_dac_core.h"
49 #include "axi_dmac.h"
50 
51 /******************************************************************************/
52 /*************************** Types Declarations *******************************/
53 /******************************************************************************/
54 
60  struct axi_dac *dac;
62  struct axi_dmac *dmac;
64  uint32_t mask;
66  void (*dcache_flush_range)(uint32_t address, uint32_t bytes_count);
70  char (*ch_names)[20];
71 };
72 
79  struct axi_dac *tx_dac;
81  struct axi_dmac *tx_dmac;
83  void (*dcache_flush_range)(uint32_t address, uint32_t bytes_count);
84 };
85 
86 /******************************************************************************/
87 /************************ Functions Declarations ******************************/
88 /******************************************************************************/
89 
90 /* Init application. */
91 int32_t iio_axi_dac_init(struct iio_axi_dac_desc **desc,
92  struct iio_axi_dac_init_param *param);
95  struct iio_device **dev_descriptor);
96 /* Free the resources allocated by iio_axi_dac_init(). */
97 int32_t iio_axi_dac_remove(struct iio_axi_dac_desc *desc);
98 
99 #endif // IIO_AXI_DAC_H_
axi_dac_dds_set_calib_scale
int32_t axi_dac_dds_set_calib_scale(struct axi_dac *dac, uint32_t chan, int32_t val, int32_t val2)
Calibrate scale for specific AXI DAC channel.
Definition: axi_dac_core.c:697
iio_axi_dac_init
int32_t iio_axi_dac_init(struct iio_axi_dac_desc **desc, struct iio_axi_dac_init_param *param)
Registers a iio_axi_dac_desc for reading/writing and parameterization of axi_dac device.
Definition: iio_axi_dac.c:661
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:114
iio_channel
Struct describing the scan type.
Definition: iio_types.h:177
scan_type::sign
char sign
Definition: iio_types.h:162
axi_dac_dds_get_calib_scale
int32_t axi_dac_dds_get_calib_scale(struct axi_dac *dac, uint32_t chan, int32_t *val, int32_t *val2)
Get the scale calibration values for AXI DAC channel.
Definition: axi_dac_core.c:713
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:261
iio_axi_dac_prepare_transfer
int32_t iio_axi_dac_prepare_transfer(void *dev, uint32_t mask)
Update active channels.
Definition: iio_axi_dac.c:469
iio_axi_dac_desc::dev_descriptor
struct iio_device dev_descriptor
Definition: iio_axi_dac.h:68
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:101
AXI_DAC_DATA_SEL_DDS
@ AXI_DAC_DATA_SEL_DDS
Definition: axi_dac_core.h:79
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:56
iio_axi_dac_desc::dac
struct axi_dac * dac
Definition: iio_axi_dac.h:60
axi_dac_dds_set_phase
int32_t axi_dac_dds_set_phase(struct axi_dac *dac, uint32_t chan, uint32_t phase)
AXI DAC Set DDS phase for specific channel.
Definition: axi_dac_core.c:451
device
Definition: ad9361_util.h:75
axi_dac_dds_set_frequency
int32_t axi_dac_dds_set_frequency(struct axi_dac *dac, uint32_t chan, uint32_t freq_hz)
AXI DAC Set DDS frequency for specific channel.
Definition: axi_dac_core.c:402
iio_device::write_dev
int32_t(* write_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition: iio_types.h:277
IIO_ALTVOLTAGE
@ IIO_ALTVOLTAGE
Definition: iio_types.h:73
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:181
axi_dac_dds_set_scale
int32_t axi_dac_dds_set_scale(struct axi_dac *dac, uint32_t chan, int32_t scale_micro_units)
AXI DAC Set DDS scale for specific channel.
Definition: axi_dac_core.c:502
axi_dac_core.h
Driver for the Analog Devices AXI-DAC-CORE module.
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.
Definition: iio_axi_dac.c:648
CH_VOLTGE
@ CH_VOLTGE
Definition: iio_axi_dac.c:529
iio_axi_dac_init_param
Definition: iio_axi_dac.h:77
no_os_str_to_uint32
uint32_t no_os_str_to_uint32(const char *str)
iio_axi_dac_desc::dcache_flush_range
void(* dcache_flush_range)(uint32_t address, uint32_t bytes_count)
Definition: iio_axi_dac.h:66
axi_dma_transfer
Definition: axi_dmac.h:106
axi_dac_dds_get_calib_phase
int32_t axi_dac_dds_get_calib_phase(struct axi_dac *dac, uint32_t chan, int32_t *val, int32_t *val2)
Get the phase calibration values for AXI DAC channel.
Definition: axi_dac_core.c:745
iio_channel::channel
int channel
Definition: iio_types.h:183
iio_device::pre_enable
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition: iio_types.h:281
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:140
axi_dac_set_datasel
int32_t axi_dac_set_datasel(struct axi_dac *dac, int32_t chan, enum axi_dac_data_sel sel)
AXI DAC Set Data type for specific channel.
Definition: axi_dac_core.c:378
iio_axi_dac_desc::dmac
struct axi_dmac * dmac
Definition: iio_axi_dac.h:62
iio_channel::name
const char * name
Definition: iio_types.h:179
CH_ALTVOLTGE
@ CH_ALTVOLTGE
Definition: iio_axi_dac.c:530
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:138
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.
Definition: iio_axi_dac.c:648
axi_dma_transfer::dest_addr
uint32_t dest_addr
Definition: axi_dmac.h:111
iio_axi_dac_init_param::tx_dmac
struct axi_dmac * tx_dmac
Definition: iio_axi_dac.h:81
axi_dac
AXI DAC Device Descriptor.
Definition: axi_dac_core.h:54
axi_dac::num_channels
uint8_t num_channels
Definition: axi_dac_core.h:60
iio_axi_dac_remove
int32_t iio_axi_dac_remove(struct iio_axi_dac_desc *desc)
Release resources.
Definition: iio_axi_dac.c:699
IIO_VOLTAGE
@ IIO_VOLTAGE
Definition: iio_types.h:71
iio_axi_dac_desc
Definition: iio_axi_dac.h:59
iio_axi_dac_init_param::tx_dac
struct axi_dac * tx_dac
Definition: iio_axi_dac.h:79
iio_axi_dac_remove
int32_t iio_axi_dac_remove(struct iio_axi_dac_desc *desc)
Release resources.
Definition: iio_axi_dac.c:699
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:259
iio_channel::scan_type
struct scan_type * scan_type
Definition: iio_types.h:193
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
CYCLIC
@ CYCLIC
Definition: axi_dmac.h:103
NULL
#define NULL
Definition: wrapper.h:64
iio_channel::scan_index
int scan_index
Definition: iio_types.h:191
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:103
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:254
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.
Definition: iio_axi_dac.c:661
iio_axi_dac.h
Header file of iio_axi_dac.
STORAGE_BITS
#define STORAGE_BITS
Definition: iio_axi_dac.c:57
iio_axi_dac_desc::ch_names
char(* ch_names)[20]
Definition: iio_axi_dac.h:70
axi_dac_dds_get_scale
int32_t axi_dac_dds_get_scale(struct axi_dac *dac, uint32_t chan, int32_t *scale_micro_units)
AXI DAC Get DDS scale for specific channel.
Definition: axi_dac_core.c:533
iio_axi_dac_write_data
int32_t iio_axi_dac_write_data(void *dev, void *buff, uint32_t nb_samples)
Update active channels.
Definition: iio_axi_dac.c:498
scan_type
Definition: iio_types.h:160
iio_axi_dac_init_param::dcache_flush_range
void(* dcache_flush_range)(uint32_t address, uint32_t bytes_count)
Definition: iio_axi_dac.h:83
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_dac_desc::mask
uint32_t mask
Definition: iio_axi_dac.h:64
AXI_DAC_DATA_SEL_DMA
@ AXI_DAC_DATA_SEL_DMA
Definition: axi_dac_core.h:81
no_os_hweight32
unsigned int no_os_hweight32(uint32_t word)
axi_dac_dds_set_calib_phase
int32_t axi_dac_dds_set_calib_phase(struct axi_dac *dac, uint32_t chan, int32_t val, int32_t val2)
Calibrate phase for specific AXI DAC channel.
Definition: axi_dac_core.c:729
axi_dma_transfer::size
uint32_t size
Definition: axi_dmac.h:107
axi_dac_dds_get_phase
int32_t axi_dac_dds_get_phase(struct axi_dac *dac, uint32_t chan, uint32_t *phase)
AXI DAC Get DDS phase for specific channel.
Definition: axi_dac_core.c:476
axi_dmac
Definition: axi_dmac.h:114
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:263
axi_dac_dds_get_frequency
int32_t axi_dac_dds_get_frequency(struct axi_dac *dac, uint32_t chan, uint32_t *freq)
AXI DAC Get DDS frequency for specific channel.
Definition: axi_dac_core.c:426
ch_type
ch_type
Definition: iio_axi_dac.c:528