LL DAC Functions

Configuration of DAC instance

group DAC_LL_EF_Channel_Configuration

Functions

void LL_DAC_SetHighFrequencyMode ( DAC_TypeDef * dacx , uint32_t high_freq_mode )

Set the high frequency interface mode for the selected DAC instance.

Reference Manual to LL API cross reference (Register Field Functions)

MCR HFSEL LL_DAC_SetHighFrequencyMode

Parameters :
uint32_t LL_DAC_GetHighFrequencyMode ( const DAC_TypeDef * dacx )

Get the high frequency interface mode for the selected DAC instance.

Reference Manual to LL API cross reference (Register Field Functions)

MCR HFSEL LL_DAC_GetHighFrequencyMode

Parameters :

dacx – DAC instance

Return values :

Returned – value can be one of the following values:

Configuration of DAC channels

group DAC_LL_EF_Configuration

Functions

void LL_DAC_SetMode ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t channel_mode )

Set the operating mode for the selected DAC channel: calibration or normal operating mode.

Reference Manual to LL API cross reference (Register Field Functions)

CR CEN1 LL_DAC_SetMode

CR CEN2 LL_DAC_SetMode

Parameters :
uint32_t LL_DAC_GetMode ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the operating mode for the selected DAC channel: calibration or normal operating mode.

Reference Manual to LL API cross reference (Register Field Functions)

CR CEN1 LL_DAC_GetMode

CR CEN2 LL_DAC_GetMode

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetTrimmingValue ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t trimming_value )

Set the offset trimming value for the selected DAC channel. Trimming has an impact when output buffer is enabled and is intended to replace factory calibration default values.

Reference Manual to LL API cross reference (Register Field Functions)

CCR OTRIM1 LL_DAC_SetTrimmingValue

CCR OTRIM2 LL_DAC_SetTrimmingValue

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • trimming_value – Value between Min_Data=0x00 and Max_Data=0x1F

uint32_t LL_DAC_GetTrimmingValue ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the offset trimming value for the selected DAC channel. Trimming has an impact when output buffer is enabled and is intended to replace factory calibration default values.

Reference Manual to LL API cross reference (Register Field Functions)

CCR OTRIM1 LL_DAC_GetTrimmingValue

CCR OTRIM2 LL_DAC_GetTrimmingValue

Parameters :
Return values :

Trimming – value between Min_Data=0x00 and Max_Data=0x1F.

void LL_DAC_SetTriggerSource ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t trigger_source )

Set the conversion trigger source for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR TSEL1 LL_DAC_SetTriggerSource

CR TSEL2 LL_DAC_SetTriggerSource

Note

For conversion trigger source to be effective, DAC trigger must be enabled using function LL_DAC_EnableTrigger() .

Note

To set conversion trigger source, DAC channel must be disabled. Otherwise, the setting is discarded.

Note

Availability of parameters of trigger sources from timer depends on timers availability on the selected device.

Parameters :
uint32_t LL_DAC_GetTriggerSource ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the conversion trigger source for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR TSEL1 LL_DAC_GetTriggerSource

CR TSEL2 LL_DAC_GetTriggerSource

Note

For conversion trigger source to be effective, DAC trigger must be enabled using function LL_DAC_EnableTrigger() .

Note

Availability of parameters of trigger sources from timer depends on timers availability on the selected device.

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetWaveAutoGeneration ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t wave_auto_generation )

Set the waveform automatic generation mode for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR WAVE1 LL_DAC_SetWaveAutoGeneration

CR WAVE2 LL_DAC_SetWaveAutoGeneration

Parameters :
uint32_t LL_DAC_GetWaveAutoGeneration ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the waveform automatic generation mode for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR WAVE1 LL_DAC_GetWaveAutoGeneration

CR WAVE2 LL_DAC_GetWaveAutoGeneration

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetWaveNoiseLFSR ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t noise_lfsr_mask )

Set the noise waveform generation for the selected DAC channel: Noise mode and parameters LFSR (linear feedback shift register).

Reference Manual to LL API cross reference (Register Field Functions)

CR MAMP1 LL_DAC_SetWaveNoiseLFSR

CR MAMP2 LL_DAC_SetWaveNoiseLFSR

Note

