/************************************************************************** * * Copyright (c) 2025-2026 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 BloodLeakDriver.c * * @author (last) Dara Navaei * @date (last) 10-Sep-2024 * * @author (original) Dara Navaei * @date (original) 10-Sep-2024 * ***************************************************************************/ #ifndef __BLOODLEAKDRIVER_H__ #define __BLOODLEAKDRIVER_H__ #include "DDCommon.h" /** * @defgroup BloodLeakDriver BloodLeakDriver * @brief Blood Leak detector driver module. Drives the * blood leak detector. * * INTROTEK - Blood Component Detector Part No. 105-0002 * * @addtogroup BloodLeakDriver * @{ */ // ********** public definitions ********** #pragma pack(push,1) /// 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; #pragma pack(pop) // ********** public function prototypes ********** void initBloodLeakDriver( void ); void execBloodLeakEmbModeCommand( void ); // Embedded mode command queue void enqueueEmbModeCmd( U08 cmd ); U08 dequeueEmbModeCmd( void ); U32 getAvailableEmbModeQueueCount( void ); BOOL isEmbModeCmdQueueEmpty( void ); void enqueueInfoEmbModeCmds( void ); // Embedded mode info/response void resetEmbModeCmdRqstCount( U08 cmd ); void resetEmbModeCmdRespConsumedFlag( U08 cmd ); U32 getEmbModeInfoValue( U08 cmd ); void processReceivedEmbModeChar( U08 data ); BOOL testSetBloodLeak2EmbeddedMode( MESSAGE_T *message ); BOOL testSetBloodLeakEmbeddedModeCommand( MESSAGE_T *message ); BOOL testBloodLeakEmbeddedModeInfoOverride( MESSAGE_T *message ); /**@}*/ #endif