Go to the documentation of this file.
33 #ifndef AXI_DAC_CORE_H_
34 #define AXI_DAC_CORE_H_
108 extern const uint16_t
sine_lut[128];
131 uint32_t chan, uint32_t freq_hz);
134 uint32_t chan, uint32_t *freq);
137 uint32_t chan, uint32_t phase);
140 uint32_t chan, uint32_t *phase);
144 int32_t scale_micro_units);
148 int32_t *scale_micro_units);
179 const uint32_t *custom_data_iq,
180 uint32_t custom_tx_count,
int32_t axi_dac_set_data_stream(struct axi_dac *dac, bool enable)
AXI DAC Set data stream mode.
Definition: axi_dac_core.c:535
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
int32_t axi_dac_data_setup(struct axi_dac *dac)
AXI DAC Data Setup.
Definition: axi_dac_core.c:1193
@ AXI_DAC_DATA_SEL_ZERO
Definition: axi_dac_core.h:87
const char * name
Definition: axi_dac_core.h:55
int32_t axi_dac_set_ddr(struct axi_dac *dac, bool enable)
AXI DAC Set DDR (bus double-data-rate) mode.
Definition: axi_dac_core.c:520
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
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
#define AXI_DAC_SDR_DDR_N
Definition: axi_dac_core.c:58
int32_t axi_dac_read(struct axi_dac *dac, uint32_t reg_addr, uint32_t *reg_data)
AXI DAC Data Read.
Definition: axi_dac_core.c:363
#define AXI_DAC_IQCOR_COEFF_1(x)
Definition: axi_dac_core.c:119
int32_t axi_dac_init_begin(struct axi_dac **dac_core, const struct axi_dac_init *init)
Begin AXI DAC Initialization.
Definition: axi_dac_core.c:1098
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
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
uint64_t clock_hz
Definition: axi_dac_core.h:61
uint32_t axi_dac_set_sine_lut(struct axi_dac *dac, uint32_t address)
AXI DAC Set data based on a Sine Lookup Table.
Definition: axi_dac_core.c:971
uint32_t base
Definition: axi_dac_core.h:72
uint32_t pat_data
Definition: axi_dac_core.h:104
#define AXI_DAC_REG_CLK_RATIO
Definition: axi_dac_core.c:69
int32_t axi_dac_read_poll_timeout(struct axi_dac *dac, uint32_t reg_addr, uint32_t mask, uint32_t value, uint32_t sleep_us, uint32_t timeout_us)
AXI DAC Read Data until condition is met.
Definition: axi_dac_core.c:417
@ AXI_DAC_BUS_TYPE_QSPI
Definition: axi_dac_core.h:46
#define AXI_DAC_UI_STATUS
Definition: axi_dac_core.c:92
int32_t axi_dac_init_finish(struct axi_dac *dac)
Begin AXI DAC Initialization.
Definition: axi_dac_core.c:1123
@ AXI_DAC_DATA_SEL_DDS
Definition: axi_dac_core.h:84
const uint16_t sine_lut[128]
Definition: axi_dac_core.c:126
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_DAC_BUS_TYPE_NONE
Definition: axi_dac_core.h:45
Header file of Delay functions.
#define DAC_REG_DATA_PATTERN(c)
Definition: axi_dac_core.c:105
uint32_t dds_frequency_1
Definition: axi_dac_core.h:100
uint32_t dds_phase_1
Definition: axi_dac_core.h:101
int32_t axi_dac_set_buff(struct axi_dac *dac, uint32_t address, uint16_t *buff, uint32_t buff_size)
AXI DAC Set data buffer.
Definition: axi_dac_core.c:1036
void axi_dac_dds_from_signed_mag_fmt(uint32_t val, int32_t *r_val, int32_t *r_val2)
AXI DAC Convert from signed magnitude format.
Definition: axi_dac_core.c:808
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
int32_t axi_dac_bus_read(struct axi_dac *dac, uint32_t reg_addr, uint32_t *reg_data, uint8_t data_size)
AXI DAC Bus Data Read.
Definition: axi_dac_core.c:488
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
#define AXI_DAC_SYNC
Definition: axi_dac_core.c:55
int32_t axi_dac_set_data_stream(struct axi_dac *dac, bool enable)
AXI DAC Set data stream mode.
Definition: axi_dac_core.c:535
#define AXI_DAC_IQCOR_COEFF_2(x)
Definition: axi_dac_core.c:121
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
#define AXI_DAC_CNTRL_DATA_WR
Definition: axi_dac_core.c:81
struct axi_dac_channel * channels
Definition: axi_dac_core.h:76
#define AXI_DAC_RD_ADDR(x)
Definition: axi_dac_core.c:124
#define AXI_DAC_TO_DDS_INIT(x)
Definition: axi_dac_core.c:101
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
#define AXI_DAC_REG_SYNC_CONTROL
Definition: axi_dac_core.c:54
Driver for the Analog Devices AXI-DAC-CORE module.
@ AXI_DAC_DATA_SEL_PN15
Definition: axi_dac_core.h:89
#define AXI_DAC_REG_STATUS
Definition: axi_dac_core.c:73
uint32_t axi_dac_set_sine_lut(struct axi_dac *dac, uint32_t address)
AXI DAC Set data based on a Sine Lookup Table.
Definition: axi_dac_core.c:971
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
#define AXI_DAC_REG_RSTN
Definition: axi_dac_core.c:50
#define AXI_DAC_REG_DATA_SELECT(c)
Definition: axi_dac_core.c:107
#define AXI_DAC_DDS_INCR(x)
Definition: axi_dac_core.c:102
#define AXI_DAC_REG_CLK_FREQ
Definition: axi_dac_core.c:65
#define AXI_DAC_RATE(x)
Definition: axi_dac_core.c:62
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
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
int32_t axi_dac_write(struct axi_dac *dac, uint32_t reg_addr, uint32_t reg_data)
AXI DAC Data Write.
Definition: axi_dac_core.c:379
Definition: axi_dac_core.h:96
#define AXI_DAC_DATA_WR_8(x)
Definition: axi_dac_core.c:83
int32_t axi_dac_set_ddr(struct axi_dac *dac, bool enable)
AXI DAC Set DDR (bus double-data-rate) mode.
Definition: axi_dac_core.c:520
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
const char * name
Definition: axi_dac_core.h:70
uint32_t base
Definition: axi_dac_core.h:57
#define AXI_DAC_DATA_WR_16(x)
Definition: axi_dac_core.c:82
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
void axi_dac_update_bits(struct axi_dac *dac, uint32_t reg_addr, uint32_t reg_mask, uint32_t reg_data)
AXI DAC Update Data bits.
Definition: axi_dac_core.c:395
#define AXI_DAC_DDS_SCALE(x)
Definition: axi_dac_core.c:96
const uint32_t sine_lut_iq[1024]
Definition: axi_dac_core.c:145
uint32_t dds_frequency_0
Definition: axi_dac_core.h:97
#define AXI_DAC_REG_RATECNTRL
Definition: axi_dac_core.c:61
#define AXI_DAC_TO_IQCOR_COEFF_1(x)
Definition: axi_dac_core.c:120
Definition: axi_dac_core.h:68
int32_t dds_scale_0
Definition: axi_dac_core.h:99
uint8_t rate
Definition: axi_dac_core.h:78
#define AXI_DAC_TRANSFER_DATA
Definition: axi_dac_core.c:88
uint8_t num_channels
Definition: axi_dac_core.h:74
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: altera_axi_io.c:53
AXI DAC Device Descriptor.
Definition: axi_dac_core.h:53
@ AXI_DAC_DATA_SEL_PN23
Definition: axi_dac_core.h:90
uint8_t num_channels
Definition: axi_dac_core.h:59
const uint16_t sine_lut[128]
Definition: adc_demo.c:47
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
struct axi_dac_channel * channels
Definition: axi_dac_core.h:63
int32_t axi_dac_remove(struct axi_dac *dac)
AXI DAC Resources deallocation.
Definition: axi_dac_core.c:1238
int32_t axi_dac_bus_write(struct axi_dac *dac, uint32_t reg_addr, uint32_t reg_data, uint8_t data_size)
AXI DAC Bus Data Write.
Definition: axi_dac_core.c:444
#define AXI_DAC_REG_DDS_SCALE(x)
Definition: axi_dac_core.c:95
int32_t axi_dac_bus_read(struct axi_dac *dac, uint32_t reg_addr, uint32_t *reg_data, uint8_t data_size)
AXI DAC Bus Data Read.
Definition: axi_dac_core.c:488
#define AXI_DAC_REG_CNTRL_2
Definition: axi_dac_core.c:57
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
int32_t axi_dac_load_custom_data(struct axi_dac *dac, const uint32_t *custom_data_iq, uint32_t custom_tx_count, uint32_t address)
AXI DAC Load custom data.
Definition: axi_dac_core.c:1063
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
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
int32_t axi_dac_init(struct axi_dac **dac_core, const struct axi_dac_init *init)
AXI DAC Main Initialization.
Definition: axi_dac_core.c:1154
#define AXI_DAC_REG_CHAN_CNTRL_8(c)
Definition: axi_dac_core.c:118
#define AXI_DAC_SYMB_8B
Definition: axi_dac_core.c:59
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
uint32_t dds_phase_0
Definition: axi_dac_core.h:98
int32_t axi_dac_data_transfer_addr(struct axi_dac *dac, uint32_t address)
AXI DAC Set starting dma data trasfer address.
Definition: axi_dac_core.c:550
const uint32_t sine_lut_iq[1024]
Definition: axi_dac_core.c:145
#define AXI_DAC_ADDRESS(x)
Definition: axi_dac_core.c:86
#define AXI_DAC_BUSY
Definition: axi_dac_core.c:93
@ AXI_DAC_DATA_SEL_SED
Definition: axi_dac_core.h:85
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define AXI_DAC_REG_DDS_INIT_INCR(x)
Definition: axi_dac_core.c:99
int32_t axi_dac_data_format_set(struct axi_dac *dac, int format)
AXI DAC data format.
Definition: axi_dac_core.c:570
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
int32_t axi_dac_data_setup(struct axi_dac *dac)
AXI DAC Data Setup.
Definition: axi_dac_core.c:1193
uint32_t bus_type
Definition: axi_dac_core.h:65
#define AXI_DAC_REG_CHAN_CNTRL_6(c)
Definition: axi_dac_core.c:111
#define AXI_DAC_CNTRL_DATA_RD
Definition: axi_dac_core.c:79
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: altera_axi_io.c:67
int32_t axi_dac_init_begin(struct axi_dac **dac_core, const struct axi_dac_init *init)
Begin AXI DAC Initialization.
Definition: axi_dac_core.c:1098
uint32_t bus_type
Definition: axi_dac_core.h:80
int32_t axi_dac_remove(struct axi_dac *dac)
AXI DAC Resources deallocation.
Definition: axi_dac_core.c:1238
uint32_t axi_dac_dds_to_signed_mag_fmt(int32_t val, int32_t val2)
AXI DAC Convert to signed magnitude format.
Definition: axi_dac_core.c:772
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
#define AXI_DAC_IQCOR_ENB
Definition: axi_dac_core.c:112
enum axi_dac_data_sel sel
Definition: axi_dac_core.h:105
#define AXI_DAC_MMCM_RSTN
Definition: axi_dac_core.c:51
int32_t axi_dac_bus_write(struct axi_dac *dac, uint32_t reg_addr, uint32_t reg_data, uint8_t data_size)
AXI DAC Bus Data Write.
Definition: axi_dac_core.c:444
@ AXI_DAC_DATA_SEL_PN31
Definition: axi_dac_core.h:91
uint32_t dds_dual_tone
Definition: axi_dac_core.h:103
int32_t axi_dac_load_custom_data(struct axi_dac *dac, const uint32_t *custom_data_iq, uint32_t custom_tx_count, uint32_t address)
AXI DAC Load custom data.
Definition: axi_dac_core.c:1063
#define AXI_DAC_TO_IQCOR_COEFF_2(x)
Definition: axi_dac_core.c:122
@ AXI_DAC_DATA_SEL_DMA
Definition: axi_dac_core.h:86
#define AXI_DAC_REG_CHAN_CNTRL_7(c)
Definition: axi_dac_core.c:114
#define AXI_DAC_DDS_INIT(x)
Definition: axi_dac_core.c:100
Header file of utility functions.
int32_t dds_scale_1
Definition: axi_dac_core.h:102
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
int32_t axi_dac_init_finish(struct axi_dac *dac)
Begin AXI DAC Initialization.
Definition: axi_dac_core.c:1123
#define AXI_DAC_TO_DDS_SCALE(x)
Definition: axi_dac_core.c:97
#define AXI_DAC_STREAM_ENABLE
Definition: axi_dac_core.c:89
int32_t axi_dac_init(struct axi_dac **dac_core, const struct axi_dac_init *init)
AXI DAC Main Initialization.
Definition: axi_dac_core.c:1154
axi_dac_data_sel
Definition: axi_dac_core.h:83
@ AXI_DAC_DATA_SEL_LB
Definition: axi_dac_core.h:92
@ AXI_DAC_DATA_SEL_PN7
Definition: axi_dac_core.h:88
int32_t axi_dac_data_transfer_addr(struct axi_dac *dac, uint32_t address)
AXI DAC Set starting dma data trasfer address.
Definition: axi_dac_core.c:550
#define AXI_DAC_RSTN
Definition: axi_dac_core.c:52
@ AXI_DAC_DATA_SEL_PNXX
Definition: axi_dac_core.h:93
int32_t axi_dac_dds_get_calib_phase_scale(struct axi_dac *dac, uint32_t phase, uint32_t chan, int32_t *val, int32_t *val2)
Get the phase scale calibration values for AXI DAC channel.
Definition: axi_dac_core.c:880
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
int32_t axi_dac_data_format_set(struct axi_dac *dac, int format)
AXI DAC data format.
Definition: axi_dac_core.c:570
int32_t axi_dac_dds_set_calib_phase_scale(struct axi_dac *dac, uint32_t phase, uint32_t chan, int32_t val, int32_t val2)
Calibrate phase scale for specific AXI DAC channel.
Definition: axi_dac_core.c:845
int32_t axi_dac_set_buff(struct axi_dac *dac, uint32_t address, uint16_t *buff, uint32_t buff_size)
AXI DAC Set data buffer.
Definition: axi_dac_core.c:1036
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
#define AXI_DAC_REG_CUSTOM_CTRL
Definition: axi_dac_core.c:85