no-OS
iio_axi_dac.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef IIO_AXI_DAC_H_
35 #define IIO_AXI_DAC_H_
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include "iio_types.h"
42 #include "axi_dac_core.h"
43 #include "axi_dmac.h"
44 
45 /******************************************************************************/
46 /*************************** Types Declarations *******************************/
47 /******************************************************************************/
48 
54  struct axi_dac *dac;
56  struct axi_dmac *dmac;
58  uint32_t mask;
60  void (*dcache_flush_range)(uint32_t address, uint32_t bytes_count);
64  char (*ch_names)[20];
65 };
66 
73  struct axi_dac *tx_dac;
75  struct axi_dmac *tx_dmac;
77  void (*dcache_flush_range)(uint32_t address, uint32_t bytes_count);
78 };
79 
80 /******************************************************************************/
81 /************************ Functions Declarations ******************************/
82 /******************************************************************************/
83 
84 /* Init application. */
85 int32_t iio_axi_dac_init(struct iio_axi_dac_desc **desc,
86  struct iio_axi_dac_init_param *param);
89  struct iio_device **dev_descriptor);
90 /* Free the resources allocated by iio_axi_dac_init(). */
91 int32_t iio_axi_dac_remove(struct iio_axi_dac_desc *desc);
92 
93 #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:909
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:659
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
scan_type::sign
char sign
Definition: iio_types.h:153
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:925
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:254
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:464
iio_axi_dac_desc::dev_descriptor
struct iio_device dev_descriptor
Definition: iio_axi_dac.h:62
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
AXI_DAC_DATA_SEL_DDS
@ AXI_DAC_DATA_SEL_DDS
Definition: axi_dac_core.h:84
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
iio_axi_dac_desc::dac
struct axi_dac * dac
Definition: iio_axi_dac.h:54
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:663
device
Definition: ad9361_util.h:69
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:614
iio_device::write_dev
int32_t(* write_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition: iio_types.h:270
IIO_ALTVOLTAGE
@ IIO_ALTVOLTAGE
Definition: iio_types.h:67
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:172
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:714
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:646
CH_VOLTGE
@ CH_VOLTGE
Definition: iio_axi_dac.c:524
iio_axi_dac_init_param
Definition: iio_axi_dac.h:71
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:54
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:60
axi_dma_transfer
Definition: axi_dmac.h:102
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:957
iio_channel::channel
int channel
Definition: iio_types.h:174
iio_device::pre_enable
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition: iio_types.h:274
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
iio_attribute::name
const char * name
Definition: iio_types.h:131
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:590
iio_axi_dac_desc::dmac
struct axi_dmac * dmac
Definition: iio_axi_dac.h:56
iio_channel::name
const char * name
Definition: iio_types.h:170
CH_ALTVOLTGE
@ CH_ALTVOLTGE
Definition: iio_axi_dac.c:525
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:129
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:646
axi_dma_transfer::dest_addr
uint32_t dest_addr
Definition: axi_dmac.h:107
iio_axi_dac_init_param::tx_dmac
struct axi_dmac * tx_dmac
Definition: iio_axi_dac.h:75
axi_dac
AXI DAC Device Descriptor.
Definition: axi_dac_core.h:53
axi_dac::num_channels
uint8_t num_channels
Definition: axi_dac_core.h:59
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:65
iio_axi_dac_desc
Definition: iio_axi_dac.h:53
iio_axi_dac_init_param::tx_dac
struct axi_dac * tx_dac
Definition: iio_axi_dac.h:73
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:252
iio_channel::scan_type
struct scan_type * scan_type
Definition: iio_types.h:184
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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:69
CYCLIC
@ CYCLIC
Definition: axi_dmac.h:99
NULL
#define NULL
Definition: wrapper.h:64
iio_channel::scan_index
int scan_index
Definition: iio_types.h:182
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:105
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
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:659
iio_axi_dac.h
Header file of iio_axi_dac.
STORAGE_BITS
#define STORAGE_BITS
Definition: iio_axi_dac.c:52
iio_axi_dac_desc::ch_names
char(* ch_names)[20]
Definition: iio_axi_dac.h:64
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:745
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:493
scan_type
Definition: iio_types.h:151
iio_axi_dac_init_param::dcache_flush_range
void(* dcache_flush_range)(uint32_t address, uint32_t bytes_count)
Definition: iio_axi_dac.h:77
axi_dmac_transfer_start
int32_t axi_dmac_transfer_start(struct axi_dmac *dmac, struct axi_dma_transfer *dma_transfer)
Definition: axi_dmac.c:385
iio_axi_dac_desc::mask
uint32_t mask
Definition: iio_axi_dac.h:58
AXI_DAC_DATA_SEL_DMA
@ AXI_DAC_DATA_SEL_DMA
Definition: axi_dac_core.h:86
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:941
axi_dma_transfer::size
uint32_t size
Definition: axi_dmac.h:103
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:688
axi_dmac
Definition: axi_dmac.h:110
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:256
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:638
ch_type
ch_type
Definition: iio_axi_dac.c:523