Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -rcf22584fb68bb29311d81d1e5ad79f8cf064b8fb -r5eda216f634a74512a5bc11b0984676567512d80 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision cf22584fb68bb29311d81d1e5ad79f8cf064b8fb) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 5eda216f634a74512a5bc11b0984676567512d80) @@ -114,7 +114,7 @@ S16 h2Temperature; ///< Reg 274. H2 raw temperature data. U08 h2ReadCount; ///< Reg 276. H2 read count. U08 h2ErrorCount; ///< Reg 277. H2 error count. - U16 reserved1; ///< Reg 278. Reserved and available for future use. + S16 h1MaxEncPosition; ///< Reg 278. H1 max encoder position. S16 h1EncPosition; ///< Reg 280. H1 encoder position (1000 steps/rev). U16 h1Status; ///< Reg 282. H1 status. U32 reserved2; ///< Reg 284. Reserved and available for future use. @@ -124,8 +124,7 @@ S16 h4SpeedFromHall; ///< Reg 294. H4 measured speed from hall sensor(s). U16 h19Status; ///< Reg 296. H19 status. S16 h19EncPosition; ///< Reg 298. H19 encoder position (1000 steps/rev). - U08 reserved4; ///< Reg 300. H19 status. - U08 h4Status; ///< Reg 301. H4 status. + S16 h19MaxEncPosition; ///< Reg 300. H19 max encoder position. U16 GPIOReg; ///< Reg 302. GPIO register. U08 HEPStatus; ///< Reg 304. HEP status register. U08 HEPAdcReadCount; ///< Reg 305. HEP ADC read counter. @@ -151,7 +150,7 @@ S16 ACPower3Voltage; ///< Reg 342. AC power voltage - 3. S16 h4RotorHallCount; ///< Reg 344. H4 rotor count from hall sensor. U08 h6RotorStatus; ///< Reg 346. H6 rotor status. - U08 reserved5; ///< + U08 reserved5; ///< Reg 347. Reserved register. U16 h12Speed; ///< Reg 348. H12 speed (air pump in RPM). U16 rotorRevsCounter; ///< Reg 350. Rotor revs counter U16 baroManufactInfo; ///< Reg 352. Baro sensor manufacturing information. @@ -1003,7 +1002,9 @@ * 0=reset (set to 1 after power up) * Sleep: bit 6 (active low) * 0=sleep mode - * Reserved: bit 7 + * Homing: bit 7 (set 1 to enable homing) + * 0=disable homing + * 1=enable homing * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.h19Control * @param controlBits The control bits to apply to the venous pinch valve. @@ -1069,6 +1070,19 @@ /*********************************************************************//** * @brief + * The getH19MaxEncPosition function reads max encoder position of the venous + * pinch valve prior to losing the shaft. + * @details \b Inputs: fpgaSensorReadings.h19MaxEncPosition + * @details \b Outputs: none + * @return Max encoder position of the venous pinch valve + *************************************************************************/ +S16 getH19MaxEncPosition( void ) +{ + return fpgaSensorReadings.h19MaxEncPosition; +} + +/*********************************************************************//** + * @brief * The setH1Control function sets the control bits for the arterial pinch valve. * Microstep setting: bits 0..2: * 0=full step (100% torque) @@ -1089,7 +1103,9 @@ * 0=reset (set to 1 after power up) * Sleep: bit 6 (active low) * 0=sleep mode - * Reserved: bit 7 + * Homing: bit 7 (set 1 to enable homing) + * 0=disable homing + * 1=enable homing * @details \b Inputs: none * @details \b Outputs: fpgaActuatorSetPoints.h1Control * @param controlBits The control bits to apply to the arterial pinch valve. @@ -1154,6 +1170,19 @@ /*********************************************************************//** * @brief + * The getH1MaxEncPosition function reads max encoder position of the arterial + * pinch valve prior to losing its shaft. + * @details \b Inputs: fpgaSensorReadings.h1MaxEncPosition + * @details \b Outputs: none + * @return Max encoder value of the arterial pinch valve + *************************************************************************/ +S16 getH1MaxEncPosition( void ) +{ + return fpgaSensorReadings.h1MaxEncPosition; +} + +/*********************************************************************//** + * @brief * The getFPGABoardTemperature function reads the FPGA board temperature. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none