Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r91bfb0dce5cc0cfcc161ca3d3215d35befab3ef7 -r7d4711edd7b40cd3e29f43e766f79a8a09586fe9 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 91bfb0dce5cc0cfcc161ca3d3215d35befab3ef7) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 7d4711edd7b40cd3e29f43e766f79a8a09586fe9) @@ -1,15 +1,15 @@ /************************************************************************** * -* Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 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 FPGA.c * -* @author (last) Bill Bracken -* @date (last) 14-May-2023 +* @author (last) Dara Navaei +* @date (last) 26-Sep-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -324,7 +324,7 @@ U16 fpgaDACRegFIn; ///< Reg 126. Debug DAC channel F output U16 fpgaDACRegGIn; ///< Reg 128. Debug DAC channel G output U16 fpgaDACRegHIn; ///< Reg 130. Debug DAC channel H output - U08 fgpaNewCP2Control; ///< Reg 132. Concentrate pump 2 control + U08 fpgaNewCP2Control; ///< Reg 132. Concentrate pump 2 control U08 fpgaNewCP1Control; ///< Reg 133. Concentrate pump 1 control } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -756,7 +756,7 @@ // reset one-time sets after actuator set points xmit message created fpgaActuatorSetPoints.fpgaNewCP1Control &= ~FPGA_CONC_PUMP_PARK_COMMAND; // clear concentrate pump park command bits - fpgaActuatorSetPoints.fgpaNewCP2Control &= ~FPGA_CONC_PUMP_PARK_COMMAND; + fpgaActuatorSetPoints.fpgaNewCP2Control &= ~FPGA_CONC_PUMP_PARK_COMMAND; fpgaActuatorSetPoints.fpgaCP1Control &= ~FPGA_CONC_PUMP_PARK_COMMAND; fpgaActuatorSetPoints.fpgaCP2Control &= ~FPGA_CONC_PUMP_PARK_COMMAND; @@ -1299,6 +1299,25 @@ /*********************************************************************//** * @brief + * The getFPGAAcidPumpControlStatus function gets the status of the + * acid pump control status bits. + * bit 7: Park (set in different function) + * bit 6: nSleep + * bit 5: nReset + * bit 4: nEnable + * bit 3: Direction (1=Fwd, 0=Rev) + * bit 0-2: Microstepping resolution + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control + * @return Acid pump control status bit + *************************************************************************/ +U08 getFPGAAcidPumpControlStatus( void ) +{ + return fpgaActuatorSetPoints.fpgaNewCP1Control; +} + +/*********************************************************************//** + * @brief * The setFPGABicarbPumpControl function sets the DVT concentrate pump 2 * (bicarb pump) control mode. * bit 7: Park (set in different function) @@ -1308,18 +1327,37 @@ * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fgpaNewCP2Control + * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control * @param control Concentrate pump control set * @return none *************************************************************************/ void setFPGABicarbPumpControl( U08 control ) { - fpgaActuatorSetPoints.fgpaNewCP2Control &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) - fpgaActuatorSetPoints.fgpaNewCP2Control |= control; + fpgaActuatorSetPoints.fpgaNewCP2Control &= FPGA_CONC_PUMP_PARK_COMMAND; // preserve msb (park command bit) + fpgaActuatorSetPoints.fpgaNewCP2Control |= control; } /*********************************************************************//** * @brief + * The getFPGABicarbPumpControlStatus function gets the DVT concentrate pump 2 + * (bicarb pump) control mode. + * bit 7: Park (set in different function) + * bit 6: nSleep + * bit 5: nReset + * bit 4: nEnable + * bit 3: Direction (1=Fwd, 0=Rev) + * bit 0-2: Microstepping resolution + * @details Inputs: none + * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control + * @return Bicarb pump control status bit + *************************************************************************/ +U08 getFPGABicarbPumpControlStatus( void ) +{ + return fpgaActuatorSetPoints.fpgaNewCP2Control; +} + +/*********************************************************************//** + * @brief * The setFPGAAcidPumpParkCmd function sets the DVT concentrate pump 1 * (acid pump) park command bit. * bit 7: Park command bit @@ -1341,13 +1379,13 @@ * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fgpaNewCP2Control + * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control * @param Park command bit set * @return none *************************************************************************/ void setFPGABicarbPumpParkCmd( void ) { - fpgaActuatorSetPoints.fgpaNewCP2Control |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands + fpgaActuatorSetPoints.fpgaNewCP2Control |= FPGA_CONC_PUMP_PARK_COMMAND; // this bit must be cleared after next transmit to prevent continuous park commands } /*********************************************************************//** @@ -2707,7 +2745,7 @@ *************************************************************************/ BOOL checkFPGACommFailure( void ) { - BOOL status = false; + BOOL status = FALSE; if ( getMSTimerCount() > MIN_POWER_ON_TIME_FOR_COMM_FAILS ) { @@ -2734,7 +2772,7 @@ *************************************************************************/ static BOOL checkFPGAFEOEFailure( void ) { - BOOL status = false; + BOOL status = FALSE; BOOL FPGAFEOEError = getSci2FEOEError(); if ( TRUE == FPGAFEOEError)