/************************************************************************** * * Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file InternalADC.h * * @author (last) Dara Navaei * @date (last) 07-Mar-2022 * * @author (original) Sean * @date (original) 04-Feb-2020 * ***************************************************************************/ #ifndef __INT_ADC_H__ #define __INT_ADC_H__ #include "DGCommon.h" /** * @defgroup InternalADC InternalADC * @brief DG internal ADC module. * * @addtogroup InternalADC * @{ */ // ********** public definitions ********** #define INT_ADC_BITS_PER_CHANNEL 12 ///< DG internal ADC bits per channel. #define INT_ADC_FULL_SCALE_BITS 4095 ///< DG internal ADC full scale range. #define INT_ADC_REF_V 3.0F ///< DG internal ADC reference voltage. /// Enumeration of DG internal ADC channels. typedef enum Int_ADC_Channels { INT_ADC_NOT_USED = 0, ///< DG internal ADC channel not used INT_ADC_RO_PUMP_INLET_PRESSURE, ///< DG internal ADC RO pump inlet pressure channel INT_ADC_RO_PUMP_OUTLET_PRESSURE, ///< DG internal ADC RO pump outlet pressure channel INT_ADC_DRAIN_PUMP_OUTLET_PRESSURE, ///< DG internal ADC drain pump outlet pressure channel INT_ADC_DRAIN_PUMP_INLET_PRESSURE, ///< DG internal ADC drain pump inlet pressure channel INT_ADC_RO_PUMP_FEEDBACK_DUTY_CYCLE, ///< DG internal ADC RO pump feedback duty cycle channel INT_ADC_AVAILABLE_CHANNEL, ///< DG internal ADC available channel INT_ADC_SECONDARY_HEATER_24_VOLTS, ///< DG internal ADC secondary heater 24 volt supply channel INT_ADC_TRIMMER_HEATER_24_VOLTS, ///< DG internal ADC trimmer heater 24 volt supply channel INT_ADC_BOARD_THERMISTOR, ///< DG internal ADC DG board thermistor channel INT_ADC_FPGA_1_8_VOLTS, ///< DG internal ADC DG FPGA 1.8 volt supply channel INT_ADC_FPGA_1_VOLT, ///< DG internal ADC DG FPGA 1 volt supply channel INT_ADC_PROCESSOR_1_8_VOLTS, ///< DG internal ADC DG processor 1.8 volt supply channel INT_ADC_PROCESSOR_1_2_VOLTS, ///< DG internal ADC DG processor 1.2 volt supply channel INT_ADC_SENSORS_3_3_VOLTS, ///< DG internal ADC DG sensors 3.3 volt supply channel INT_ADC_SENSORS_5_VOLTS, ///< DG internal ADC DG sensors 5 volt supply channel INT_ADC_MAIN_24_VOLTS, ///< DG internal ADC DG 24 volt supply channel INT_ADC_LOGIC_5_VOLTS, ///< DG internal ADC DG logic 5 volt supply channel INT_ADC_3_3_VOLTS, ///< DG internal ADC DG 3.3 volt supply channel INT_ADC_REFERENCE_VOLTAGE, ///< DG internal ADC reference voltage channel INT_ADC_REF_IN1, ///< DG internal ADC external ADC1 reference voltage channel INT_ADC_REF_IN2, ///< DG internal ADC external ADC2 reference voltage channel INT_ADC_POWER_SUPPLY_1_THERMISTOR, ///< DG internal ADC DG power supply 1 thermistor INT_ADC_POWER_SUPPLY_2_THERMISTOR, ///< DG internal ADC DG power supply 2 thermistor INT_ADC_POWER_SUPPLY_GATE_DRIVER, ///< DG internal ADC DG power supply gate driver NUM_OF_INT_ADC_CHANNELS ///< Number of DG internal ADC channels } INT_ADC_CHANNEL_T; // ********** public function prototypes ********** void initInternalADC( void ); void execInternalADC( void ); U16 getIntADCReading( INT_ADC_CHANNEL_T channel ); F32 getIntADCVoltageConverted( INT_ADC_CHANNEL_T channel ); /**@}*/ #endif