/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    dac.h
  * @brief   This file contains all the function prototypes for
  *          the dac.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DAC_H__
#define __DAC_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern DAC_HandleTypeDef hdac;

/* USER CODE BEGIN Private defines */

#define DAC1_Start()                            HAL_DAC_Start(&hdac, DAC_CHANNEL_1)
#define DAC2_Start()                            HAL_DAC_Start(&hdac, DAC_CHANNEL_2)

#define DAC1_SetValue(Data)                     DAC_SetValue(DAC_CHANNEL_1, DAC_ALIGN_12B_R, Data)
#define DAC2_SetValue(Data)                     DAC_SetValue(DAC_CHANNEL_2, DAC_ALIGN_12B_R, Data)

/**
  * channel    @arg DAC_CHANNEL_1
  *            @arg DAC_CHANNEL_2
  * alignment  @arg DAC_ALIGN_12B_R
  *            @arg DAC_ALIGN_12B_L
  *            @arg DAC_ALIGN_8B_R
  */
#define DAC_SetValue(channel, alignment, data)  HAL_DAC_SetValue(&hdac, channel, alignment, data)

/* USER CODE END Private defines */

void MX_DAC_Init(void);

/* USER CODE BEGIN Prototypes */

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __DAC_H__ */

