STM32F439xx HAL User Manual
Functions
Operation on DAC channels
DAC Exported Functions

Functions

__STATIC_INLINE void LL_DAC_Enable (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Enable DAC selected channel.
__STATIC_INLINE void LL_DAC_Disable (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Disable DAC selected channel.
__STATIC_INLINE uint32_t LL_DAC_IsEnabled (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Get DAC enable state of the selected channel.
__STATIC_INLINE void LL_DAC_EnableTrigger (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Enable DAC trigger of the selected channel.
__STATIC_INLINE void LL_DAC_DisableTrigger (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Disable DAC trigger of the selected channel.
__STATIC_INLINE uint32_t LL_DAC_IsTriggerEnabled (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Get DAC trigger state of the selected channel.
__STATIC_INLINE void LL_DAC_TrigSWConversion (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Trig DAC conversion by software for the selected DAC channel.
__STATIC_INLINE 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.
__STATIC_INLINE 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.
__STATIC_INLINE 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.
__STATIC_INLINE void LL_DAC_ConvertDualData12RightAligned (DAC_TypeDef *DACx, uint32_t DataChannel1, uint32_t DataChannel2)
 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.
__STATIC_INLINE void LL_DAC_ConvertDualData12LeftAligned (DAC_TypeDef *DACx, uint32_t DataChannel1, uint32_t DataChannel2)
 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.
__STATIC_INLINE void LL_DAC_ConvertDualData8RightAligned (DAC_TypeDef *DACx, uint32_t DataChannel1, uint32_t DataChannel2)
 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.
__STATIC_INLINE uint32_t LL_DAC_RetrieveOutputData (DAC_TypeDef *DACx, uint32_t DAC_Channel)
 Retrieve output data currently generated for the selected DAC channel.

Function Documentation

__STATIC_INLINE 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:
DHR12L1 DACC1DHR LL_DAC_ConvertData12LeftAligned
DHR12L2 DACC2DHR LL_DAC_ConvertData12LeftAligned
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
DataValue between Min_Data=0x000 and Max_Data=0xFFF
Return values:
None

Definition at line 1148 of file stm32f4xx_ll_dac.h.

References __DAC_MASK_SHIFT, __DAC_PTR_REG_OFFSET, and DAC_REG_DHR12LX_REGOFFSET_MASK.

__STATIC_INLINE 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:
DHR12R1 DACC1DHR LL_DAC_ConvertData12RightAligned
DHR12R2 DACC2DHR LL_DAC_ConvertData12RightAligned
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
DataValue between Min_Data=0x000 and Max_Data=0xFFF
Return values:
None

Definition at line 1123 of file stm32f4xx_ll_dac.h.

References __DAC_MASK_SHIFT, __DAC_PTR_REG_OFFSET, and DAC_REG_DHR12RX_REGOFFSET_MASK.

__STATIC_INLINE 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:
DHR8R1 DACC1DHR LL_DAC_ConvertData8RightAligned
DHR8R2 DACC2DHR LL_DAC_ConvertData8RightAligned
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
DataValue between Min_Data=0x00 and Max_Data=0xFF
Return values:
None

Definition at line 1173 of file stm32f4xx_ll_dac.h.

References __DAC_MASK_SHIFT, __DAC_PTR_REG_OFFSET, and DAC_REG_DHR8RX_REGOFFSET_MASK.

__STATIC_INLINE void LL_DAC_ConvertDualData12LeftAligned ( DAC_TypeDef *  DACx,
uint32_t  DataChannel1,
uint32_t  DataChannel2 
)

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:
DHR12LD DACC1DHR LL_DAC_ConvertDualData12LeftAligned
DHR12LD DACC2DHR LL_DAC_ConvertDualData12LeftAligned
Parameters:
DACxDAC instance
DataChannel1Value between Min_Data=0x000 and Max_Data=0xFFF
DataChannel2Value between Min_Data=0x000 and Max_Data=0xFFF
Return values:
None

Definition at line 1212 of file stm32f4xx_ll_dac.h.

References DAC_DHR12LD_DACC2DHR_BITOFFSET_POS.

__STATIC_INLINE void LL_DAC_ConvertDualData12RightAligned ( DAC_TypeDef *  DACx,
uint32_t  DataChannel1,
uint32_t  DataChannel2 
)

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:
DHR12RD DACC1DHR LL_DAC_ConvertDualData12RightAligned
DHR12RD DACC2DHR LL_DAC_ConvertDualData12RightAligned
Parameters:
DACxDAC instance
DataChannel1Value between Min_Data=0x000 and Max_Data=0xFFF
DataChannel2Value between Min_Data=0x000 and Max_Data=0xFFF
Return values:
None

Definition at line 1194 of file stm32f4xx_ll_dac.h.

References DAC_DHR12RD_DACC2DHR_BITOFFSET_POS.

__STATIC_INLINE void LL_DAC_ConvertDualData8RightAligned ( DAC_TypeDef *  DACx,
uint32_t  DataChannel1,
uint32_t  DataChannel2 
)

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:
DHR8RD DACC1DHR LL_DAC_ConvertDualData8RightAligned
DHR8RD DACC2DHR LL_DAC_ConvertDualData8RightAligned
Parameters:
DACxDAC instance
DataChannel1Value between Min_Data=0x00 and Max_Data=0xFF
DataChannel2Value between Min_Data=0x00 and Max_Data=0xFF
Return values:
None

Definition at line 1233 of file stm32f4xx_ll_dac.h.

References DAC_DHR8RD_DACC2DHR_BITOFFSET_POS.

__STATIC_INLINE void LL_DAC_Disable ( DAC_TypeDef *  DACx,
uint32_t  DAC_Channel 
)

Disable DAC selected channel.

Reference Manual to LL API cross reference:
CR EN1 LL_DAC_Disable
CR EN2 LL_DAC_Disable
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
None

Definition at line 985 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

__STATIC_INLINE 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:
CR TEN1 LL_DAC_DisableTrigger
CR TEN2 LL_DAC_DisableTrigger
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
None

Definition at line 1052 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

__STATIC_INLINE void LL_DAC_Enable ( DAC_TypeDef *  DACx,
uint32_t  DAC_Channel 
)

Enable DAC selected channel.

Reference Manual to LL API cross reference:
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:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
None

Definition at line 966 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

__STATIC_INLINE void LL_DAC_EnableTrigger ( DAC_TypeDef *  DACx,
uint32_t  DAC_Channel 
)

Enable DAC trigger of the selected channel.

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().
Reference Manual to LL API cross reference:
CR TEN1 LL_DAC_EnableTrigger
CR TEN2 LL_DAC_EnableTrigger
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
None

Definition at line 1033 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

__STATIC_INLINE uint32_t LL_DAC_IsEnabled ( 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:
CR EN1 LL_DAC_IsEnabled
CR EN2 LL_DAC_IsEnabled
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
Stateof bit (1 or 0).

Definition at line 1005 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

Referenced by LL_DAC_Init().

__STATIC_INLINE uint32_t LL_DAC_IsTriggerEnabled ( 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:
CR TEN1 LL_DAC_IsTriggerEnabled
CR TEN2 LL_DAC_IsTriggerEnabled
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
Stateof bit (1 or 0).

Definition at line 1072 of file stm32f4xx_ll_dac.h.

References DAC_CR_CHX_BITOFFSET_MASK.

__STATIC_INLINE uint32_t LL_DAC_RetrieveOutputData ( DAC_TypeDef *  DACx,
uint32_t  DAC_Channel 
)

Retrieve output data currently generated for the selected DAC channel.

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).
Reference Manual to LL API cross reference:
DOR1 DACC1DOR LL_DAC_RetrieveOutputData
DOR2 DACC2DOR LL_DAC_RetrieveOutputData
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can be one of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
Valuebetween Min_Data=0x000 and Max_Data=0xFFF

Definition at line 1258 of file stm32f4xx_ll_dac.h.

References __DAC_MASK_SHIFT, __DAC_PTR_REG_OFFSET, and DAC_REG_DORX_REGOFFSET_MASK.

__STATIC_INLINE void LL_DAC_TrigSWConversion ( DAC_TypeDef *  DACx,
uint32_t  DAC_Channel 
)

Trig DAC conversion by software for the selected DAC channel.

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().
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)
Reference Manual to LL API cross reference:
SWTRIGR SWTRIG1 LL_DAC_TrigSWConversion
SWTRIGR SWTRIG2 LL_DAC_TrigSWConversion
Parameters:
DACxDAC instance
DAC_ChannelThis parameter can a combination of the following values: (1) On this STM32 serie, parameter not available on all devices. Refer to device datasheet for channels availability.
Return values:
None

Definition at line 1101 of file stm32f4xx_ll_dac.h.

References DAC_SWTR_CHX_MASK.