Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r4459be59bdc2896b44bcf6cd42d2762190e23c16 -r5eda37efda2d771de4f5cfb509adf05621a290c3 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 4459be59bdc2896b44bcf6cd42d2762190e23c16) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 5eda37efda2d771de4f5cfb509adf05621a290c3) @@ -905,7 +905,7 @@ * next DMA write command response from the FPGA. * @details * Inputs : none - * Outputs : # of expected bytes for next FPGA write command response is set + * Outputs : number of expected bytes for next FPGA write command response is set * @param bytes2Receive number of bytes expected to be transmitted via DMA from the FPGA * @return none *************************************************************************/ @@ -944,7 +944,7 @@ * read command to the FPGA. * @details * Inputs : none - * Outputs : # of bytes for next FPGA read command is set + * Outputs : number of bytes for next FPGA read command is set * @param bytes2Transmit number of bytes to be transmitted via DMA to the FPGA * @return none *************************************************************************/ @@ -983,7 +983,7 @@ * next DMA read command response from the FPGA. * @details * Inputs : none - * Outputs : # of expected bytes for next FPGA read command response is set + * Outputs : number of expected bytes for next FPGA read command response is set * @param bytes2Receive number of expected bytes to be transmitted via DMA from the FPGA * @return none *************************************************************************/ @@ -1312,42 +1312,129 @@ *err = fpgaSensorReadings.accelFaultRegister; } +/*********************************************************************//** + * @brief + * The enableValvesPIDControl function enables PID on valves per given bit + * mask. + * @details + * Inputs : none + * Outputs : fpgaActuatorSetPoints + * @param enableBits bit mask indicating which valves to enable + * @return none + *************************************************************************/ void enableValvesPIDControl( U16 enableBits ) { - fpgaActuatorSetPoints.fpgaPIDControl = 0x55; + fpgaActuatorSetPoints.fpgaPIDControl = 0x55; // TODO - this looks hard coded - ignoring param - fix this } +/*********************************************************************//** + * @brief + * The setDialyzerInletValvePosition function sets the target position for + * the dialyzer inlet valve. + * @details + * Inputs : none + * Outputs : fpgaActuatorSetPoints + * @param setPoint target position for the dialyzer inlet valve + * @return none + *************************************************************************/ void setDialyzerInletValvePosition( S16 setPoint ) { fpgaActuatorSetPoints.VDiSetPoint = setPoint; } + +/*********************************************************************//** + * @brief + * The getDialyzerInletValvePosition function gets the last read position + * for the dialyzer inlet valve. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @return last read position of the dialyzer inlet valve + *************************************************************************/ S16 getDialyzerInletValvePosition( void ) { return fpgaSensorReadings.VDiPosition; } +/*********************************************************************//** + * @brief + * The setDialyzerOutletValvePosition function sets the target position for + * the dialyzer outlet valve. + * @details + * Inputs : none + * Outputs : fpgaActuatorSetPoints + * @return none + *************************************************************************/ void setDialyzerOutletValvePosition( S16 setPoint ) { fpgaActuatorSetPoints.VDoSetPoint = setPoint; } + +/*********************************************************************//** + * @brief + * The getDialyzerOutletValvePosition function gets the last read position + * for the dialyzer outlet valve. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @return last read position of the dialyzer outlet valve + *************************************************************************/ S16 getDialyzerOutletValvePosition( void ) { return fpgaSensorReadings.VDoPosition; } +/*********************************************************************//** + * @brief + * The setVenousBloodValvePosition function sets the target position for + * the venous blood valve. + * @details + * Inputs : none + * Outputs : fpgaActuatorSetPoints + * @return none + *************************************************************************/ void setVenousBloodValvePosition( S16 setPoint ) { fpgaActuatorSetPoints.VBVSetPoint = setPoint; } + +/*********************************************************************//** + * @brief + * The getVenousBloodValvePoistion function gets the last read position + * for the venous blood valve. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @return last read position of the venous blood valve + *************************************************************************/ S16 getVenousBloodValvePoistion( void ) { return fpgaSensorReadings.VBVPosition; } +/*********************************************************************//** + * @brief + * The setArterialBloodValvePosition function sets the target position for + * the arterial blood valve. + * @details + * Inputs : none + * Outputs : fpgaActuatorSetPoints + * @return none + *************************************************************************/ void setArterialBloodValvePosition( S16 setPoint ) { fpgaActuatorSetPoints.VBASetPoint = setPoint; } + +/*********************************************************************//** + * @brief + * The getArterialBloodValvePoistion function gets the last read position + * for the arterial blood valve. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @return last read position of the arterial blood valve + *************************************************************************/ S16 getArterialBloodValvePoistion( void ) { return fpgaSensorReadings.VBAPosition;