#include "Voltage.h"


void Voltage_conf(ADC_TypeDef * adc, GPIO_TypeDef * gpio, int pin)
{
	//On configure le pin qui recevra le signal, ici PC2
	GPIO_conf(gpio, pin, LL_GPIO_MODE_ANALOG, 0, 0);
	
	//On configure l'ADC 
	ADC_conf(adc);
}

void Voltage_start(ADC_TypeDef * adc)
{
	ADC_start(adc);
}

float Voltage_getVoltage(ADC_TypeDef * adc, int channel) 
{
	return ADC_readVolt(adc, channel);
}