For wave generation to be effective, DAC channel wave generation mode must be enabled using function LL_DAC_SetWaveAutoGeneration() .

Note

This setting can be set when the selected DAC channel is disabled (otherwise, the setting operation is ignored).

Parameters :
uint32_t LL_DAC_GetWaveNoiseLFSR ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the noise waveform generation for the selected DAC channel: Noise mode and parameters LFSR (linear feedback shift register).

Reference Manual to LL API cross reference (Register Field Functions)

CR MAMP1 LL_DAC_GetWaveNoiseLFSR

CR MAMP2 LL_DAC_GetWaveNoiseLFSR

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetWaveTriangleAmplitude ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t triangle_amplitude )

Set the triangle waveform generation for the selected DAC channel: triangle mode and amplitude.

Reference Manual to LL API cross reference (Register Field Functions)

CR MAMP1 LL_DAC_SetWaveTriangleAmplitude

CR MAMP2 LL_DAC_SetWaveTriangleAmplitude

Note

For wave generation to be effective, DAC channel wave generation mode must be enabled using function LL_DAC_SetWaveAutoGeneration() .

Note

This setting can be set when the selected DAC channel is disabled (otherwise, the setting operation is ignored).

Parameters :
uint32_t LL_DAC_GetWaveTriangleAmplitude ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the triangle waveform generation for the selected DAC channel: triangle mode and amplitude.

Reference Manual to LL API cross reference (Register Field Functions)

CR MAMP1 LL_DAC_GetWaveTriangleAmplitude

CR MAMP2 LL_DAC_GetWaveTriangleAmplitude

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_ConfigOutput ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t output_mode , uint32_t output_buffer , uint32_t output_connection )

Set the output for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_ConfigOutput

CR MODE2 LL_DAC_ConfigOutput

Note

This function set several features:

Note

On this STM32 series, output connection depends on output mode (normal or sample and hold) and output buffer state.

  • if output connection is set to internal path and output buffer is enabled (whatever output mode): output connection is also connected to GPIO pin (both connections to GPIO pin and internal path).

  • if output connection is set to GPIO pin, output buffer is disabled, output mode set to sample and hold: output connection is also connected to internal path (both connections to GPIO pin and internal path).

Note

Mode sample-and-hold requires an external capacitor to be connected between DAC channel output and ground. Capacitor value depends on load on DAC channel output and sample-and-hold timings configured. As indication, capacitor typical value is 100nF (refer to device datasheet, parameter “CSH”).

Parameters :
void LL_DAC_SetOutputMode ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t output_mode )

Set the output mode normal or sample-and-hold for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_SetOutputMode

CR MODE2 LL_DAC_SetOutputMode

Note

Mode sample-and-hold requires an external capacitor to be connected between DAC channel output and ground. Capacitor value depends on load on DAC channel output and sample-and-hold timings configured. As indication, capacitor typical value is 100nF (refer to device datasheet, parameter “CSH”).

Parameters :
uint32_t LL_DAC_GetOutputMode ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the output mode normal or sample-and-hold for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_GetOutputMode

CR MODE2 LL_DAC_GetOutputMode

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetOutputBuffer ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t output_buffer )

Set the output buffer for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_SetOutputBuffer

CR MODE2 LL_DAC_SetOutputBuffer

Note

On this STM32 series, when buffer is enabled, its offset can be trimmed: factory calibration default values can be replaced by user trimming values, using function LL_DAC_SetTrimmingValue() .

Parameters :
uint32_t LL_DAC_GetOutputBuffer ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the output buffer state for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_GetOutputBuffer

CR MODE2 LL_DAC_GetOutputBuffer

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetOutputConnection ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t output_connection )

Set the output connection for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_SetOutputConnection

CR MODE2 LL_DAC_SetOutputConnection

Note

On this STM32 series, output connection depends on output mode (normal or sample and hold) and output buffer state.

  • if output connection is set to internal path and output buffer is enabled (whatever output mode): output connection is also connected to GPIO pin (both connections to GPIO pin and internal path).

  • if output connection is set to GPIO pin, output buffer is disabled, output mode set to sample and hold: output connection is also connected to internal path (both connections to GPIO pin and internal path).

Parameters :
uint32_t LL_DAC_GetOutputConnection ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the output connection for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR MODE1 LL_DAC_GetOutputConnection

