Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -r4fb1e15d35f6b968bab5620909c30baec98bfd4e -red39129abdca4ec343369d83494530b23621e052 --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 4fb1e15d35f6b968bab5620909c30baec98bfd4e) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision ed39129abdca4ec343369d83494530b23621e052) @@ -8,70 +8,59 @@ * @file InternalADC.h * * @author (last) Vinayakam Mani -* @date (last) 13-Aug-2024 +* @date (last) 14-Aug-2024 * * @author (original) Vinayakam Mani * @date (original) 13-Aug-2024 * ***************************************************************************/ - -#ifndef __INT_ADC_H__ -#define __INT_ADC_H__ - -#include "DDCommon.h" - -/** - * @defgroup InternalADC InternalADC - * @brief DD internal ADC module. - * - * @addtogroup InternalADC - * @{ - */ - -// ********** public definitions ********** +#ifndef __INT_ADC_H__ +#define __INT_ADC_H__ + +#include "DDCommon.h" + +/** + * @defgroup InternalADC InternalADC + * @brief DD internal ADC unit. This unit converts all analog channel (DD + * different voltage rails, pressure, temperature) into digital value for further + * processing ( monitoring and controls). + * + * @addtogroup InternalADC + * @{ + */ + +// ********** public definitions ********** + #define INT_ADC_BITS_PER_CHANNEL 12 ///< DD internal ADC bits per channel. #define INT_ADC_FULL_SCALE_BITS 4095 ///< DD internal ADC full scale range. #define INT_ADC_REF_V 3.0F ///< DD internal ADC reference voltage. - -/// Enumeration of DD internal ADC channels. -typedef enum Int_ADC_Channels -{ - INT_ADC_NOT_USED = 0, ///< DD internal ADC channel not used - INT_ADC_RO_PUMP_INLET_PRESSURE, ///< DD internal ADC RO pump inlet pressure channel - INT_ADC_RO_PUMP_OUTLET_PRESSURE, ///< DD internal ADC RO pump outlet pressure channel - INT_ADC_DRAIN_PUMP_OUTLET_PRESSURE, ///< DD internal ADC drain pump outlet pressure channel - INT_ADC_DRAIN_PUMP_INLET_PRESSURE, ///< DD internal ADC drain pump inlet pressure channel - INT_ADC_RO_PUMP_FEEDBACK_DUTY_CYCLE, ///< DD internal ADC RO pump feedback duty cycle channel - INT_ADC_AVAILABLE_CHANNEL, ///< DD internal ADC available channel - INT_ADC_SECONDARY_HEATER_24_VOLTS, ///< DD internal ADC secondary heater 24 volt supply channel - INT_ADC_TRIMMER_HEATER_24_VOLTS, ///< DD internal ADC trimmer heater 24 volt supply channel - INT_ADC_BOARD_THERMISTOR, ///< DD internal ADC DD board thermistor channel - INT_ADC_FPGA_1_8_VOLTS, ///< DD internal ADC DD FPGA 1.8 volt supply channel - INT_ADC_FPGA_1_VOLT, ///< DD internal ADC DD FPGA 1 volt supply channel - INT_ADC_PROCESSOR_1_8_VOLTS, ///< DD internal ADC DD processor 1.8 volt supply channel - INT_ADC_PROCESSOR_1_2_VOLTS, ///< DD internal ADC DD processor 1.2 volt supply channel - INT_ADC_SENSORS_3_3_VOLTS, ///< DD internal ADC DD sensors 3.3 volt supply channel - INT_ADC_SENSORS_5_VOLTS, ///< DD internal ADC DD sensors 5 volt supply channel - INT_ADC_MAIN_24_VOLTS, ///< DD internal ADC DD 24 volt supply channel - INT_ADC_LOGIC_5_VOLTS, ///< DD internal ADC DD logic 5 volt supply channel - INT_ADC_3_3_VOLTS, ///< DD internal ADC DD 3.3 volt supply channel - INT_ADC_REFERENCE_VOLTAGE, ///< DD internal ADC reference voltage channel - INT_ADC_REF_IN1, ///< DD internal ADC external ADC1 reference voltage channel - INT_ADC_REF_IN2, ///< DD internal ADC external ADC2 reference voltage channel - INT_ADC_POWER_SUPPLY_1_THERMISTOR, ///< DD internal ADC DD power supply 1 thermistor - INT_ADC_MAIN_NON_ISOLATED_24_VOLTS, ///< DD internal ADC DD 24 volts non-isolated voltage channel - INT_ADC_POWER_SUPPLY_GATE_DRIVER, ///< DD internal ADC DD power supply gate driver - NUM_OF_INT_ADC_CHANNELS ///< Number of DD internal ADC channels -} INT_ADC_CHANNEL_T; - -// ********** public function prototypes ********** - -void initInternalADC( void ); -void execInternalADC( void ); -U16 getIntADCReading( INT_ADC_CHANNEL_T channel ); + +/// Enumeration of DD internal ADC channels. +typedef enum Int_ADC_Channels +{ + INT_ADC_NOT_USED = 0, ///< Not used + INT_ADC_3_3V_SENSOR_ADC_REF, ///< Internal ADC channel for 3.3V sensor volatge + INT_ADC_24V_ACTUATORS_REG, ///< Internal ADC channel for 24V regen (diode drop) to actuators + INT_ADC_1_2V_PROCESSOR, ///< Internal ADC channel for 1.2V to processor + INT_ADC_5V_SENSORS, ///< Internal ADC channel for 5V to sensors + INT_ADC_BOARD_THERMISTOR, ///< Internal ADC channel for PCB temperature + INT_ADC_1_25_FPGA_ADC_REF, ///< Internal ADC channel for FPGA ADC reference voltage + INT_ADC_3_3V, ///< Internal ADC channel for 3.3V + INT_ADC_5V_LOGIC, ///< Internal ADC channel for 5V to logic + INT_ADC_24V_ACTUATORS, ///< Internal ADC channel for 24V to actuators + INT_ADC_BACKUP_V, ///< Internal ADC channel for VBackup + INT_ADC_DUMMY, ///< Internal ADC channel - not used, needed to get even number of channels + NUM_OF_INT_ADC_CHANNELS ///< Number of used 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 + +/**@}*/ + +#endif