/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file dac.h * @brief This file contains all the function prototypes for * the dac.c file ****************************************************************************** * @attention * * Copyright (c) 2024 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 */ #include "data_type_def.h" #include "mux_signal.h" #include "eeprom_spi.h" /* USER CODE END Includes */ extern DAC_HandleTypeDef hdac; /* USER CODE BEGIN Private defines */ #define CALIBRATE_VOL_V_OUT_START 0 #define CALIBRATE_VOL_V_OUT_END 30 #define CALIBRATE_VOL_V_OUT_POINTS 11 /* USER CODE END Private defines */ void MX_DAC_Init(void); /* USER CODE BEGIN Prototypes */ void dac_set_voltage(float *vol); float calibrate_vol_v(float raw); extern float vol_v_out_calibrate_table[CALIBRATE_VOL_V_OUT_POINTS]; /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /* __DAC_H__ */