/** ****************************************************************************** * @file adc.h * @author AMG Energy Solution Team * @version V1.0.0 * @date 07-Feb-2022 * @brief This file provides all the headers of adc control functions. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * *

© COPYRIGHT 2022 AMG

****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef _ADC_H #define _ADC_H /* Includes ------------------------------------------------------------------*/ #include "hc32_ddl.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported defines ----------------------------------------------------------*/ #define ADC_VBASE 3300 // 3.3V /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void DmaInitConfig(void); void DmaReloadConfig(uint8_t nAdc); void ADC_Port_Init(void); uint8_t GetAdcIrgFlag(uint8_t nAdc); /****** ADC1 for Temperature **************************************************/ uint16_t AvgAdc1DmaValue(uint16_t ch); uint16_t GetAdc1DmaBufferValue(uint16_t ch, uint16_t no); void DisplayAdc1DmaBufferValue(void); /****** ADC2 for VI ***********************************************************/ uint16_t AvgAdc2DmaValue(uint16_t ch); uint16_t GetAdc2DmaBufferValue(uint16_t ch, uint16_t no); void DisplayAdc2DmaBufferValue(uint8_t ch); uint32_t CheckAdc2DmaValue(uint16_t ch); #endif /*******************(C)COPYRIGHT 2022 AMG ********************END OF FILE******/