Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r290504c1c59cf2bbc0a33c259f8be00710cc3cbf -r9b1c4a9731b66bc4aab3fb1d02b0ab608efa9598 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 290504c1c59cf2bbc0a33c259f8be00710cc3cbf) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 9b1c4a9731b66bc4aab3fb1d02b0ab608efa9598) @@ -119,9 +119,10 @@ U16 h1Status; ///< Reg 282. H1 status. U32 reserved2; ///< Reg 284. Reserved and available for future use. U08 h1SPICmdStatus; ///< Reg 285. H1 Magellan SPI command status. - U08 h1MotorStatus; ///< Reg 286. H1 Magellan motor status. + U08 h1ReadCount; ///< Reg 286. H1 read count. U08 h19SPICmdStatus; ///< Reg 287. H19 Magellan SPI command status. - U08 h19MotorStatus; ///< Reg 288. H19 Magellan motor status. + U08 h19ReadCount; ///< Reg 288. H19 read count. + U08 h19ErrorCount; ///< Reg 289. H19 error count S16 h4Period; ///< Reg 290. H4 measured period (10 uSec). S16 h4Torque; ///< Reg 292. H4 measured torque. S16 h4SpeedFromHall; ///< Reg 294. H4 measured speed from hall sensor(s). @@ -153,7 +154,7 @@ U16 h19OutputWord3; ///< Reg 342. H19 Magellan output word 3. S16 h4RotorHallCount; ///< Reg 344. H4 rotor count from hall sensor. U08 h6RotorStatus; ///< Reg 346. H6 rotor status. - U08 reserved5; ///< Reg 347. Reserved register. + U08 h1ErrorCount; ///< Reg 347. H1 error count. U16 h12Speed; ///< Reg 348. H12 speed (air pump in RPM). U16 h4RotorRevsCounter; ///< Reg 350. H4 rotor revs counter U16 baroManufactInfo; ///< Reg 352. Baro sensor manufacturing information. @@ -1599,9 +1600,9 @@ * @param inputWord Input word 1 value. * @return none *************************************************************************/ -void setH1InputWord1( U16 inputWord ) +void setH1InputWord1( U16 inputWord1 ) { - fpgaActuatorSetPoints.h1InputWord1 = inputWord; + fpgaActuatorSetPoints.h1InputWord1 = inputWord1; } /*********************************************************************//** @@ -1612,9 +1613,9 @@ * @param inputWord Input word 2 value. * @return none *************************************************************************/ -void setH1InputWord2( U16 inputWord ) +void setH1InputWord2( U16 inputWord2 ) { - fpgaActuatorSetPoints.h1InputWord2 = inputWord; + fpgaActuatorSetPoints.h1InputWord2 = inputWord2; } /*********************************************************************//** @@ -1625,9 +1626,9 @@ * @param inputWord Input word 3 value. * @return none *************************************************************************/ -void setH1InputWord3( U16 inputWord ) +void setH1InputWord3( U16 inputWord3 ) { - fpgaActuatorSetPoints.h1InputWord3 = inputWord; + fpgaActuatorSetPoints.h1InputWord3 = inputWord3; } /*********************************************************************//** @@ -1658,6 +1659,84 @@ /*********************************************************************//** * @brief + * The setH19CmdHeader function sets the H19 Magellan command header. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param cmdHeader H19 Magellan command header. + * @return none + *************************************************************************/ +void setH19CmdHeader( U16 cmdHeader ) +{ + fpgaActuatorSetPoints.h19CmdHeader = cmdHeader; +} + +/*********************************************************************//** + * @brief + * The setH19InputWord1 function sets H19 Magellan input word 1. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param inputWord Input word 1 value. + * @return none + *************************************************************************/ +void setH19InputWord1( U16 inputWord1 ) +{ + fpgaActuatorSetPoints.h19InputWord1 = inputWord1; +} + +/*********************************************************************//** + * @brief + * The setH19InputWord2 function sets H19 Magellan input word 2. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param inputWord Input word 2 value. + * @return none + *************************************************************************/ +void setH19InputWord2( U16 inputWord2 ) +{ + fpgaActuatorSetPoints.h19InputWord2 = inputWord2; +} + +/*********************************************************************//** + * @brief + * The setH19InputWord3 function sets H19 Magellan input word 3. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param inputWord Input word 3 value. + * @return none + *************************************************************************/ +void setH19InputWord3( U16 inputWord3 ) +{ + fpgaActuatorSetPoints.h19InputWord3 = inputWord3; +} + +/*********************************************************************//** + * @brief + * The setH19FPGACmd function sets the H19 Magellan FPGA command register. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param cmd FPGA command value. + * @return none + *************************************************************************/ +void setH19FPGACmd( U08 cmd ) +{ + fpgaActuatorSetPoints.h19FPGACmd = cmd; +} + +/*********************************************************************//** + * @brief + * The setH19EnableReset function sets the H19 Magellan enable/reset register. + * @details \b Inputs: fpgaActuatorSetPoints + * @details \b Outputs: none + * @param value Enable/reset register value. + * @return none + *************************************************************************/ +void setH19EnableReset( U08 value ) +{ + fpgaActuatorSetPoints.h19EnableReset = value; +} + +/*********************************************************************//** + * @brief * The getH1SPICmdStatus function reads the H1 SPI command status. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none @@ -1670,18 +1749,30 @@ /*********************************************************************//** * @brief - * The getH1MotorStatus function reads the H1 motor status. + * The getH1ReadCount function reads the H1 status. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return H1 motor status. *************************************************************************/ -U08 getH1MotorStatus( void ) +U08 getH1ReadCount( void ) { - return fpgaSensorReadings.h1MotorStatus; + return fpgaSensorReadings.h1ReadCount; } /*********************************************************************//** * @brief + * The getH1ErrorCount function shows error count of H1. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H1 error status. + *************************************************************************/ +U08 getH1ErrorCount( void ) +{ + return fpgaSensorReadings.h1ErrorCount; +} + +/*********************************************************************//** + * @brief * The getH1OutputWord1 function reads H1 output word 1. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none @@ -1716,4 +1807,76 @@ return fpgaSensorReadings.h1OutputWord3; } +/*********************************************************************//** + * @brief + * The getH19SPICmdStatus function reads the H19 SPI command status. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 SPI command status. + *************************************************************************/ +U08 getH19SPICmdStatus( void ) +{ + return fpgaSensorReadings.h19SPICmdStatus; +} + +/*********************************************************************//** + * @brief + * The getH19ReadCount function reads the H19 status. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 motor status. + *************************************************************************/ +U08 getH19ReadCount( void ) +{ + return fpgaSensorReadings.h19ReadCount; +} + +/*********************************************************************//** + * @brief + * The getH19ErrorCount function shows error count of H19. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 error status. + *************************************************************************/ +U08 getH19ErrorCount( void ) +{ + return fpgaSensorReadings.h19ErrorCount; +} + +/*********************************************************************//** + * @brief + * The getH19OutputWord1 function reads H19 output word 1. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 output word 1. + *************************************************************************/ +U16 getH19OutputWord1( void ) +{ + return fpgaSensorReadings.h19OutputWord1; +} + +/*********************************************************************//** + * @brief + * The getH19OutputWord2 function reads H19 output word 2. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 output word 2. + *************************************************************************/ +U16 getH19OutputWord2( void ) +{ + return fpgaSensorReadings.h19OutputWord2; +} + +/*********************************************************************//** + * @brief + * The getH19OutputWord3 function reads H19 output word 3. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return H19 output word 3. + *************************************************************************/ +U16 getH19OutputWord3( void ) +{ + return fpgaSensorReadings.h19OutputWord3; +} + /**@}*/ Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -r290504c1c59cf2bbc0a33c259f8be00710cc3cbf -r9b1c4a9731b66bc4aab3fb1d02b0ab608efa9598 --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 290504c1c59cf2bbc0a33c259f8be00710cc3cbf) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 9b1c4a9731b66bc4aab3fb1d02b0ab608efa9598) @@ -170,17 +170,33 @@ U16 getFPGASyringePumpDACStoredSetting( void ); void setH1CmdHeader( U16 cmdHeader ); -void setH1InputWord1( U16 inputWord ); -void setH1InputWord2( U16 inputWord ); -void setH1InputWord3( U16 inputWord ); +void setH1InputWord1( U16 inputWord1 ); +void setH1InputWord2( U16 inputWord2 ); +void setH1InputWord3( U16 inputWord3 ); void setH1FPGACmd( U08 cmd ); void setH1EnableReset( U08 value ); + +void setH19CmdHeader( U16 cmdHeader ); +void setH19InputWord1( U16 inputWord1 ); +void setH19InputWord2( U16 inputWord2 ); +void setH19InputWord3( U16 inputWord3 ); +void setH19FPGACmd( U08 cmd ); +void setH19EnableReset( U08 value ); + U08 getH1SPICmdStatus( void ); -U08 getH1MotorStatus( void ); +U08 getH1ReadCount( void ); +U08 getH1ErrorCount( void ); U16 getH1OutputWord1( void ); U16 getH1OutputWord2( void ); U16 getH1OutputWord3( void ); +U08 getH19SPICmdStatus( void ); +U08 getH19ReadCount( void ); +U08 getH19ErrorCount( void ); +U16 getH19OutputWord1( void ); +U16 getH19OutputWord2( void ); +U16 getH19OutputWord3( void ); + /**@}*/ #endif