37#ifdef LIBOPENCM3_DAC_H
39#ifndef LIBOPENCM3_DAC_COMMON_ALL_H
40#define LIBOPENCM3_DAC_COMMON_ALL_H
46#define DAC_CR(dac) MMIO32((dac) + 0x00)
49#define DAC_SWTRIGR(dac) MMIO32((dac) + 0x04)
52#define DAC_DHR12R1(dac) MMIO32((dac) + 0x08)
55#define DAC_DHR12L1(dac) MMIO32((dac) + 0x0C)
58#define DAC_DHR8R1(dac) MMIO32((dac) + 0x10)
61#define DAC_DHR12R2(dac) MMIO32((dac) + 0x14)
64#define DAC_DHR12L2(dac) MMIO32((dac) + 0x18)
67#define DAC_DHR8R2(dac) MMIO32((dac) + 0x1C)
70#define DAC_DHR12RD(dac) MMIO32((dac) + 0x20)
73#define DAC_DHR12LD(dac) MMIO32((dac) + 0x24)
76#define DAC_DHR8RD(dac) MMIO32((dac) + 0x28)
79#define DAC_DOR1(dac) MMIO32((dac) + 0x2C)
82#define DAC_DOR2(dac) MMIO32((dac) + 0x30)
87#define DAC_SR(dac) MMIO32((dac) + 0x34)
98#define DAC_CR_DMAUDRIE2 (1 << 29)
101#define DAC_CR_DMAEN2 (1 << 28)
104#define DAC_CR_MAMP2_SHIFT 24
107#define DAC_CR_WAVEx_MASK 0x3
110#define DAC_CR_WAVE2_SHIFT 22
113#define DAC_CR_EN2 (1 << 16)
118#define DAC_CR_DMAUDRIE1 (1 << 13)
121#define DAC_CR_DMAEN1 (1 << 12)
124#define DAC_CR_MAMP1_SHIFT 8
126#define DAC_CR_MAMPx_MASK 0xf
129#define DAC_CR_WAVE1_SHIFT 6
132#define DAC_CR_EN1 (1 << 0)
139#define DAC_SWTRIGR_SWTRIG2 (1 << 1)
142#define DAC_SWTRIGR_SWTRIG1 (1 << 0)
150#define DAC_DHR12R1_DACC1DHR_SHIFT 0
151#define DAC_DHR12R1_DACC1DHR_MASK 0xFFF
155#define DAC_DHR12L1_DACC1DHR_SHIFT 4
156#define DAC_DHR12L1_DACC1DHR_MASK 0xFFF
160#define DAC_DHR8R1_DACC1DHR_SHIFT 0
161#define DAC_DHR8R1_DACC1DHR_MASK 0xFF
165#define DAC_DHR12R2_DACC2DHR_SHIFT 0
166#define DAC_DHR12R2_DACC2DHR_MASK 0xFFF
170#define DAC_DHR12L2_DACC2DHR_SHIFT 4
171#define DAC_DHR12L2_DACC2DHR_MASK 0xFFF
175#define DAC_DHR8R2_DACC2DHR_SHIFT 0
176#define DAC_DHR8R2_DACC2DHR_MASK 0xFF
180#define DAC_DHR12RD_DACC2DHR_SHIFT 16
181#define DAC_DHR12RD_DACC2DHR_MASK 0xFFF
182#define DAC_DHR12RD_DACC1DHR_SHIFT 0
183#define DAC_DHR12RD_DACC1DHR_MSK 0xFFF
187#define DAC_DHR12LD_DACC2DHR_SHIFT 16
188#define DAC_DHR12LD_DACC2DHR_MSK 0xFFF
189#define DAC_DHR12LD_DACC1DHR_SHIFT 0
190#define DAC_DHR12LD_DACC1DHR_MSK 0xFFF
194#define DAC_DHR8RD_DACC2DHR_SHIFT 8
195#define DAC_DHR8RD_DACC2DHR_MSK 0xFF
196#define DAC_DHR8RD_DACC1DHR_SHIFT 0
197#define DAC_DHR8RD_DACC1DHR_MSK 0xFF
205#define DAC_DOR1_DACC1DOR_SHIFT 0
206#define DAC_DOR1_DACC1DOR_MSK 0xFFF
210#define DAC_DOR2_DACC2DOR_SHIFT 0
211#define DAC_DOR2_DACC2DOR_MSK 0xFFF
219#define DAC_SR_DMAUDR1 (1 << 13)
222#define DAC_SR_DMAUDR2 (1 << 29)
231#define DAC_CHANNEL1 (1 << 0)
232#define DAC_CHANNEL2 (1 << 1)
233#define DAC_CHANNEL_BOTH (DAC_CHANNEL1 | DAC_CHANNEL2)
278#warning "dac_common_all.h should not be included explicitly, only via dac.h"
void dac_disable_waveform_generation(uint32_t dac, int channel)
Disable DAC Channel Waveform Generation.
void dac_set_waveform_characteristics(uint32_t dac, int channel, int mamp)
Set DAC Channel LFSR Mask or Triangle Wave Amplitude.
void dac_set_trigger_source(uint32_t dac, uint32_t source)
Set DAC Channel Trigger Source.
void dac_set_waveform_generation(uint32_t dac, int channel, enum dac_wave wave)
Set DAC Channel Waveform Generation mode for one or both channels.
void dac_trigger_enable(uint32_t dac, int channel)
DAC Channel Trigger Enable.
void dac_load_data_buffer_single(uint32_t dac, uint16_t data, enum dac_align align, int channel)
Load DAC Data Register.
void dac_software_trigger(uint32_t dac, int channel)
Trigger the DAC by a Software Trigger.
void dac_buffer_disable(uint32_t dac, int channel)
DAC Channel Output Buffer Disable.
void dac_buffer_enable(uint32_t dac, int channel)
DAC Channel Output Buffer Enable.
void dac_disable(uint32_t dac, int channel)
DAC Channel Disable.
void dac_dma_enable(uint32_t dac, int channel)
DAC Channel DMA Enable.
void dac_load_data_buffer_dual(uint32_t dac, uint16_t data1, uint16_t data2, enum dac_align align)
Load DAC Dual Data Register.
dac_align
DAC data size (8/12 bits), alignment (right/left)
void dac_enable(uint32_t dac, int channel)
DAC Channel Enable.
void dac_trigger_disable(uint32_t dac, int channel)
DAC Channel Trigger Disable.
void dac_dma_disable(uint32_t dac, int channel)
DAC Channel DMA Disable.
dac_wave
DAC waveform generation options.