CR MODE2 LL_DAC_GetOutputConnection

Note

On this STM32 series, output connection depends on output mode (normal or sample and hold) and output buffer state.

  • if output connection is set to internal path and output buffer is enabled (whatever output mode): output connection is also connected to GPIO pin (both connections to GPIO pin and internal path).

  • if output connection is set to GPIO pin, output buffer is disabled, output mode set to sample and hold: output connection is also connected to internal path (both connections to GPIO pin and internal path).

Parameters :
Return values :

Returned – value can be one of the following values:

void LL_DAC_SetSampleAndHoldSampleTime ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t sample_time )

Set the sample-and-hold timing for the selected DAC channel: sample time.

Reference Manual to LL API cross reference (Register Field Functions)

SHSR1 TSAMPLE1 LL_DAC_SetSampleAndHoldSampleTime

SHSR2 TSAMPLE2 LL_DAC_SetSampleAndHoldSampleTime

Note

Sample time must be set when DAC channel is disabled or during DAC operation when DAC channel flag BWSTx is reset, otherwise the setting is ignored. Check BWSTx flag state using function “LL_DAC_IsActiveFlag_BWSTx()”.

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • sample_time – Value between Min_Data=0x000 and Max_Data=0x3FF

uint32_t LL_DAC_GetSampleAndHoldSampleTime ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the sample-and-hold timing for the selected DAC channel: sample time.

Reference Manual to LL API cross reference (Register Field Functions)

SHSR1 TSAMPLE1 LL_DAC_GetSampleAndHoldSampleTime

SHSR2 TSAMPLE2 LL_DAC_GetSampleAndHoldSampleTime

Parameters :
Return values :

Value – between Min_Data=0x000 and Max_Data=0x3FF

void LL_DAC_SetSampleAndHoldHoldTime ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t hold_time )

Set the sample-and-hold timing for the selected DAC channel: hold time.

Reference Manual to LL API cross reference (Register Field Functions)

SHHR THOLD1 LL_DAC_SetSampleAndHoldHoldTime

SHHR THOLD2 LL_DAC_SetSampleAndHoldHoldTime

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • hold_time – Value between Min_Data=0x000 and Max_Data=0x3FF

uint32_t LL_DAC_GetSampleAndHoldHoldTime ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the sample-and-hold timing for the selected DAC channel: hold time.

Reference Manual to LL API cross reference (Register Field Functions)

SHHR THOLD1 LL_DAC_GetSampleAndHoldHoldTime

SHHR THOLD2 LL_DAC_GetSampleAndHoldHoldTime

Parameters :
Return values :

Value – between Min_Data=0x000 and Max_Data=0x3FF

void LL_DAC_SetSampleAndHoldRefreshTime ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t refresh_time )

Set the sample-and-hold timing for the selected DAC channel: refresh time.

Reference Manual to LL API cross reference (Register Field Functions)

SHRR TREFRESH1 LL_DAC_SetSampleAndHoldRefreshTime

SHRR TREFRESH2 LL_DAC_SetSampleAndHoldRefreshTime

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • refresh_time – Value between Min_Data=0x00 and Max_Data=0xFF

uint32_t LL_DAC_GetSampleAndHoldRefreshTime ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the sample-and-hold timing for the selected DAC channel: refresh time.

Reference Manual to LL API cross reference (Register Field Functions)

SHRR TREFRESH1 LL_DAC_GetSampleAndHoldRefreshTime

SHRR TREFRESH2 LL_DAC_GetSampleAndHoldRefreshTime

Parameters :
Return values :

Value – between Min_Data=0x00 and Max_Data=0xFF

void LL_DAC_SetSignedFormat ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t signed_format )

Set the signed format for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

MCR SINFORMAT1 LL_DAC_SetSignedFormat

MCR SINFORMAT2 LL_DAC_SetSignedFormat

Note

On this STM32 series, signed format can be used to inject Q1.15, Q1.11, Q1.7 signed format data to DAC. Ex when using 12bits data format (Q1.11 is used): 0x800 outputs 0v level 0xFFF outputs mid-scale level 0x000 outputs mid-scale level 0x7FF outputs full-scale level

Note

