STM32L486xx HAL User Manual
Functions
IO operation functions
DACEx Exported Functions

Extended IO operation functions. More...

Functions

HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate (DAC_HandleTypeDef *hdac, uint32_t Channel, uint32_t Amplitude)
 Enable or disable the selected DAC channel wave generation.
HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate (DAC_HandleTypeDef *hdac, uint32_t Channel, uint32_t Amplitude)
 Enable or disable the selected DAC channel wave generation.
HAL_StatusTypeDef HAL_DACEx_DualSetValue (DAC_HandleTypeDef *hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2)
 Set the specified data holding register value for dual DAC channel.
__weak void HAL_DACEx_ConvCpltCallbackCh2 (DAC_HandleTypeDef *hdac)
 Conversion complete callback in non-blocking mode for Channel2.
__weak void HAL_DACEx_ConvHalfCpltCallbackCh2 (DAC_HandleTypeDef *hdac)
 Conversion half DMA transfer callback in non-blocking mode for Channel2.
__weak void HAL_DACEx_ErrorCallbackCh2 (DAC_HandleTypeDef *hdac)
 Error DAC callback for Channel2.
__weak void HAL_DACEx_DMAUnderrunCallbackCh2 (DAC_HandleTypeDef *hdac)
 DMA underrun DAC callback for Channel2.
HAL_StatusTypeDef HAL_DACEx_SelfCalibrate (DAC_HandleTypeDef *hdac, DAC_ChannelConfTypeDef *sConfig, uint32_t Channel)
 Run the self calibration of one DAC channel.
HAL_StatusTypeDef HAL_DACEx_SetUserTrimming (DAC_HandleTypeDef *hdac, DAC_ChannelConfTypeDef *sConfig, uint32_t Channel, uint32_t NewTrimmingValue)
 Set the trimming mode and trimming value (user trimming mode applied).
uint32_t HAL_DACEx_GetTrimOffset (DAC_HandleTypeDef *hdac, uint32_t Channel)
 Return the DAC trimming value.

Detailed Description

Extended IO operation functions.

  ==============================================================================
                 ##### Extended features functions #####
  ==============================================================================
    [..]  This section provides functions allowing to:
      (+) Start conversion.
      (+) Stop conversion.
      (+) Start conversion and enable DMA transfer.
      (+) Stop conversion and disable DMA transfer.
      (+) Get result of conversion.
      (+) Get result of dual mode conversion.


Function Documentation

Conversion complete callback in non-blocking mode for Channel2.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Return values:
None

Definition at line 253 of file stm32l4xx_hal_dac_ex.c.

Referenced by DAC_DMAConvCpltCh2(), HAL_DAC_Init(), and HAL_DAC_UnRegisterCallback().

Conversion half DMA transfer callback in non-blocking mode for Channel2.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Return values:
None

Definition at line 269 of file stm32l4xx_hal_dac_ex.c.

Referenced by DAC_DMAHalfConvCpltCh2(), HAL_DAC_Init(), and HAL_DAC_UnRegisterCallback().

DMA underrun DAC callback for Channel2.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Return values:
None

Definition at line 301 of file stm32l4xx_hal_dac_ex.c.

Referenced by HAL_DAC_Init(), HAL_DAC_IRQHandler(), and HAL_DAC_UnRegisterCallback().

HAL_StatusTypeDef HAL_DACEx_DualSetValue ( DAC_HandleTypeDef hdac,
uint32_t  Alignment,
uint32_t  Data1,
uint32_t  Data2 
)

Set the specified data holding register value for dual DAC channel.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Alignment,:Specifies the data alignment for dual channel DAC. 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
Data1,:Data for DAC Channel2 to be loaded in the selected data holding register.
Data2,:Data for DAC Channel1 to be loaded in the selected data holding register.
Note:
In dual mode, a unique register access is required to write in both DAC channels at the same time.
Return values:
HALstatus

Definition at line 218 of file stm32l4xx_hal_dac_ex.c.

References assert_param, DAC_ALIGN_8B_R, DAC_DHR12RD_ALIGNMENT, __DAC_HandleTypeDef::Instance, IS_DAC_ALIGN, and IS_DAC_DATA.

Error DAC callback for Channel2.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Return values:
None

Definition at line 285 of file stm32l4xx_hal_dac_ex.c.

Referenced by DAC_DMAErrorCh2(), HAL_DAC_Init(), and HAL_DAC_UnRegisterCallback().

uint32_t HAL_DACEx_GetTrimOffset ( DAC_HandleTypeDef hdac,
uint32_t  Channel 
)

Return the DAC trimming value.

Parameters:
hdac: DAC handle
Channel,:The 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:
Trimmingvalue : range: 0->31

Definition at line 503 of file stm32l4xx_hal_dac_ex.c.

References assert_param, HAL_DAC_STATE_RESET, __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, and __DAC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate ( DAC_HandleTypeDef hdac,
uint32_t  Channel,
uint32_t  Amplitude 
)

