Index: firmware/App/Drivers/InternalADC.h =================================================================== diff -u -r380b0afc95467d0861ff3aa2cdcde5d5d7ac85e7 -r56100135135bb715d316b5fd002a4a4951b9334a --- firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 380b0afc95467d0861ff3aa2cdcde5d5d7ac85e7) +++ firmware/App/Drivers/InternalADC.h (.../InternalADC.h) (revision 56100135135bb715d316b5fd002a4a4951b9334a) @@ -14,12 +14,12 @@ * @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,23 +29,19 @@ * @{ */ -// ********** 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_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_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_AVAILABLE_1, ///< Internal ADC channel for - INT_ADC_AVAILABLE_2, ///< Internal ADC channel for - INT_ADC_AVAILABLE_3, ///< Internal ADC channel for - INT_ADC_AVAILABLE_4, ///< Internal ADC channel for 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 @@ -58,19 +54,19 @@ 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_NOT_USED_2, ///< Not used - 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_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 ); - +F32 getIntADCVoltageConverted( INT_ADC_CHANNEL_T channel ); + /**@}*/ -#endif +#endif