/**
  ******************************************************************************
  * @file    ADC_user.h
  * @author  SINOMCU-AE
  * @brief   Header file of ADC_user.c file.
  *   
  ******************************************************************************
  * @attention 
  *                           DISCLAIMER
  * 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, SinoMCU 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.
  *
  * <h2><center>&copy; Copyright (c) 2021 sinomcu All rights reserved.</center></h2>
  *
  ******************************************************************************
  */

#ifndef __ADC_USER_H
#define __ADC_USER_H

#include "ms32f0xx.h"

#define USE_TIMEOUT                    1         // 1:use time out,0:do not use time out
#define ADC_ERROR_LED_BLINK_HALF_PER   100       // unit ms

// ADC Error TypeDef
typedef enum
{
  ADC_NO_ERROR = 0U,
  ADC_CALI_ERROR,
  ADC_ADRDY_ERROR,
  ADC_CONVERSION_EOC_ERROR,
  ADC_CONVERSION_EOS_ERROR,
  ADC_OVERRUN_ERROR  
} ADCErrorStatus;

ADCErrorStatus Activate_ADC(void);
uint16_t Get_ADC_Conversion_Result(ADCErrorStatus * ADC_Status);
void ADC_ERROR(ADCErrorStatus error_status);

#endif /* __ADC_USER_H */ 

/******************************** END OF FILE *********************************/