Enable or disable the selected DAC channel wave generation.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Channel,:The selected DAC channel. This parameter can be one of the following values: DAC_CHANNEL_1 / DAC_CHANNEL_2
Amplitude,:Unmask DAC channel LFSR for noise wave generation. This parameter can be one of the following values:
  • DAC_LFSRUNMASK_BIT0: Unmask DAC channel LFSR bit0 for noise wave generation
  • DAC_LFSRUNMASK_BITS1_0: Unmask DAC channel LFSR bit[1:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS2_0: Unmask DAC channel LFSR bit[2:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS3_0: Unmask DAC channel LFSR bit[3:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS4_0: Unmask DAC channel LFSR bit[4:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS5_0: Unmask DAC channel LFSR bit[5:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS6_0: Unmask DAC channel LFSR bit[6:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS7_0: Unmask DAC channel LFSR bit[7:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS8_0: Unmask DAC channel LFSR bit[8:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS9_0: Unmask DAC channel LFSR bit[9:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS10_0: Unmask DAC channel LFSR bit[10:0] for noise wave generation
  • DAC_LFSRUNMASK_BITS11_0: Unmask DAC channel LFSR bit[11:0] for noise wave generation
Return values:
HALstatus

Definition at line 174 of file stm32l4xx_hal_dac_ex.c.

References assert_param, HAL_DAC_STATE_BUSY, HAL_DAC_STATE_READY, __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE, and __DAC_HandleTypeDef::State.

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

Run the self calibration of one DAC channel.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
sConfig,:DAC channel configuration structure.
Channel,:The 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:
UpdatesDAC_TrimmingValue. , DAC_UserTrimming set to DAC_UserTrimming
HALstatus
Note:
Calibration runs about 7 ms.

Definition at line 328 of file stm32l4xx_hal_dac_ex.c.

References assert_param, DAC_ALIGN_12B_R, DAC_CHANNEL_1, DAC_DHR12R1_ALIGNMENT, DAC_DHR12R2_ALIGNMENT, DAC_TRIMMING_USER, DAC_ChannelConfTypeDef::DAC_TrimmingValue, DAC_ChannelConfTypeDef::DAC_UserTrimming, HAL_DAC_STATE_BUSY, HAL_Delay(), __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, and __DAC_HandleTypeDef::State.

HAL_StatusTypeDef HAL_DACEx_SetUserTrimming ( DAC_HandleTypeDef hdac,
DAC_ChannelConfTypeDef sConfig,
uint32_t  Channel,
uint32_t  NewTrimmingValue 
)

Set the trimming mode and trimming value (user trimming mode applied).

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
sConfig,:DAC configuration structure updated with new DAC trimming value.
Channel,:The selected DAC channel. This parameter can be one of the following values:
  • DAC_CHANNEL_1: DAC Channel1 selected
  • DAC_CHANNEL_2: DAC Channel2 selected
NewTrimmingValue,:DAC new trimming value
Return values:
HALstatus

Definition at line 461 of file stm32l4xx_hal_dac_ex.c.

References assert_param, DAC_TRIMMING_USER, DAC_ChannelConfTypeDef::DAC_TrimmingValue, DAC_ChannelConfTypeDef::DAC_UserTrimming, __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, and IS_DAC_NEWTRIMMINGVALUE.

HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate ( DAC_HandleTypeDef hdac,
uint32_t  Channel,
uint32_t  Amplitude 
)

Enable or disable the selected DAC channel wave generation.

Parameters:
hdac,:pointer to a DAC_HandleTypeDef structure that contains the configuration information for the specified DAC.
Channel,:The selected DAC channel. This parameter can be one of the following values: DAC_CHANNEL_1 / DAC_CHANNEL_2
Amplitude,:Select max triangle amplitude. This parameter can be one of the following values:
  • DAC_TRIANGLEAMPLITUDE_1: Select max triangle amplitude of 1
  • DAC_TRIANGLEAMPLITUDE_3: Select max triangle amplitude of 3
  • DAC_TRIANGLEAMPLITUDE_7: Select max triangle amplitude of 7
  • DAC_TRIANGLEAMPLITUDE_15: Select max triangle amplitude of 15
  • DAC_TRIANGLEAMPLITUDE_31: Select max triangle amplitude of 31
  • DAC_TRIANGLEAMPLITUDE_63: Select max triangle amplitude of 63
  • DAC_TRIANGLEAMPLITUDE_127: Select max triangle amplitude of 127
  • DAC_TRIANGLEAMPLITUDE_255: Select max triangle amplitude of 255
  • DAC_TRIANGLEAMPLITUDE_511: Select max triangle amplitude of 511
  • DAC_TRIANGLEAMPLITUDE_1023: Select max triangle amplitude of 1023
  • DAC_TRIANGLEAMPLITUDE_2047: Select max triangle amplitude of 2047
  • DAC_TRIANGLEAMPLITUDE_4095: Select max triangle amplitude of 4095
Return values:
HALstatus

Definition at line 126 of file stm32l4xx_hal_dac_ex.c.

References assert_param, HAL_DAC_STATE_BUSY, HAL_DAC_STATE_READY, __DAC_HandleTypeDef::Instance, IS_DAC_CHANNEL, IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE, and __DAC_HandleTypeDef::State.