With signed format an offset of half the amplitude (0x800) is added because DAC output can provide only positive value.

Parameters :
uint32_t LL_DAC_GetSignedFormat ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get the signed format state for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

MCR SINFORMAT1 LL_DAC_GetSignedFormat

MCR SINFORMAT2 LL_DAC_GetSignedFormat

Parameters :
Return values :

Returned – value can be one of the following values:

DMA Management

group DAC_LL_EF_DMA_Management

Functions

void LL_DAC_EnableDMAReq ( DAC_TypeDef * dacx , uint32_t dac_channel )

Enable DAC DMA transfer request of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAEN1 LL_DAC_EnableDMAReq

CR DMAEN2 LL_DAC_EnableDMAReq

Note

To configure DMA source address (peripheral address), use function LL_DAC_DMA_GetRegAddr() .

Parameters :
void LL_DAC_DisableDMAReq ( DAC_TypeDef * dacx , uint32_t dac_channel )

Disable DAC DMA transfer request of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAEN1 LL_DAC_DisableDMAReq

CR DMAEN2 LL_DAC_DisableDMAReq

Note

To configure DMA source address (peripheral address), use function LL_DAC_DMA_GetRegAddr() .

Parameters :
uint32_t LL_DAC_IsDMAReqEnabled ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC DMA transfer request state of the selected channel. (0: DAC DMA transfer request is disabled, 1: DAC DMA transfer request is enabled)

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAEN1 LL_DAC_IsDMAReqEnabled

CR DMAEN2 LL_DAC_IsDMAReqEnabled

Parameters :
Return values :

State – of bit (1 or 0).

void LL_DAC_EnableDMADoubleDataMode ( DAC_TypeDef * dacx , uint32_t dac_channel )

Enable DAC DMA Double data mode of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

MCR DMADOUBLE1 LL_DAC_EnableDMADoubleDataMode

MCR DMADOUBLE2 LL_DAC_EnableDMADoubleDataMode

Parameters :
void LL_DAC_DisableDMADoubleDataMode ( DAC_TypeDef * dacx , uint32_t dac_channel )

Disable DAC DMA Double data mode of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

MCR DMADOUBLE1 LL_DAC_DisableDMADoubleDataMode

MCR DMADOUBLE2 LL_DAC_DisableDMADoubleDataMode

Parameters :
uint32_t LL_DAC_IsDMADoubleDataModeEnabled ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC DMA double data mode state of the selected channel. (0: DAC DMA double data mode is disabled, 1: DAC DMA double data mode is enabled)

Reference Manual to LL API cross reference (Register Field Functions)

MCR DMADOUBLE1 LL_DAC_IsDMADoubleDataModeEnabled

MCR DMADOUBLE2 LL_DAC_IsDMADoubleDataModeEnabled

Parameters :
Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_DMA_GetRegAddr ( const DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t reg_addr )

Function to help to configure DMA transfer to DAC: retrieve the DAC register address from DAC instance and a list of DAC registers intended to be used (most commonly) with DMA transfer.

Reference Manual to LL API cross reference (Register Field Functions)

DHR12R1 DACC1DHR LL_DAC_DMA_GetRegAddr

DHR12L1 DACC1DHR LL_DAC_DMA_GetRegAddr

DHR8R1 DACC1DHR LL_DAC_DMA_GetRegAddr

DHR12R2 DACC2DHR LL_DAC_DMA_GetRegAddr

DHR12L2 DACC2DHR LL_DAC_DMA_GetRegAddr

DHR8R2 DACC2DHR LL_DAC_DMA_GetRegAddr

Note

These DAC registers are data holding registers: when DAC conversion is requested, DAC generates a DMA transfer request to have data available in DAC data holding registers.

Note

This macro is intended to be used with LL DMA driver, refer to function “LL_DMA_ConfigAddresses()”. Example: LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_1, (uint32_t)&< array or variable >, LL_DAC_DMA_GetRegAddr(DAC1, LL_DAC_CHANNEL_1,

LL_DAC_DMA_REG_DATA_12BITS_RIGHT_ALIGNED), LL_DMA_DIRECTION_MEMORY_TO_PERIPH);

Parameters :
Return values :

DAC – register address

Operation on DAC channels

group DAC_LL_EF_Operation

