Index: firmware/App/Controllers/BloodLeak.h =================================================================== diff -u -r20d0c02f453b6dae1884fb1b5ba542053852ffc1 -rfb714597ad515d3774d69b94808f065788504724 --- firmware/App/Controllers/BloodLeak.h (.../BloodLeak.h) (revision 20d0c02f453b6dae1884fb1b5ba542053852ffc1) +++ firmware/App/Controllers/BloodLeak.h (.../BloodLeak.h) (revision fb714597ad515d3774d69b94808f065788504724) @@ -14,67 +14,83 @@ * @date (original) 18-Mar-2021 * ***************************************************************************/ - -#ifndef __BLOOD_LEAK_H__ -#define __BLOOD_LEAK_H__ - -#include "HDCommon.h" - -/** - * @defgroup BloodLeak BloodLeak - * @brief Blood Leak detector monitor module. Monitors the - * blood leak detector. + +#ifndef __BLOOD_LEAK_H__ +#define __BLOOD_LEAK_H__ + +#include "HDCommon.h" + +/** + * @defgroup BloodLeak BloodLeak + * @brief Blood Leak detector monitor module. Monitors the + * blood leak detector. * * INTROTEK - Blood Component Detector Part No. 105-0002 - * - * @addtogroup BloodLeak - * @{ - */ - -// ********** public definitions ********** - -/// Enumeration of blood leak detector status. -typedef enum BloodLeakDetectorStatus -{ - BLOOD_LEAK_DETECTED = 0, ///< Blood leak detector senses blood. - BLOOD_LEAK_NOT_DETECTED, ///< Blood leak detector does not sense any blood. - NUM_OF_BLOOD_LEAK_STATUS ///< Number of blood leak detector status. -} BLOOD_LEAK_STATUS_T; + * + * @addtogroup BloodLeak + * @{ + */ +// ********** public definitions ********** + +/// Enumeration of blood leak detector status. +typedef enum BloodLeakDetectorStatus +{ + BLOOD_LEAK_DETECTED = 0, ///< Blood leak detector senses blood. + BLOOD_LEAK_NOT_DETECTED, ///< Blood leak detector does not sense any blood. + NUM_OF_BLOOD_LEAK_STATUS ///< Number of blood leak detector status. +} BLOOD_LEAK_STATUS_T; + /// Blood leak detector data publish typedef struct { U32 bloodLeakStatus; ///< Blood leak detector status. U32 bloodLeakState; ///< Blood leak detector state. U32 bloodLeakPersistentCounter; ///< Blood leak detector persistent counter. U32 bloodLeakSerialCommState; ///< Blood leak detector serial communication state. + U32 bloodLeakIntensity; ///< Blood leak detector intensity. + U32 bloodLeakDetect; ///< Blood leak detector detect. + F32 bloodLeakIntensityMovingAvg; ///< Blood leak detector intensity moving average. + U32 bloodLeakTimeSinceZeroMS; ///< Blood leak detector time since last zero in milliseconds. + U32 driftInRangeStatus; ///< Blood leak detector drift in range status. + U32 driftUpperRangeStatus; ///< Blood leak detector drift upper range status. } BLOOD_LEAK_DATA_T; -// ********** public function prototypes ********** - +// ********** public function prototypes ********** + void initBloodLeak( void ); void execBloodLeak( void ); void execBloodLeakEmbModeCommand( void ); BOOL zeroBloodLeak( void ); -void zeroBloodLeakReset (void ); +void zeroBloodLeakReset( void ); BOOL hasBloodLeakZeroSequenceFailed( void ); +BOOL isBloodLeakZeroingNeeded( void ); void exitBloodLeakNormalState( void ); SELF_TEST_STATUS_T execBloodLeakSelfTest( void ); - + BLOOD_LEAK_STATUS_T getBloodLeakStatus( void ); SELF_TEST_STATUS_T getBloodLeakSelfTestStatus( void ); -BOOL testSetBloodLeakDataPublishIntervalOverride( U32 value ); +BOOL testSetBloodLeakDataPublishIntervalOverride( U32 value ); BOOL testResetBloodLeakDataPublishIntervalOverride( void ); - -BOOL testSetBloodLeakStatusOverride( BLOOD_LEAK_STATUS_T status ); + +BOOL testSetBloodLeakStatusOverride( BLOOD_LEAK_STATUS_T status ); BOOL testResetBloodLeakStatusOverride( void ); BOOL testSetBloodLeak2EmbeddedMode( void ); BOOL testSetBloodLeakEmbeddedModeCommand( U08 command, U16 setPointPayload ); -/**@}*/ - -#endif +BOOL testSetBloodLeakEmbeddedModeInfoOverride( U08 command, U32 value ); +BOOL testResetBloodLeakEmbeddedModeInfoOverride( U08 command ); + +BOOL testSetBloodLeakIntensityMovingAverageOverride( F32 value ); +BOOL testResetBloodLeakIntensityMovingAverageOverride( void ); + +BOOL testSetBloodLeakZeroingIntervalInMinsOverride( BOOL upperRangeInterval, U32 valueMins ); +BOOL testResetBloodLeakZeroingIntervalInMinsOverride( BOOL upperRangeInterval ); + +/**@}*/ + +#endif