Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r52e1d4487a69a1ef0475321084527c0ba86c0892 -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 52e1d4487a69a1ef0475321084527c0ba86c0892) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) @@ -68,6 +68,19 @@ #define FPGA_H18_BUBBLE_STATUS_MASK 0x0002 ///< Bit mask for venous air bubble detector input status. #define FPGA_H18_BUBBLE_SELF_TEST_CMD 0x08 ///< Bit for venous air bubble detector self-test command. +/// Control bits to run syringe pump in reverse direction // TODO - move to syringe pump controller unit when implemented. +static const U08 SYRINGE_PUMP_CONTROL_RUN_REVERSE = SYRINGE_PUMP_CONTROL_SLEEP_OFF | + SYRINGE_PUMP_CONTROL_NOT_RESET | + SYRINGE_PUMP_CONTROL_ENABLE | + SYRINGE_PUMP_CONTROL_REVERSE_DIR | + SYRINGE_PUMP_CONTROL_32TH_STEP; +/// Control bits to run syringe pump in forward direction // TODO - move to syringe pump controller unit when implemented. +static const U08 SYRINGE_PUMP_CONTROL_RUN_FORWARD = SYRINGE_PUMP_CONTROL_SLEEP_OFF | + SYRINGE_PUMP_CONTROL_NOT_RESET | + SYRINGE_PUMP_CONTROL_ENABLE | + SYRINGE_PUMP_CONTROL_FORWARD_DIR | + SYRINGE_PUMP_CONTROL_32TH_STEP; + // FPGA Sensors Record #pragma pack(push,1) @@ -477,7 +490,7 @@ * The setH4SetSpeed function sets the fpga blood pump set speed * to the given speed (0..3000 RPM). * @details \b Inputs: none - * @details \b Outputs: H4 set speed is set + * @details \b Outputs: fpgaActuatorSetPoints * @param rpm the set point for the H4 pump speed (in RPM). * @return none *************************************************************************/ @@ -531,6 +544,41 @@ /*********************************************************************//** * @brief + * The setH5ControlFlags function sets the control flags for the H5 ejector + * stepper motor. + * @note Bit 0 - MS1 (bit 1 of microstepping configuration setting) + * Bit 1 - MS2 (bit 2 of microstepping configuration setting) + * Bit 2 - MS3 (bit 3 of microstepping configuration setting) + * Bit 3 - Direction (0=forward, 1=reverse) + * Bit 4 - Disable (0=enabled, 1=disabled) + * Bit 5 - Reset (0=reset, 1=not reset) + * Bit 6 - Sleep (0=sleep, 1=not sleep) + * Bit 7 - Reserved + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h5Control + * @param ctrl Bit flags for H5 stepper motor control + * @return none + *************************************************************************/ +void setH5ControlFlags( U08 ctrl ) +{ + fpgaActuatorSetPoints.h5Control = ctrl; +} + +/*********************************************************************//** + * @brief + * The setH5StepToggleTime function sets the ejector motor set speed step + * toggle time (in uSec). + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h5SetSpeed + * @return latest arterial pressure reading + *************************************************************************/ +void setH5StepToggleTime( U32 microSeconds ) +{ + fpgaActuatorSetPoints.h5SetSpeed = microSeconds; +} + +/*********************************************************************//** + * @brief * The getH2Pressure function gets the latest arterial pressure reading. * The high 2 bits are status bits: 00=ok, 01=cmd mode, 10=stale data, 11=diag * The low 14 bits are data. Zero is at 1638. Values above are positive,