Functions

void LL_DAC_Enable ( DAC_TypeDef * dacx , uint32_t dac_channel )

Enable DAC selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR EN1 LL_DAC_Enable

CR EN2 LL_DAC_Enable

Note

After enable from off state, DAC channel requires a delay for output voltage to reach accuracy +/- 1 LSB. Refer to device datasheet, parameter “tWAKEUP”.

Parameters :
void LL_DAC_Disable ( DAC_TypeDef * dacx , uint32_t dac_channel )

Disable DAC selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR EN1 LL_DAC_Disable

CR EN2 LL_DAC_Disable

Parameters :
uint32_t LL_DAC_IsEnabled ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC enable state of the selected channel. (0: DAC channel is disabled, 1: DAC channel is enabled)

Reference Manual to LL API cross reference (Register Field Functions)

CR EN1 LL_DAC_IsEnabled

CR EN2 LL_DAC_IsEnabled

Parameters :
Return values :

State – of bit (1 or 0).

void LL_DAC_DualChannelEnable ( DAC_TypeDef * dacx )

Enable DAC dual channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR EN1 LL_DAC_DualChannelEnable

CR EN2 LL_DAC_DualChannelEnable

Note

After enable from off state, DAC channel requires a delay for output voltage to reach accuracy +/- 1 LSB. Refer to device datasheet, parameter “tWAKEUP”.

Parameters :

dacx – DAC instance

void LL_DAC_DualChannelDisable ( DAC_TypeDef * dacx )

Disable DAC selected DualChan channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR EN1 LL_DAC_DualChannelDisable

CR EN2 LL_DAC_DualChannelDisable

Parameters :

dacx – DAC instance

uint32_t LL_DAC_IsReady ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC ready for conversion state of the selected channel. (0: DAC channel is not ready, 1: DAC channel is ready)

Reference Manual to LL API cross reference (Register Field Functions)

SR DAC1RDY LL_DAC_IsReady

SR DAC2RDY LL_DAC_IsReady

Parameters :
Return values :

State – of bit (1 or 0).

void LL_DAC_EnableTrigger ( DAC_TypeDef * dacx , uint32_t dac_channel )

Enable DAC trigger of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR TEN1 LL_DAC_EnableTrigger

CR TEN2 LL_DAC_EnableTrigger

Note

- If DAC trigger is disabled, DAC conversion is performed automatically once the data holding register is updated, using functions “LL_DAC_ConvertData{8; 12}{Right; Left} Aligned()”: LL_DAC_ConvertData12RightAligned() , …

  • If DAC trigger is enabled, DAC conversion is performed only when a hardware of software trigger event is occurring. Select trigger source using function LL_DAC_SetTriggerSource() .

Parameters :
void LL_DAC_DisableTrigger ( DAC_TypeDef * dacx , uint32_t dac_channel )

Disable DAC trigger of the selected channel.

Reference Manual to LL API cross reference (Register Field Functions)

CR TEN1 LL_DAC_DisableTrigger

CR TEN2 LL_DAC_DisableTrigger

Parameters :
uint32_t LL_DAC_IsTriggerEnabled ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC trigger state of the selected channel. (0: DAC trigger is disabled, 1: DAC trigger is enabled)

Reference Manual to LL API cross reference (Register Field Functions)

CR TEN1 LL_DAC_IsTriggerEnabled

CR TEN2 LL_DAC_IsTriggerEnabled

Parameters :
Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsTriggerSWEnabled ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC software trigger state of the selected channel. (0: DAC software trigger is disabled, 1: DAC software trigger is enabled)

Reference Manual to LL API cross reference (Register Field Functions)

CR TEN1 LL_DAC_IsTriggerSWEnabled

CR TEN2 LL_DAC_IsTriggerSWEnabled

Parameters :
Return values :

Software – trigger enabled (1) or disabled (0).

void LL_DAC_TrigSWConversion ( DAC_TypeDef * dacx , uint32_t dac_channel )

Trig DAC conversion by software for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

SWTRGR SWTRIG1 LL_DAC_TrigSWConversion

SWTRGR SWTRIG2 LL_DAC_TrigSWConversion

Note

