Index: firmware/App/Drivers/InternalADC.c =================================================================== diff -u -r56100135135bb715d316b5fd002a4a4951b9334a -r395522dffef1348e176564925656012f529c1910 --- firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 56100135135bb715d316b5fd002a4a4951b9334a) +++ firmware/App/Drivers/InternalADC.c (.../InternalADC.c) (revision 395522dffef1348e176564925656012f529c1910) @@ -1,16 +1,16 @@ /************************************************************************** * -* Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2026 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.c * -* @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 * ***************************************************************************/ @@ -33,50 +33,49 @@ /// Mapping from enumerated used ADC channel to processor channel ID. const INT_ADC_CHANNEL_T ADC_CHANNEL_NUM_TO_CHANNEL_ID[ MAX_ADC_CHANNELS ] = { - INT_ADC_NOT_USED, // 0 - INT_ADC_PS_THERMISTOR, // 1 - INT_ADC_PBA_ADC_REF, // 2 - INT_ADC_24V_ACTUATORS_REG, // 3 + INT_ADC_24V_ACTUATORS_1, // 0 + INT_ADC_NOT_USED, // 1 + INT_ADC_1_8V_FPGA, // 2 + INT_ADC_1V_FPGA, // 3 INT_ADC_1_2V_PROCESSOR, // 4 - INT_ADC_5V_SENSORS, // 5 + INT_ADC_NOT_USED, // 5 INT_ADC_NOT_USED, // 6 - INT_ADC_NOT_USED, // 7 + INT_ADC_24V_ACTUATORS_2, // 7 INT_ADC_PRIMARY_ALARM_CURRENT_HG, // 8 INT_ADC_NOT_USED, // 9 INT_ADC_BOARD_THERMISTOR, // 10 - INT_ADC_1_25_FPGA_ADC_REF, // 11 + INT_ADC_1_8V_XADC, // 11 INT_ADC_3_3V, // 12 INT_ADC_5V_LOGIC, // 13 INT_ADC_PRIMARY_ALARM_CURRENT_LG, // 14 INT_ADC_NOT_USED, // 15 - INT_ADC_BLOOD_PUMP_SPEED, // 16 - INT_ADC_BLOOD_PUMP_MOTOR_CURRENT, // 17 + INT_ADC_NOT_USED, // 16 + INT_ADC_NOT_USED, // 17 INT_ADC_BACKUP_V, // 18 - INT_ADC_NOT_USED, // 19 + INT_ADC_ADC_REF, // 19 INT_ADC_NOT_USED, // 20 INT_ADC_NOT_USED, // 21 - INT_ADC_24V_ACTUATORS, // 22 + INT_ADC_NOT_USED, // 22 INT_ADC_NOT_USED // 23 }; const F32 ADC_CHANNEL_READ_TO_UNITS[ NUM_OF_INT_ADC_CHANNELS ] = { - 0.0, // - INT_ADC_NOT_USED - 1.601601, // RPM - INT_ADC_BLOOD_PUMP_SPEED - 0.003002, // A - INT_ADC_BLOOD_PUMP_MOTOR_CURRENT - 0.001221, // V - INT_ADC_PS_THERMISTOR - 0.001465, // V - INT_ADC_REFIN_1 - 0.009420, // V - INT_ADC_24V_ACTUATORS_REG - 0.000733, // V - INT_ADC_1_2V_PROCESSOR - 0.001465, // V - INT_ADC_5V_SENSORS - 0.014650, // mA - INT_ADC_PRIMARY_ALARM_CURRENT_HG - 0.001221, // V - INT_ADC_BOARD_THERMISTOR - 0.000733, // V - INT_ADC_1_25_FPGA_ADC_REF - 0.001465, // V - INT_ADC_3_3V - 0.001465, // V - INT_ADC_5V_LOGIC - 0.073240, // mA - INT_ADC_PRIMARY_ALARM_CURRENT_LG - 0.007106, // V - INT_ADC_24V_ACTUATORS - 0.007106, // V - INT_ADC_BACKUP_V + 0.000000, // - Not used + 0.014650, // mA - Internal ADC channel for primary alarm audio current high gain + 0.073240, // mA - Internal ADC channel for primary alarm audio current low gain + 0.001465, // V - Internal ADC channel for 5V to logic + 0.001465, // V - Internal ADC channel for 3.3V + 0.000733, // V - Internal ADC channel for 1.2V to processor + 0.000733, // V - Internal ADC channel for 1.8V external ADC + 0.000733, // V - Internal ADC channel for 1.0V FPGA + 0.000733, // V - Internal ADC channel for 1.8V FPGA + 0.001221, // V - Internal ADC channel for PCB temperature + 0.001465, // V - Internal ADC channel for ADC reference voltage + 0.009420, // V - Internal ADC channel for VBackup + 0.007106, // V - Internal ADC channel for 24V to actuators (1) + 0.007106, // V - Internal ADC channel for 24V to actuators (2) + 0.000000, // - Not used }; // ********** private data ********** @@ -153,7 +152,7 @@ { U32 i; - if ( adcRawReadingsCount < NUM_OF_INT_ADC_CHANNELS ) + if ( adcRawReadingsCount <= NUM_OF_INT_ADC_CHANNELS ) { // Process readings from last conversion for ( i = 0; i < adcRawReadingsCount; i++ )