rusefi-1/firmware/hw_layer/adc_external.h

20 lines
500 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/*
* @file adc_external.h
*
2017-11-24 14:40:20 -08:00
* external ADC is probably broken, at least there is a major mess
2015-07-10 06:01:56 -07:00
*
* @date Aug 18, 2013
2017-03-05 18:59:00 -08:00
* @author Andrey Belomutskiy, (c) 2012-2017
2015-07-10 06:01:56 -07:00
*/
#ifndef ADC_EXTERNAL_H_
#define ADC_EXTERNAL_H_
#include "mcp3208.h"
#define getAdcValue(channel) getMcp3208adc(channel)
#define adcToVoltsDivided(adc) (5.0f / 4095 * adc)
#define getVoltageDivided(msg, channel) (channel == EFI_ADC_NONE ? 66.66 : adcToVoltsDivided(getAdcValue(msg, channel)))
#endif /* ADC_EXTERNAL_H_ */