Preliminarily, DAC trigger must be set to software trigger using function LL_DAC_SetTriggerSource() with parameter “LL_DAC_TRIGGER_SOFTWARE”. and DAC trigger must be enabled using function LL_DAC_EnableTrigger() .

Note

For devices featuring DAC with 2 channels: this function can perform a SW start of both DAC channels simultaneously. Two channels can be selected as parameter. Example: (LL_DAC_CHANNEL_1 | LL_DAC_CHANNEL_2)

Parameters :
void LL_DAC_ConvertData12RightAligned ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t data )

Set the data to be loaded in the data holding register in format 12 bits left alignment (LSB aligned on bit 0), for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

DHR12R1 DACC1DHR LL_DAC_ConvertData12RightAligned

DHR12R2 DACC2DHR LL_DAC_ConvertData12RightAligned

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • data – Value between Min_Data=0x000 and Max_Data=0xFFF

void LL_DAC_ConvertData12LeftAligned ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t data )

Set the data to be loaded in the data holding register in format 12 bits left alignment (MSB aligned on bit 15), for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

DHR12L1 DACC1DHR LL_DAC_ConvertData12LeftAligned

DHR12L2 DACC2DHR LL_DAC_ConvertData12LeftAligned

Parameters :
  • dacx – DAC instance

  • dac_channel – This parameter can be one of the following values:

  • data – Value between Min_Data=0x000 and Max_Data=0xFFF

void LL_DAC_ConvertData8RightAligned ( DAC_TypeDef * dacx , uint32_t dac_channel , uint32_t data )

Set the data to be loaded in the data holding register in format 8 bits left alignment (LSB aligned on bit 0), for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

DHR8R1 DACC1DHR LL_DAC_ConvertData8RightAligned

DHR8R2 DACC2DHR LL_DAC_ConvertData8RightAligned

Parameters :
void LL_DAC_ConvertDualData12RightAligned ( DAC_TypeDef * dacx , uint32_t data_channel1 , uint32_t data_channel2 )

Set the data to be loaded in the data holding register in format 12 bits left alignment (LSB aligned on bit 0), for both DAC channels.

Reference Manual to LL API cross reference (Register Field Functions)

DHR12RD DACC1DHR LL_DAC_ConvertDualData12RightAligned

DHR12RD DACC2DHR LL_DAC_ConvertDualData12RightAligned

Parameters :
  • dacx – DAC instance

  • data_channel1 – Value between Min_Data=0x000 and Max_Data=0xFFF

  • data_channel2 – Value between Min_Data=0x000 and Max_Data=0xFFF

void LL_DAC_ConvertDualData12LeftAligned ( DAC_TypeDef * dacx , uint32_t data_channel1 , uint32_t data_channel2 )

Set the data to be loaded in the data holding register in format 12 bits left alignment (MSB aligned on bit 15), for both DAC channels.

Reference Manual to LL API cross reference (Register Field Functions)

DHR12LD DACC1DHR LL_DAC_ConvertDualData12LeftAligned

DHR12LD DACC2DHR LL_DAC_ConvertDualData12LeftAligned

Parameters :
  • dacx – DAC instance

  • data_channel1 – Value between Min_Data=0x000 and Max_Data=0xFFF

  • data_channel2 – Value between Min_Data=0x000 and Max_Data=0xFFF

void LL_DAC_ConvertDualData8RightAligned ( DAC_TypeDef * dacx , uint32_t data_channel1 , uint32_t data_channel2 )

Set the data to be loaded in the data holding register in format 8 bits left alignment (LSB aligned on bit 0), for both DAC channels.

Reference Manual to LL API cross reference (Register Field Functions)

DHR8RD DACC1DHR LL_DAC_ConvertDualData8RightAligned

DHR8RD DACC2DHR LL_DAC_ConvertDualData8RightAligned

Parameters :
  • dacx – DAC instance

  • data_channel1 – Value between Min_Data=0x00 and Max_Data=0xFF

  • data_channel2 – Value between Min_Data=0x00 and Max_Data=0xFF

uint32_t LL_DAC_RetrieveOutputData ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Retrieve output data currently generated for the selected DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

DOR1 DACC1DOR LL_DAC_RetrieveOutputData

DOR2 DACC2DOR LL_DAC_RetrieveOutputData

Note

