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:698
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:665
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:122
iio_channel
Struct describing the scan type.
Definition: iio_types.h:174
scan_type::sign
char sign
Definition: iio_types.h:159
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:714
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:260
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:470
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:109
AXI_DAC_DATA_SEL_DDS
@ AXI_DAC_DATA_SEL_DDS
Definition: axi_dac_core.h:81
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:452
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:403
iio_device::write_dev
int32_t(* write_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition: iio_types.h:276
IIO_ALTVOLTAGE
@ IIO_ALTVOLTAGE
Definition: iio_types.h:73
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:178
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:503
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:652
CH_VOLTGE
@ CH_VOLTGE
Definition: iio_axi_dac.c:530
iio_axi_dac_init_param
Definition: iio_axi_dac.h:77
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
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:108
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:746
iio_channel::channel
int channel
Definition: iio_types.h:180
iio_device::pre_enable
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition: iio_types.h:280
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:137
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:379
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:176
CH_ALTVOLTGE
@ CH_ALTVOLTGE
Definition: iio_axi_dac.c:531
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:135
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:652
axi_dma_transfer::dest_addr
uint32_t dest_addr
Definition: axi_dmac.h:113
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:705
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:705
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:258
iio_channel::scan_type
struct scan_type * scan_type
Definition: iio_types.h:190
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
CYCLIC
@ CYCLIC
Definition: axi_dmac.h:105
NULL
#define NULL
Definition: wrapper.h:64
iio_channel::scan_index
int scan_index
Definition: iio_types.h:188
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:111
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:253
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:665
iio_axi_dac.h
Header file of iio_axi_dac.
STORAGE_BITS
#define STORAGE_BITS
Definition: iio_axi_dac.c:58
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:534
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:499
scan_type
Definition: iio_types.h:157
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:391
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:83
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:730
axi_dma_transfer::size
uint32_t size
Definition: axi_dmac.h:109
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:477
axi_dmac
Definition: axi_dmac.h:116
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:262
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:427
ch_type
ch_type
Definition: iio_axi_dac.c:529