Index: firmware/App/Drivers/PeristalticPump.c =================================================================== diff -u -rfe29b840bff79d853e49baf3a78b080e1cf428b6 -r0054e875bf1b9a85d017e6e388b225f51ae6d032 --- firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision fe29b840bff79d853e49baf3a78b080e1cf428b6) +++ firmware/App/Drivers/PeristalticPump.c (.../PeristalticPump.c) (revision 0054e875bf1b9a85d017e6e388b225f51ae6d032) @@ -236,6 +236,19 @@ /*********************************************************************//** * @brief + * The setPeristalticPumpHardStop function stops the pump and holds the torque + * of the pump. + * @details \b Inputs: none + * @details \b Outputs: none + * @return none + *************************************************************************/ +void setPeristalticPumpHardStop( void ) +{ + setH4BrakeAndHoldTorque(); +} + +/*********************************************************************//** + * @brief * The getPeristalticPumpSetSpeed function gets the current pump set * speed in RPM. * @note A negative speed indicates reverse direction. Index: firmware/App/Drivers/PeristalticPump.h =================================================================== diff -u -rfe29b840bff79d853e49baf3a78b080e1cf428b6 -r0054e875bf1b9a85d017e6e388b225f51ae6d032 --- firmware/App/Drivers/PeristalticPump.h (.../PeristalticPump.h) (revision fe29b840bff79d853e49baf3a78b080e1cf428b6) +++ firmware/App/Drivers/PeristalticPump.h (.../PeristalticPump.h) (revision 0054e875bf1b9a85d017e6e388b225f51ae6d032) @@ -51,6 +51,8 @@ BOOL isPeristalticPumpHome( void ); BOOL isPumpHomeInProgress( void ); +void setPeristalticPumpHardStop( void ); + /**@}*/ #endif Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r37294a71c0b3e3ca67ccb10b85536d124d3ef028 -r0054e875bf1b9a85d017e6e388b225f51ae6d032 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 37294a71c0b3e3ca67ccb10b85536d124d3ef028) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 0054e875bf1b9a85d017e6e388b225f51ae6d032) @@ -47,6 +47,7 @@ #define FPGA_H4_ENABLE_BIT_MASK 0x01 ///< Bit mask for enabling the blood pump. #define FPGA_H4_DIRECTION_REV_BIT_MASK 0x02 ///< Bit mask for setting the blood pump direction. +#define FPGA_H4_BRAKE_AND_HOLD_TORQUE 0x05 ///< Bit mask for braking the blood pump while holding the torque of the pump. #define FPGA_H13_OPEN_BIT_MASK 0x01 ///< Bit mask for setting H13 valve position to open. #define FPGA_H20_OPEN_BIT_MASK 0x02 ///< Bit mask for setting H20 valve position to open. @@ -467,7 +468,7 @@ * The setH4Direction function sets the direction for the blood pump * motor to the given direction. * @details \b Inputs: none - * @details \b Outputs: Blood pump motor direction is set (bit 1 of BP control register). + * @details \b Outputs: Blood pump motor direction is set (bit 1 and 2 of BP control register). * 0 - CW (forward) * 1 - CCW (reverse) * @param dir the desired direction for the blood pump motor (fwd or rev) @@ -514,6 +515,19 @@ /*********************************************************************//** * @brief + * The setH4BrakeAndHoldTorque function brakes the pump while holding the torque. + * The pump will not coast. + * @details \b Inputs: none + * @details \b Outputs: Blood pump motor control register + * @return none + *************************************************************************/ +void setH4BrakeAndHoldTorque( void ) +{ + fpgaActuatorSetPoints.h4Control |= FPGA_H4_BRAKE_AND_HOLD_TORQUE; +} + +/*********************************************************************//** + * @brief * The getH6Status function gets the latest blood pump hall sensor status. * Bit 0: 1=Magnet is detected (used for homing in forward direction) * Bit 1: 0=Reverse pump direction detected, 1=Forward pump direction detected Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -r8b819deb3e770c981eed221f63170dd842eedbe3 -r0054e875bf1b9a85d017e6e388b225f51ae6d032 --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 8b819deb3e770c981eed221f63170dd842eedbe3) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 0054e875bf1b9a85d017e6e388b225f51ae6d032) @@ -73,6 +73,7 @@ void setH4Direction( MOTOR_DIR_T dir ); void setH4SetSpeed( U16 rpm ); U16 getH4Period( void ); +void setH4BrakeAndHoldTorque( void ); S16 getH4RotorCount( void ); U08 getH6Status( void );