AnsweredAssumed Answered

Hey Cube team, here's some code for stm32f4xx_hal_dac_ex.c

Question asked by Andrei Chichak on Feb 25, 2015
Latest reply on May 7, 2015 by JeepersCreepers
/*
 * For when you don't want a triangle wave or random noise.
 */
HAL_StatusTypeDef HAL_DACEx_NoWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel)
{
  /* Check the parameters */
  assert_param(IS_DAC_CHANNEL(Channel));
 
  /* Process locked */
  __HAL_LOCK(hdac);
 
  /* Change DAC state */
  hdac->State = HAL_DAC_STATE_BUSY;
 
  /* Enable the selected wave generation for the selected DAC channel */
  MODIFY_REG(hdac->Instance->CR, (DAC_CR_WAVE1) << Channel, (DAC_WAVEGENERATION_NONE) << Channel);
 
  /* Change DAC state */
  hdac->State = HAL_DAC_STATE_READY;
 
  /* Process unlocked */
  __HAL_UNLOCK(hdac);
 
  /* Return function status */
  return HAL_OK;
}

Outcomes