Src/main.c
/**
  * @brief DAC Initialization Function
  * @param None
  * @retval None
  */
@brief DAC Initialization Function
@param None
@retval None
@brief DAC Initialization Function @param None @retval None
static void MX_DAC_Init(void)
{
  LL_DAC_InitTypeDef DAC_InitStruct = {0};
  LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
  LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_DAC1);
  LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOA);
  GPIO_InitStruct.Pin = LL_GPIO_PIN_4;
  GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
  GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
  LL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  DAC_InitStruct.TriggerSource = LL_DAC_TRIG_SOFTWARE;
  DAC_InitStruct.WaveAutoGeneration = LL_DAC_WAVE_AUTO_GENERATION_NONE;
  DAC_InitStruct.OutputBuffer = LL_DAC_OUTPUT_BUFFER_ENABLE;
  LL_DAC_Init(DAC, LL_DAC_CHANNEL_1, &DAC_InitStruct);
  LL_DAC_DisableTrigger(DAC, LL_DAC_CHANNEL_1);
}
static void MX_DAC_Init ( void ) { LL_DAC_InitTypeDef DAC_InitStruct = { 0 } ; LL_GPIO_InitTypeDef GPIO_InitStruct = { 0 } ; LL_APB1_GRP1_EnableClock ( LL_APB1_GRP1_PERIPH_DAC1 ) ; LL_AHB1_GRP1_EnableClock ( LL_AHB1_GRP1_PERIPH_GPIOA ) ; GPIO_InitStruct . Pin = LL_GPIO_PIN_4 ; GPIO_InitStruct . Mode = LL_GPIO_MODE_ANALOG ; GPIO_InitStruct . Pull = LL_GPIO_PULL_NO ; LL_GPIO_Init ( GPIOA , & GPIO_InitStruct ) ; DAC_InitStruct . TriggerSource = LL_DAC_TRIG_SOFTWARE ; DAC_InitStruct . WaveAutoGeneration = LL_DAC_WAVE_AUTO_GENERATION_NONE ; DAC_InitStruct . OutputBuffer = LL_DAC_OUTPUT_BUFFER_ENABLE ; LL_DAC_Init ( DAC , LL_DAC_CHANNEL_1 , & DAC_InitStruct ) ; LL_DAC_DisableTrigger ( DAC , LL_DAC_CHANNEL_1 ) ; }
@brief DAC Initialization Function
 @param None
 @retval None
@brief DAC Initialization Function @param None @retval None
/* USER CODE BEGIN DAC_Init 0 */ /* USER CODE END DAC_Init 0 */ /* Peripheral clock enable */ /**DAC GPIO Configuration  
  PA4   ------> DAC_OUT1 
  */ /* USER CODE BEGIN DAC_Init 1 */ /* USER CODE END DAC_Init 1 */ /** DAC channel OUT1 config 
  */ /* USER CODE BEGIN DAC_Init 2 */ /* USER CODE END DAC_Init 2 */