Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -r291d652fcd09b461728962a547d3b08163737d76 -r1920626b448b9ee88ae9fcfb5461067fc92da648 --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 291d652fcd09b461728962a547d3b08163737d76) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 1920626b448b9ee88ae9fcfb5461067fc92da648) @@ -52,6 +52,21 @@ #define SYRINGE_PUMP_CONTROL_FORWARD_DIR 0x00 ///< Syringe pump control register bit mask for forward direction. #define SYRINGE_PUMP_CONTROL_32TH_STEP 0x03 ///< Syringe pump control register bits for 1/32 micro-stepping mode. +// Bit definitions for NIBP control register +#define FPGA_NIBP_CMD_MASK 0x0F ///< Bit mask for NIBP command bits [3:0]. +#define FPGA_NIBP_CMD_RDY 0x10 ///< NIBP command ready pulse bit. +#define FPGA_NIBP_PUMP_ON 0x20 ///< NIBP pump manual control enable bit. +#define FPGA_NIBP_CTRL_VALVE_CLOSE 0x40 ///< NIBP control valve close bit. +#define FPGA_NIBP_DUMP_VALVE_CLOSE 0x80 ///< NIBP dump valve close bit. + +// Bit definitions for NIBP response register +#define FPGA_NIBP_RESP_VALID 0x01 ///< Indicates valid NIBP response available. +#define FPGA_NIBP_MEASURING 0x02 ///< Indicates NIBP measurement in progress. +#define FPGA_NIBP_RESP_CODE_MASK 0x3C ///< Bit mask for NIBP response code bits [5:2]. +#define FPGA_NIBP_RESP_CODE_SHIFT 2 ///< Shift for NIBP response code bits. +#define FPGA_NIBP_MODULE_ERROR 0x40 ///< Indicates NIBP module command processing error. +#define FPGA_NIBP_MODULE_BUSY 0x80 ///< Indicates NIBP module busy processing command. + /// Baro sensor manufacturing coefficients typedef struct { @@ -65,6 +80,22 @@ 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 information. + FPGA_NIBP_CMD_SET_INITIAL_INFLATE = 0x02, ///< Set initial cuff 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 active BP measurement. + FPGA_NIBP_CMD_GET_CUFF_PRESSURE = 0x06, ///< Read cuff pressure. + FPGA_NIBP_CMD_GET_BP_DATA = 0x07, ///< Read BP measurement data. + FPGA_NIBP_CMD_SET_SLEEP_MODE = 0x08, ///< Set NIBP module sleep mode. + FPGA_NIBP_CMD_CONTROL_PNEUMATICS = 0x09, ///< Control pneumatic outputs. + FPGA_NIBP_CMD_RESET = 0x0A ///< Reset NIBP module. +} FPGA_NIBP_CMD_T; + // ********** public function prototypes ********** void initFpgaTD( void ); @@ -128,7 +159,6 @@ U16 getH12AirPumpMotorRPM( void ); void setH12AirPumpMotorPowerLevel( U08 power ); -void setH12AirPumpMotorPWMCntTime( U16 tenNS ); void setH19Control( U08 controlBits ); U08 getH19Control( void ); @@ -152,6 +182,25 @@ U32 getFPGAEjectorRetractOpticalSensor( void ); U32 getFPGAEjectorEngageOpticalSensor( void ); +void setNIBPCommand( FPGA_NIBP_CMD_T command ); +void setNIBPInflatePressure( U16 pressure ); +U08 getNIBPControl( void ); +void setNIBPControl( U08 control ); + +FPGA_NIBP_CMD_T getNIBPLastCommand( void ); + +BOOL isNIBPCommandReady( void ); +BOOL isNIBPResponseValid( void ); +BOOL isNIBPMeasuring( void ); +BOOL isNIBPModuleError( void ); +BOOL isNIBPModuleBusy( void ); + +U08 getNIBPResponseCode( void ); +S16 getNIBPCuffPressure( void ); +U16 getNIBPSystolicPressure( void ); +U16 getNIBPDiastolicPressure( void ); +U16 getNIBPHeartRate( void ); + /**@}*/ #endif