Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -r8bd1ae47aa13a843aa8abd6321ddc050deacb4a6 -rcd5be724d5a3ba7457e761191d82f278654d7f5c --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 8bd1ae47aa13a843aa8abd6321ddc050deacb4a6) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision cd5be724d5a3ba7457e761191d82f278654d7f5c) @@ -1,47 +1,50 @@ /************************************************************************** * -* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. +* Copyright (c) 2021-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 SyringePump.h * -* @author (last) Dara Navaei -* @date (last) 23-Jul-2021 +* @author (last) Sean Nash +* @date (last) 31-Aug-2023 * * @author (original) Sean Nash * @date (original) 04-Mar-2021 * ***************************************************************************/ - -#ifndef __SYRINGE_PUMP_H__ -#define __SYRINGE_PUMP_H__ - -#include "HDCommon.h" + +#ifndef __SYRINGE_PUMP_H__ +#define __SYRINGE_PUMP_H__ + +#include "HDCommon.h" #include "HDDefs.h" - -/** - * @defgroup SyringePump SyringePump - * @brief Syringe pump controller/monitor module. Controls the syringe pump - * and monitors status. - * - * @addtogroup SyringePump - * @{ - */ - -// ********** public definitions ********** - + +/** + * @defgroup SyringePump SyringePump + * @brief Syringe pump controller/monitor module. Controls the syringe pump + * and monitors status. + * + * @addtogroup SyringePump + * @{ + */ + +// ********** public definitions ********** + +#define SYRINGE_PUMP_PRIME_VOLUME_ML 0.353F ///< Target syringe prime volume (in mL). +#define SYRINGE_PUMP_FILL_VOLUME_OFFSET_ML 0.8F ///< Advised fill volume offset due to HW variance. + /// Enumeration of syringe pump operations. typedef enum SyringePumpOperations { - SYRINGE_PUMP_OP_STOP = 0, - SYRINGE_PUMP_OP_RETRACT = 1, - SYRINGE_PUMP_OP_SEEK = 2, - SYRINGE_PUMP_OP_PRIME = 3, - SYRINGE_PUMP_OP_BOLUS = 4, - SYRINGE_PUMP_OP_CONTINUOUS = 5, - NUM_OF_SYRINGE_PUMP_OPS + SYRINGE_PUMP_OP_STOP = 0, ///< Syringe pump stopped - no operation. + SYRINGE_PUMP_OP_RETRACT = 1, ///< Syringe pump retract operation. Retract to home postion. + SYRINGE_PUMP_OP_SEEK = 2, ///< Syringe pump seek operation. Seek syringe plunger. + SYRINGE_PUMP_OP_PRIME = 3, ///< Syringe pump prime operation. Prime Heparin line. + SYRINGE_PUMP_OP_BOLUS = 4, ///< Syringe pump bolus operation. Deliver bolus volume of Heparin. + SYRINGE_PUMP_OP_CONTINUOUS = 5, ///< Syringe pump continuous dispense operation. Deliver Heparin at set rate. + NUM_OF_SYRINGE_PUMP_OPS = 6 ///< Number of syringe pump operation. } SYRINGE_PUMP_OPERATION_T; /// Payload record structure for the syringe pump operation request message. @@ -68,9 +71,16 @@ U32 syringePumpStatus; } SYRINGE_PUMP_DATA_PAYLOAD_T; -// ********** public function prototypes ********** - -void initSyringePump( void ); +/// Heparin publish data structure +typedef struct +{ + F32 syringePumpVolumeDelivered; ///< Syringe pump volume delivered. + F32 syringePumpVolumeRequired; ///< Syringe pump volume required for therapy. +} SYRINGE_PUMP_VOLUME_DATA_T; + +// ********** public function prototypes ********** + +void initSyringePump( void ); void execSyringePump( void ); SELF_TEST_STATUS_T execSyringePumpSelfTest( void ); @@ -80,28 +90,36 @@ void setHeparinStopped( void ); void setHeparinCompleted( void ); HEPARIN_STATE_T getHeparinState( void ); +void resetPreLoadStatus( void ); void stopSyringePump( void ); BOOL retractSyringePump( void ); +BOOL preloadSyringePlunger( void ); BOOL seekSyringePlunger( void ); BOOL primeSyringePump( void ); -void resetHeparinVolumeDelivered( void ); +BOOL checkForSyringeOcclusion( BOOL stopPump ); BOOL startHeparinBolus( void ); BOOL startHeparinContinuous( void ); -BOOL setSyringePumpDACVref( F32 vRef ); +BOOL setSyringePumpDACVref( void ); +void syringeDetectionRequired( BOOL req ); +void syringePumpVerifyForceSensorDACCalibration( void ); BOOL isSyringeDetected( void ); BOOL isSyringePumpHome( void ); BOOL isSyringePumpStopped( void ); BOOL isSyringePlungerFound( void ); BOOL isSyringeVolumeAdequate( void ); BOOL isSyringePumpPrimed( void ); +BOOL isSyringePumpRunning( void ); +BOOL isSyringePumpPreLoaded( void ); F32 getSyringePumpVolumeDelivered( void ); -BOOL testSetSyringePumpDataPublishIntervalOverride( U32 value ); -BOOL testResetSyringePumpDataPublishIntervalOverride( void ); +BOOL testSetSyringePumpDataPublishIntervalOverride( U32 value ); +BOOL testResetSyringePumpDataPublishIntervalOverride( void ); BOOL testSyringePumpOperationRequest( SYRINGE_PUMP_OP_PAYLOAD_T opParams ); BOOL testSetSyringePumpMeasuredRateOverride( F32 value ); BOOL testResetSyringePumpMeasuredRateOverride( void ); +BOOL testSetHeprinBolusTargetRateOverride( F32 value ); +BOOL testResetHeprinBolusTargetRateOverride( void ); BOOL testSetSyringePumpMeasuredForceOverride( F32 value ); BOOL testResetSyringePumpMeasuredForceOverride( void ); BOOL testSetSyringePumpMeasuredSyringeDetectOverride( F32 value ); @@ -120,7 +138,7 @@ BOOL testResetSyringePumpADCandDACStatus( void ); BOOL testSetSyringePumpADCReadCounter( U32 ctr ); BOOL testResetSyringePumpADCReadCounter( void ); - -/**@}*/ - -#endif + +/**@}*/ + +#endif