STM32L443xx HAL User Manual
Functions
Peripheral Control functions
DAC Exported Functions

Peripheral Control functions. More...

Functions

uint32_t HAL_DAC_GetValue (DAC_HandleTypeDef *hdac, uint32_t Channel)
 Returns the last data output value of the selected DAC channel.
HAL_StatusTypeDef HAL_DAC_ConfigChannel (DAC_HandleTypeDef *hdac, DAC_ChannelConfTypeDef *sConfig, uint32_t Channel)
 Configures the selected 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.

Note:
By calling this function, the high frequency interface mode (HFSEL bits) will be set. This parameter scope is the DAC instance. As the function is called for each channel, the DAC_HighFrequency of
  • sConfig must be the same at each call. (or DAC_HIGH_FREQUENCY_INTERFACE_MODE_AUTOMATIC self detect).
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 (Whenever present)
Return values:
HALstatus

Definition at line 1201 of file stm32l4xx_hal_dac.c.

References assert_param, DAC_CHANNEL_1, DAC_ChannelConfTypeDef::DAC_ConnectOnChipPeripheral, DAC_SampleAndHoldConfTypeDef::DAC_HoldTime, DAC_ChannelConfTypeDef::DAC_OutputBuffer, DAC_SampleAndHoldConfTypeDef::DAC_RefreshTime, DAC_ChannelConfTypeDef::DAC_SampleAndHold, DAC_SAMPLEANDHOLD_ENABLE, DAC_ChannelConfTypeDef::DAC_SampleAndHoldConfig, DAC_SampleAndHoldConfTypeDef::DAC_SampleTime, DAC_ChannelConfTypeDef::DAC_Trigger, DAC_TRIMMING_USER, DAC_ChannelConfTypeDef::DAC_TrimmingValue, DAC_ChannelConfTypeDef::DAC_UserTrimming, __DAC_HandleTypeDef::ErrorCode, HAL_DAC_ERROR_TIMEOUT, HAL_DAC_STATE_BUSY, HAL_DAC_STATE_READY, HAL_DAC_STATE_TIMEOUT, HAL_Delay(), HAL_GetTick(), HAL_RCC_GetHCLKFreq(), HFSEL_ENABLE_THRESHOLD_80MHZ, __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, IS_DAC_CHIP_CONNECTION, IS_DAC_HOLDTIME, IS_DAC_OUTPUT_BUFFER_STATE, IS_DAC_REFRESHTIME, IS_DAC_SAMPLEANDHOLD, IS_DAC_SAMPLETIME, IS_DAC_TRIGGER, IS_DAC_TRIMMING, IS_DAC_TRIMMINGVALUE, __DAC_HandleTypeDef::State, and TIMEOUT_DAC_CALIBCONFIG.

uint32_t HAL_DAC_GetValue ( DAC_HandleTypeDef hdac,
uint32_t  Channel 
)

Returns the last data output value of the selected 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
Return values:
Theselected DAC channel data output value.

Definition at line 1154 of file stm32l4xx_hal_dac.c.

References assert_param, DAC_CHANNEL_1, __DAC_HandleTypeDef::Instance, and IS_DAC_CHANNEL.