Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r0ca78c9f9a1abfdbae54d38063898cd5d4ecca81 -r7f22307635cf6c73dca1a2cc86c5f57ae62dde4d --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 0ca78c9f9a1abfdbae54d38063898cd5d4ecca81) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 7f22307635cf6c73dca1a2cc86c5f57ae62dde4d) @@ -71,6 +71,9 @@ #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. +#define FPGA_NIBP_CMD_MASK 0x0F ///< Bit mask for NIBP command bits +#define FPGA_NIBP_CMD_RDY 0x10 ///< NIBP command ready pulse bit + /// 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 | @@ -165,6 +168,12 @@ U32 baroTemperature; ///< Reg 372. Baro temperature value in counts. U08 baroReadCount; ///< Reg 376. Baro read count. U08 baroErrorCount; ///< Reg 377. Baro error count. + U08 notUsed; ///< Reg 378. + U08 sPumpDacRdByte2; ///< Reg 379. + U08 sPumpDacRdByte3; ///< Reg 380. + U08 sPumpDacRdByte4; ///< Reg 381. + U08 sPumpDacRdByte5; ///< Reg 382. + U08 sPumpDacRdByte6; ///< Reg 383. U08 nibpCtlStatus; ///< Reg 384. NIBP control status register. U08 nibpStatusResp; ///< Reg 385. NIBP response status register. S16 cuffPressure; ///< Reg 386. NIBP cuff pressure in mmHg. @@ -197,7 +206,7 @@ U08 alarmControl; ///< Reg 32. Alarm audio control register. U08 syrPumpControl; ///< Reg 33. Syringe pump control register. U32 syrPumpSpeed; ///< Reg 34. Syringe pump time between step toggle (1/2 step period). - U16 syrPumpDACData; ///< Reg 38. Syringe pump DAC data (12 bits). + U16 syrPumpDACData; ///< Reg 38. Syringe pump DAC data U16 syrPumpDACControl; ///< Reg 40. Syringe pump ADC and DAC control register. U08 nibpCtl; ///< Reg 41. NIBP control register. U16 nibpInflate; ///< Reg 42. NIBP inflate pressure register. @@ -1360,127 +1369,31 @@ fpgaActuatorSetPoints.nibpInflate = pressure; } -/*********************************************************************//** -* The getNIBPControl function returns the FPGA NIBP control register. -* @details \b Inputs: fpgaActuatorSetPoints.nibpCtl -* @details \b Outputs: none -* @return FPGA NIBP control register value. -*************************************************************************/ -U08 getNIBPControl( void ) +/********************************************************************//** + * @brief + * The getNIBPControlStatus function returns the FPGA NIBP control status. + * @details \b Inputs: fpgaSensorReadings.nibpCtlStatus + * @details \b Outputs: none + * @return FPGA NIBP control status register. + ***************************************************************************/ +U08 getNIBPControlStatus( void ) { - return fpgaActuatorSetPoints.nibpCtl; + return fpgaSensorReadings.nibpCtlStatus; } /*********************************************************************//** -* The setNIBPControl function sets the FPGA NIBP control register. -* @details \b Inputs: control -* @details \b Outputs: fpgaActuatorSetPoints.nibpCtl -* @return none -*************************************************************************/ -void setNIBPControl( U08 control ) + * @brief + * The getNIBPStatusResponse function returns the FPGA NIBP response status. + * @details \b Inputs: fpgaSensorReadings.nibpStatusResp + * @details \b Outputs: none + * @return FPGA NIBP response status register. + ***************************************************************************/ +U08 getNIBPStatusResponse( void ) { - fpgaActuatorSetPoints.nibpCtl = control; + return fpgaSensorReadings.nibpStatusResp; } /*********************************************************************//** -* The getNIBPLastCommand function returns the last FPGA processed NIBP -* command. -* @details \b Inputs: fpgaSensorReadings.nibpCtlStatus -* @details \b Outputs: none -* @return FPGA NIBP command. -*************************************************************************/ -FPGA_NIBP_CMD_T getNIBPLastCommand( void ) -{ - return ( FPGA_NIBP_CMD_T )( fpgaSensorReadings.nibpCtlStatus & FPGA_NIBP_CMD_MASK ); -} - -/*********************************************************************//** -* The isNIBPCommandReady function returns the FPGA NIBP command ready -* status. -* @details \b Inputs: fpgaSensorReadings.nibpCtlStatus -* @details \b Outputs: none -* @return TRUE if command ready is set, FALSE otherwise. -*************************************************************************/ -BOOL isNIBPCommandReady( void ) -{ - BOOL result = FALSE; - result = ( ( fpgaSensorReadings.nibpCtlStatus & FPGA_NIBP_CMD_RDY ) != 0 ) ? TRUE : FALSE; - - return result; -} - -/*********************************************************************//** -* The isNIBPResponseValid function returns the FPGA NIBP response valid -* status bit. -* @details \b Inputs: fpgaSensorReadings.nibpStatusResp -* @details \b Outputs: none -* @return TRUE if NIBP response is valid, FALSE otherwise. -*************************************************************************/ -BOOL isNIBPResponseValid( void ) -{ - BOOL result = FALSE; - result = ( ( fpgaSensorReadings.nibpStatusResp & FPGA_NIBP_RESP_VALID ) != 0 ) ? TRUE : FALSE; - - return result; -} - -/*********************************************************************//** -* The isNIBPMeasuring function returns the FPGA NIBP measurement active -* status bit. -* @details \b Inputs: fpgaSensorReadings.nibpStatusResp -* @details \b Outputs: none -* @return TRUE if NIBP measurement is active, FALSE otherwise. -*************************************************************************/ -BOOL isNIBPMeasuring( void ) -{ - BOOL result = FALSE; - result = ( ( fpgaSensorReadings.nibpStatusResp & FPGA_NIBP_MEASURING ) != 0 ) ? TRUE : FALSE; - - return result; -} - -/*********************************************************************//** -* The getNIBPResponseCode function returns the FPGA NIBP response code. -* @details \b Inputs: fpgaSensorReadings.nibpStatusResp -* @details \b Outputs: none -* @return FPGA NIBP response code. -*************************************************************************/ -U08 getNIBPResponseCode( void ) -{ - return( ( fpgaSensorReadings.nibpStatusResp & FPGA_NIBP_RESP_CODE_MASK ) >> FPGA_NIBP_RESP_CODE_SHIFT ); -} - -/*********************************************************************//** -* The isNIBPModuleError function returns the FPGA NIBP module error -* status bit. -* @details \b Inputs: fpgaSensorReadings.nibpStatusResp -* @details \b Outputs: none -* @return TRUE if module error exists, FALSE otherwise. -*************************************************************************/ -BOOL isNIBPModuleError( void ) -{ - BOOL result = FALSE; - result = ( ( fpgaSensorReadings.nibpStatusResp & FPGA_NIBP_MODULE_ERROR ) != 0 ) ? TRUE : FALSE; - - return result; -} - -/*********************************************************************//** -* The isNIBPModuleBusy function returns the FPGA NIBP module busy -* status bit. -* @details \b Inputs: fpgaSensorReadings.nibpStatusResp -* @details \b Outputs: none -* @return TRUE if module busy exists, FALSE otherwise. -*************************************************************************/ -BOOL isNIBPModuleBusy( void ) -{ - BOOL result = FALSE; - result = ( ( fpgaSensorReadings.nibpStatusResp & FPGA_NIBP_MODULE_BUSY ) != 0 ) ? TRUE : FALSE; - - return result; -} - -/*********************************************************************//** * The getNIBPCuffPressure function returns the FPGA NIBP cuff pressure. * @details \b Inputs: fpgaSensorReadings.cuffPressure * @details \b Outputs: none