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