#ifndef __INT_ADC_H__ #define __INT_ADC_H__ #include "ROCommon.h" /** * @defgroup InternalADC InternalADC * @brief The internal ADC unit provides functions for reading the sampled * internal ADC channel data. * * @addtogroup InternalADC * @{ */ // ********** public definitions ********** #define INT_ADC_BITS_PER_CHANNEL 12 ///< Internal ADC channels are 12-bit. #define INT_ADC_FULL_SCALE_BITS 4096 ///< Internal ADC has 4096 full scale counts per channel. #define INT_ADC_ZERO 1998 ///< For signed 2's compliment data, zero is here. #define INT_ADC_REF_V 3.0F ///< Internal ADC reference voltage is 3.0V. /// Enumeration of internal ADC channels that are used. typedef enum Int_ADC_Channels { INT_ADC_NOT_USED = 0, ///< Not used 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