Index: firmware/App/Controllers/BPModule.c =================================================================== diff -u -r9c4cdc42d3bcef089a9627b206496cb23bc3f643 -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Controllers/BPModule.c (.../BPModule.c) (revision 9c4cdc42d3bcef089a9627b206496cb23bc3f643) +++ firmware/App/Controllers/BPModule.c (.../BPModule.c) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -300,7 +300,7 @@ * The bpModuleHandleVitalsRequest function handles the UI blood * pressure measurement request. * @details \b Message \b Sent: MSG_ID_TD_BLOOD_PRESSURE_READING -* @details \b Inputs: message containing blood pressure reques +* @details \b Inputs: message containing blood pressure reques * @details \b Outputs: pendingVitalsRequest * @return TRUE if request is accepted, FALSE if rejected. *************************************************************************/ Index: firmware/App/Controllers/BPModule.h =================================================================== diff -u -r5ad0389d9abad0f0a523fc44ae6c00ca8b12f313 -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Controllers/BPModule.h (.../BPModule.h) (revision 5ad0389d9abad0f0a523fc44ae6c00ca8b12f313) +++ firmware/App/Controllers/BPModule.h (.../BPModule.h) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -39,6 +39,7 @@ void abortBPReading( void ); BOOL bpModuleHandleVitalsRequest( MESSAGE_T *message ); + /**@}*/ #endif Index: firmware/App/Drivers/BPDriver.c =================================================================== diff -u -ra3f8bc317c09b4641bb9f561a9b64a69993cd523 -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Drivers/BPDriver.c (.../BPDriver.c) (revision a3f8bc317c09b4641bb9f561a9b64a69993cd523) +++ firmware/App/Drivers/BPDriver.c (.../BPDriver.c) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -31,7 +31,7 @@ #define BP_MODULE_ERROR_MASK 0x40 ///< Blood pressure module error mask. #define BP_MODULE_BUSY_MASK 0x80 ///< Blood Pressure module busy mask #define BP_RESP_CODE_BPDATA 0x07 ///< Blood pressure response code indicating BP data is available. -#define BP_MODULE_BUSY_CLEAR 0 +#define BP_MODULE_BUSY_CLEAR 0 ///< Blood pressure module buy clear /// Blood pressure driver states. typedef enum @@ -51,6 +51,8 @@ static BOOL requestAdultBPMeasurement; ///< Request adult BP measurement static BOOL requestPedsBPMeasurement; ///< Request pediatric BP measurement static BOOL requestAbortBPMeasurement; ///< Request abort BP measurement +static BOOL bpCuffConnected; ///< Blood pressure cuff connection +static BOOL bpResultsAvailable; ///< Blood pressure results available // ********** private function prototypes ********** @@ -74,6 +76,8 @@ requestAdultBPMeasurement = FALSE; requestPedsBPMeasurement = FALSE; requestAbortBPMeasurement = FALSE; + bpCuffConnected = FALSE; + bpResultsAvailable = FALSE; bpResults.systolic = 0; bpResults.diastolic = 0; bpResults.heartRate = 0; @@ -97,11 +101,13 @@ * machine. * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT * @details \b Inputs: bpDriverState - * @details \b Outputs: bpDriverState, bpResults + * @details \b Outputs: bpDriverState * @return none ***************************************************************************/ void execBPDriver( void ) { + bpCuffConnected = ( getNIBPControlStatus() != 0 ); + switch ( bpDriverState ) { case BP_DRIVER_IDLE_STATE: @@ -141,21 +147,21 @@ requestAdultBPMeasurement = FALSE; bpMeasurementReady = FALSE; bpDriverError = FALSE; - setNIBPCommand( FPGA_NIBP_CMD_START_BP ); + setNIBPCommand( (U08)BP_CMD_START_BP ); nextState = BP_DRIVER_MEASURE_STATE; } else if ( TRUE == requestPedsBPMeasurement ) { requestPedsBPMeasurement = FALSE; bpMeasurementReady = FALSE; bpDriverError = FALSE; - setNIBPCommand( FPGA_NIBP_CMD_START_PEDS_BP ); + setNIBPCommand( (U08)BP_CMD_START_PEDS_BP ); nextState = BP_DRIVER_MEASURE_STATE; } else if ( TRUE == requestAbortBPMeasurement ) { requestAbortBPMeasurement = FALSE; - setNIBPCommand( FPGA_NIBP_CMD_ABORT_BP ); + setNIBPCommand( (U08)BP_CMD_ABORT_BP ); } return nextState; @@ -178,7 +184,7 @@ // Verify BP measurement data is available if ( BP_RESP_CODE_BPDATA == getBPResponseCode() ) { - setNIBPCommand( FPGA_NIBP_CMD_GET_BP_DATA ); + setNIBPCommand( (U08)BP_CMD_GET_BP_DATA ); nextState = BP_DRIVER_GET_DATA_STATE; } // Check whether BP module error occurred @@ -198,7 +204,7 @@ * The handleBPDriverGetDataState function retrieves blood pressure * measurement results. * @details \b Inputs: getNIBPStatusResponse -* @details \b Outputs: bpResults +* @details \b Outputs: bpMeasurementReady * @return next BP driver state ***************************************************************************/ static BP_DRIVER_STATE_T handleBPDriverGetDataState( void ) @@ -260,8 +266,8 @@ * @brief * The isBPMeasurementReady function returns the blood pressure * measurement ready status - * @details \b Inputs: bpMeasurementReady - * @details \b Outputs: none + * @details \b Inputs: none + * @details \b Outputs: bpMeasurementReady * @return TRUE if measurement ready, FALSE otherwise. ***************************************************************************/ BOOL isBPMeasurementReady( void ) @@ -273,8 +279,8 @@ * @brief * The hasBPDriverError function returns the blood pressure driver * error status. - * @details \b Inputs: bpDriverError - * @details \b Outputs: none + * @details \b Inputs: none + * @details \b Outputs: bpDriverError * @return TRUE if module error exists, FALSE otherwise. ***************************************************************************/ BOOL hasBPDriverError( void ) @@ -284,6 +290,19 @@ /*********************************************************************//** * @brief + * The hasBPDriverError function returns the blood pressure driver + * error status. + * @details \b Inputs: none + * @details \b Outputs: bpCuffConnected + * @return TRUE if module error exists, FALSE otherwise. + ***************************************************************************/ +BOOL isBPCuffConnected( void ) +{ + return bpCuffConnected; +} + +/*********************************************************************//** + * @brief * The getBPResults function returns the latest BP measurement results. * @note * This function shall only be called from the GeneralTask context to Index: firmware/App/Drivers/BPDriver.h =================================================================== diff -u -r2e3f8b77a9ffcf6e19152c0475d33def40d93fb1 -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Drivers/BPDriver.h (.../BPDriver.h) (revision 2e3f8b77a9ffcf6e19152c0475d33def40d93fb1) +++ firmware/App/Drivers/BPDriver.h (.../BPDriver.h) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -33,12 +33,28 @@ // ********** public definitions ********** +/// BP cuff command definitions +typedef enum +{ + BP_CMD_IDLE = 0x00, ///< No command. + BP_CMD_GET_MODULE_DATA = 0x01, ///< Get NIBP module data. + BP_CMD_SET_INITIAL_INFLATE = 0x02, ///< Set initial inflate pressure. + BP_CMD_START_BP = 0x03, ///< Start adult BP measurement. + BP_CMD_START_PEDS_BP = 0x04, ///< Start pediatric BP measurement. + BP_CMD_ABORT_BP = 0x05, ///< Abort BP measurement. + BP_CMD_GET_CUFF_PRESSURE = 0x06, ///< Get cuff pressure. + BP_CMD_GET_BP_DATA = 0x07, ///< Get BP data. + BP_CMD_SET_SLEEP_MODE = 0x08, ///< Set sleep mode. + BP_CMD_CONTROL_PNEUMATICS = 0x09, ///< Control pneumatics. + BP_CMD_RESET = 0x0A ///< Reset NIBP module. +} BP_CMD_T; + /// Blood pressure measurement results. typedef struct { - U16 systolic; ///< Systolic blood pressure in mmHg. - U16 diastolic; ///< Diastolic blood pressure in mmHg. - U16 heartRate; ///< Heart rate in BPM. + U16 systolic; ///< Systolic blood pressure in mmHg. + U16 diastolic; ///< Diastolic blood pressure in mmHg. + U16 heartRate; ///< Heart rate in BPM. } BP_RESULTS_T; // ********** public function prototypes ********** @@ -52,6 +68,7 @@ BOOL isBPMeasurementReady( void ); BOOL hasBPDriverError( void ); +BOOL isBPCuffConnected( void ); BOOL getBPResults( BP_RESULTS_T *results ); /**@}*/ Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r0d3d179b4a4b632d8a0c2a579559b6e9541a031c -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 0d3d179b4a4b632d8a0c2a579559b6e9541a031c) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -1363,7 +1363,7 @@ * @details \b Outputs: fpgaActuatorSetPoints.nibpCtl * @return none *************************************************************************/ -void setNIBPCommand( FPGA_NIBP_CMD_T command ) +void setNIBPCommand( U08 command ) { fpgaActuatorSetPoints.nibpCtl &= ~FPGA_NIBP_CMD_MASK; fpgaActuatorSetPoints.nibpCtl |= ( (U16)command & FPGA_NIBP_CMD_MASK ); Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -rd8321750d630eb1826d43f4fc9e4adf8ff4b07b0 -re36419ec3d1b64f3831b631d57f30ce4018646c5 --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision d8321750d630eb1826d43f4fc9e4adf8ff4b07b0) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision e36419ec3d1b64f3831b631d57f30ce4018646c5) @@ -65,22 +65,6 @@ U16 baroPromCRC; ///< Reg 366. Baro prom CRC. } BARO_PRES_SENSOR_MFG_T; -/// FPGA NIBP command definitions -typedef enum -{ - FPGA_NIBP_CMD_IDLE = 0x00, ///< No command. - FPGA_NIBP_CMD_GET_MODULE_DATA = 0x01, ///< Get NIBP module data. - FPGA_NIBP_CMD_SET_INITIAL_INFLATE = 0x02, ///< Set initial inflate pressure. - FPGA_NIBP_CMD_START_BP = 0x03, ///< Start adult BP measurement. - FPGA_NIBP_CMD_START_PEDS_BP = 0x04, ///< Start pediatric BP measurement. - FPGA_NIBP_CMD_ABORT_BP = 0x05, ///< Abort BP measurement. - FPGA_NIBP_CMD_GET_CUFF_PRESSURE = 0x06, ///< Get cuff pressure. - FPGA_NIBP_CMD_GET_BP_DATA = 0x07, ///< Get BP data. - FPGA_NIBP_CMD_SET_SLEEP_MODE = 0x08, ///< Set sleep mode. - FPGA_NIBP_CMD_CONTROL_PNEUMATICS = 0x09, ///< Control pneumatics. - FPGA_NIBP_CMD_RESET = 0x0A ///< Reset NIBP module. -} FPGA_NIBP_CMD_T; - // ********** public function prototypes ********** void initFpgaTD( void ); @@ -168,7 +152,7 @@ U32 getFPGAEjectorRetractOpticalSensor( void ); U32 getFPGAEjectorEngageOpticalSensor( void ); -void setNIBPCommand( FPGA_NIBP_CMD_T command ); +void setNIBPCommand( U08 command ); void setNIBPInflatePressure( U16 pressure ); U08 getNIBPControlStatus( void ); U08 getNIBPStatusResponse( void );