Whatever alignment and resolution settings (using functions “LL_DAC_ConvertData{8; 12}{Right; Left} Aligned()”: LL_DAC_ConvertData12RightAligned() , …), output data format is 12 bits right aligned (LSB aligned on bit 0).

Parameters :
Return values :

Value – between Min_Data=0x000 and Max_Data=0xFFF

FLAG Management

group DAC_LL_EF_FLAG_Management

Functions

uint32_t LL_DAC_IsActiveFlag_CAL1 ( const DAC_TypeDef * dacx )

Get DAC calibration offset flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR CAL_FLAG1 LL_DAC_IsActiveFlag_CAL1

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_CAL2 ( const DAC_TypeDef * dacx )

Get DAC calibration offset flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR CAL_FLAG2 LL_DAC_IsActiveFlag_CAL2

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_CAL ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC calibration offset flag for DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

SR CAL_FLAG1 LL_DAC_IsActiveFlag_CAL

Parameters :
Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_BWST1 ( const DAC_TypeDef * dacx )

Get DAC busy writing sample time flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR BWST1 LL_DAC_IsActiveFlag_BWST1

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_BWST2 ( const DAC_TypeDef * dacx )

Get DAC busy writing sample time flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR BWST2 LL_DAC_IsActiveFlag_BWST2

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_BWST ( const DAC_TypeDef * dacx , uint32_t dac_channel )

Get DAC busy writing sample time flag for DAC channel.

Reference Manual to LL API cross reference (Register Field Functions)

SR BWST1 LL_DAC_IsActiveFlag_BWST

Parameters :
Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DAC1RDY ( const DAC_TypeDef * dacx )

Get DAC ready status flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR DAC1RDY LL_DAC_IsActiveFlag_DAC1RDY

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DAC2RDY ( const DAC_TypeDef * dacx )

Get DAC ready status flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR DAC2RDY LL_DAC_IsActiveFlag_DAC2RDY

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DORSTAT1 ( const DAC_TypeDef * dacx )

Get DAC output register status flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR DORSTAT1 LL_DAC_IsActiveFlag_DORSTAT1

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DORSTAT2 ( const DAC_TypeDef * dacx )

Get DAC output register status flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR DORSTAT2 LL_DAC_IsActiveFlag_DORSTAT2

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DMAUDR ( const DAC_TypeDef * dacx , uint32_t flag )

Get DAC underrun flag for DAC channel x.

Reference Manual to LL API cross reference (Register Field Functions)

SR SR LL_DAC_IsActiveFlag_DMAUDR

Parameters :
Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DMAUDR1 ( const DAC_TypeDef * dacx )

Get DAC underrun flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR DMAUDR1 LL_DAC_IsActiveFlag_DMAUDR1

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsActiveFlag_DMAUDR2 ( const DAC_TypeDef * dacx )

Get DAC underrun flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR DMAUDR2 LL_DAC_IsActiveFlag_DMAUDR2

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

void LL_DAC_ClearFlag_DMAUDR ( DAC_TypeDef * dacx , uint32_t flag )

Clear some bits in DAC status register.

Reference Manual to LL API cross reference (Register Field Functions)

SR DMAUDRx LL_DAC_ClearFlag_DMAUDR

Note

DMAUDRx can be DMAUDR1 or DMAUDR2

Parameters :
  • dacx – DAC instance

  • flag – (bit at 1 to be reset) can be LL_DAC_FLAG_DMAUDR1 or LL_DAC_FLAG_DMAUDR2

void LL_DAC_ClearFlag_DMAUDR1 ( DAC_TypeDef * dacx )

Clear DAC underrun flag for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

SR DMAUDR1 LL_DAC_ClearFlag_DMAUDR1

Parameters :

dacx – DAC instance

void LL_DAC_ClearFlag_DMAUDR2 ( DAC_TypeDef * dacx )

Clear DAC underrun flag for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

SR DMAUDR2 LL_DAC_ClearFlag_DMAUDR2

Parameters :

dacx – DAC instance

IT management

group DAC_LL_EF_IT_Management

Functions

void LL_DAC_EnableIT_DMAUDR ( DAC_TypeDef * dacx , uint32_t mask )

Enable DMA “mask” interrupt (choice of channel is contained in mask)

