STM32F439xx HAL User Manual
Functions
Peripheral Control functions
DAC Exported Functions

Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_DAC_ConfigChannel (DAC_HandleTypeDef *hdac, DAC_ChannelConfTypeDef *sConfig, uint32_t Channel)
 Configures the selected DAC channel.
HAL_StatusTypeDef HAL_DAC_SetValue (DAC_HandleTypeDef *hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data)
 Set the specified data holding register value for DAC channel.

Detailed Description

Peripheral Control functions.

  ==============================================================================
             ##### Peripheral Control functions #####
  ==============================================================================  
    [..]  This section provides functions allowing to:
      (+) Configure channels. 
      (+) Set the specified data holding register value for DAC channel.
      

Function Documentation

HAL_StatusTypeDef HAL_DAC_ConfigChannel ( DAC_HandleTypeDef hdac,
DAC_ChannelConfTypeDef sConfig,
uint32_t  Channel 
)

Configures the selected DAC channel.

Parameters:
hdacpointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
sConfigDAC configuration structure.
ChannelThe selected DAC channel. This parameter can be one of the following values:
  • DAC_CHANNEL_1: DAC Channel1 selected
  • DAC_CHANNEL_2: DAC Channel2 selected
Return values:
HALstatus

Definition at line 771 of file stm32f4xx_hal_dac.c.

References assert_param, DAC_ChannelConfTypeDef::DAC_OutputBuffer, DAC_ChannelConfTypeDef::DAC_Trigger, HAL_DAC_STATE_BUSY, HAL_DAC_STATE_READY, DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, IS_DAC_OUTPUT_BUFFER_STATE, IS_DAC_TRIGGER, and DAC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_DAC_SetValue ( DAC_HandleTypeDef hdac,
uint32_t  Channel,
uint32_t  Alignment,
uint32_t  Data 
)

Set the specified data holding register value for DAC channel.

Parameters:
hdacpointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
ChannelThe selected DAC channel. This parameter can be one of the following values:
  • DAC_CHANNEL_1: DAC Channel1 selected
  • DAC_CHANNEL_2: DAC Channel2 selected
AlignmentSpecifies the data alignment. This parameter can be one of the following values:
  • DAC_ALIGN_8B_R: 8bit right data alignment selected
  • DAC_ALIGN_12B_L: 12bit left data alignment selected
  • DAC_ALIGN_12B_R: 12bit right data alignment selected
DataData to be loaded in the selected data holding register.
Return values:
HALstatus

Definition at line 827 of file stm32f4xx_hal_dac.c.

References assert_param, DAC_CHANNEL_1, DAC_DHR12R1_ALIGNMENT, DAC_DHR12R2_ALIGNMENT, DAC_HandleTypeDef::Instance, IS_DAC_ALIGN, IS_DAC_CHANNEL, and IS_DAC_DATA.