#ifndef __ADC_H__
#define __ADC_H__

#ifdef __cplusplus
 extern "C" {
#endif

#include "stm32f4xx.h"

#define ADC_FILTER_LEN (12)

extern uint32_t system_tick_cnt;

float adc_to_resistance(uint16_t adc_value);
float adc_to_resistance16(uint16_t adc_value);
uint32_t adc_rtot(uint16_t adc_value);
uint32_t adc_rtot16(uint16_t adc_value);
void adc_input_data(uint8_t ch, uint16_t data);
uint16_t adc_get_filter_data(uint8_t ch);
void adc_init(void);
void adc_trig(uint8_t ch);
uint16_t adc_read(void);
void adc_loop(void);

#ifdef __cplusplus
}
#endif

#endif /* __ADC_H__ */