Reference Manual to LL API cross reference (Register Field Functions)

CR mask LL_DAC_EnableIT_DMAUDR

Parameters :
  • dacx – DAC instance

  • mask – interrupt mask that specifies the DAC interrupt. This parameter can be any combination of the following values: LL_DAC_IT_DMAUDRIE1 : DAC channel 1 DMA underrun interrupt LL_DAC_IT_DMAUDRIE2 : DAC channel 2 DMA underrun interrupt

void LL_DAC_DisableIT_DMAUDR ( DAC_TypeDef * dacx , uint32_t mask )

Disable DMA “mask” interrupt (choice of channel is contained in mask)

Reference Manual to LL API cross reference (Register Field Functions)

CR mask LL_DAC_DisableIT_DMAUDR

Parameters :
  • dacx – DAC instance

  • mask – interrupt mask that specifies the DAC interrupt. This parameter can be any combination of the following values: LL_DAC_IT_DMAUDRIE1 : DAC channel 1 DMA underrun interrupt LL_DAC_IT_DMAUDRIE2 : DAC channel 2 DMA underrun interrupt

void LL_DAC_EnableIT_DMAUDR1 ( DAC_TypeDef * dacx )

Enable DMA underrun interrupt for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE1 LL_DAC_EnableIT_DMAUDR1

Parameters :

dacx – DAC instance

void LL_DAC_EnableIT_DMAUDR2 ( DAC_TypeDef * dacx )

Enable DMA underrun interrupt for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE2 LL_DAC_EnableIT_DMAUDR2

Parameters :

dacx – DAC instance

void LL_DAC_DisableIT_DMAUDR1 ( DAC_TypeDef * dacx )

Disable DMA underrun interrupt for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE1 LL_DAC_DisableIT_DMAUDR1

Parameters :

dacx – DAC instance

void LL_DAC_DisableIT_DMAUDR2 ( DAC_TypeDef * dacx )

Disable DMA underrun interrupt for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE2 LL_DAC_DisableIT_DMAUDR2

Parameters :

dacx – DAC instance

uint32_t LL_DAC_IsEnabledIT_DMAUDR ( const DAC_TypeDef * dacx , uint32_t mask )

Get a specific peripheral interrupt status.

Reference Manual to LL API cross reference (Register Field Functions)

CR . LL_DAC_IsEnabledIT_DMAUDR

Parameters :
  • dacx – DAC instance

  • mask – interrupt mask that specifies the DAC interrupt. This parameter can be any combination of the following values: LL_DAC_IT_DMAUDRIE1 : DAC channel 1 DMA underrun interrupt LL_DAC_IT_DMAUDRIE2 : DAC channel 2 DMA underrun interrupt

Return values :

State – of mask (1 or 0).

uint32_t LL_DAC_IsEnabledIT_DMAUDR1 ( const DAC_TypeDef * dacx )

Get DMA underrun interrupt for DAC channel 1.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE1 LL_DAC_IsEnabledIT_DMAUDR1

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

uint32_t LL_DAC_IsEnabledIT_DMAUDR2 ( const DAC_TypeDef * dacx )

Get DMA underrun interrupt for DAC channel 2.

Reference Manual to LL API cross reference (Register Field Functions)

CR DMAUDRIE2 LL_DAC_IsEnabledIT_DMAUDR2

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).

void LL_DAC_EnableAutonomousMode ( DAC_TypeDef * dacx )

Enable DAC autonomous mode.

Reference Manual to LL API cross reference (Register Field Functions)

AUTOCR AUTOMODE LL_DAC_EnableAutonomousMode

Parameters :

dacx – DAC instance

void LL_DAC_DisableAutonomousMode ( DAC_TypeDef * dacx )

Disable DAC autonomous mode.

Reference Manual to LL API cross reference (Register Field Functions)

AUTOCR AUTOMODE LL_DAC_DisableAutonomousMode

Parameters :

dacx – DAC instance

uint32_t LL_DAC_IsEnabledAutonomousMode ( const DAC_TypeDef * dacx )

Get DAC autonomous mode state. (0: DAC autonomous mode is disabled, 1: DAC autonomous mode is enabled)

Parameters :

dacx – DAC instance

Return values :

State – of bit (1 or 0).