Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -r6029b4ee6c8482d6109597a4de6073e539697d51 -re24a98a344ba13ceb0663b415268a7e1dd5ce99e --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 6029b4ee6c8482d6109597a4de6073e539697d51) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision e24a98a344ba13ceb0663b415268a7e1dd5ce99e) @@ -1,25 +1,25 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2025 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) Sean -* @date (last) 07-Aug-2024 +* @author (last) Sean Nash +* @date (last) 11-Sep-2025 * -* @author (original) Sean +* @author (original) Sean Nash * @date (original) 07-Aug-2024 * ***************************************************************************/ - -#ifndef __INT_ADC_H__ -#define __INT_ADC_H__ - -#include "TDCommon.h" - + +#ifndef __INT_ADC_H__ +#define __INT_ADC_H__ + +#include "TDCommon.h" + /** * @defgroup InternalADC InternalADC * @brief The internal ADC unit provides functions for reading the sampled @@ -29,44 +29,41 @@ * @{ */ -// ********** 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. +// ********** public definitions ********** -/// Enumeration of internal ADC channels that are used. -typedef enum Int_ADC_Channels -{ +#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_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_BLOOD_PUMP_SPEED, ///< Internal ADC channel for blood pump speed - INT_ADC_BLOOD_PUMP_MOTOR_CURRENT, ///< Internal ADC channel for blood pump current - INT_ADC_PS_THERMISTOR, ///< Internal ADC channel for power supply temperature - INT_ADC_PBA_ADC_REF, ///< Internal ADC channel for reference voltage to PBA ADC channel) - 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_PRIMARY_ALARM_CURRENT_HG, ///< Internal ADC channel for primary alarm audio current high gain - 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_PRIMARY_ALARM_CURRENT_LG, ///< Internal ADC channel for primary alarm audio current low gain - INT_ADC_24V_ACTUATORS, ///< Internal ADC channel for 24V to actuators + INT_ADC_5V_LOGIC, ///< Internal ADC channel for 5V to logic + INT_ADC_3_3V, ///< Internal ADC channel for 3.3V + INT_ADC_1_2V_PROCESSOR, ///< Internal ADC channel for 1.2V to processor + INT_ADC_1_8V_XADC, ///< Internal ADC channel for 1.8V external ADC + INT_ADC_1V_FPGA, ///< Internal ADC channel for 1.0V FPGA + INT_ADC_1_8V_FPGA, ///< Internal ADC channel for 1.8V FPGA + INT_ADC_BOARD_THERMISTOR, ///< Internal ADC channel for PCB temperature + INT_ADC_ADC_REF, ///< Internal ADC channel for ADC reference voltage 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 ); + INT_ADC_24V_ACTUATORS_1, ///< Internal ADC channel for 24V to actuators (1) + INT_ADC_24V_ACTUATORS_2, ///< Internal ADC channel for 24V to actuators (2) + 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 ); - +F32 getIntADCVoltageConverted( INT_ADC_CHANNEL_T channel ); + /**@}*/ -#endif +#endif