Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r22a8500467c47070dff55824e2ec567c007434ce -r87d45fcfcfdfa6d7638834181fd07bed56a3af67 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 22a8500467c47070dff55824e2ec567c007434ce) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 87d45fcfcfdfa6d7638834181fd07bed56a3af67) @@ -150,7 +150,20 @@ S16 h4RotorHallCount; ///< Reg 344. H4 rotor count from hall sensor. U08 h6RotorStatus; ///< Reg 346. H6 rotor status. U08 reserved5; ///< - U16 h12Speed; ///< Reg 348. H12 speed (in RPM). + 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. + U16 baroPresSensitivity; ///< Reg 354. Baro sensor prom coefficient 1. + U16 baroPresOffset; ///< Reg 356. Baro sensor prom coefficient 2. + U16 baroTempCoeffOfPresSense; ///< Reg 358. Baro sensor prom coefficient 3. + U16 baroTempCoeffPresOffset; ///< Reg 360. Baro sensor prom coefficient 4. + U16 baroRefTemp; ///< Reg 362. Baro sensor prom coefficient 5. + U16 baroTempCoeffOfTemp; ///< Reg 364. Baro sensor prom coefficient 6. + U16 baroPromCRC; ///< Reg 366. Baro prom CRC. + U32 baroPressure; ///< Reg 368. Baro pressure value in counts. + U32 baroTemperature; ///< Reg 372. Baro temperature value in counts. + U08 baroReadCount; ///< Reg 376. Baro read count. + U08 baroErrorCount; ///< Reg 377. Baro error count. } FPGA_SENSORS_T; /// Record structure for FPGA continuous priority writes. @@ -746,6 +759,81 @@ /*********************************************************************//** * @brief + * The getH23MfgCoeffs function updates the baro sensor's manufacturing + * information into the provided buffer. + * @details \b Inputs: fpgaSensorReadings.baroManufactInfo, + * fpgaSensorReadings.baroPromCoeff1, fpgaSensorReadings.baroPromCoeff2, + * fpgaSensorReadings.baroPromCoeff3, fpgaSensorReadings.baroPromCoeff4, + * fpgaSensorReadings.baroPromCoeff5, fpgaSensorReadings.baroPromCoeff6, + * fpgaSensorReadings.baroPromCRC + * @details \b Outputs: none + * @param baroMfgCoeffs The baro sensor mfg info buffer. + * @return none + *************************************************************************/ +void getH23MfgCoeffs( BARO_PRES_SENSOR_MFG_T* baroMfgCoeffs ) +{ + baroMfgCoeffs->baroManufactInfo = fpgaSensorReadings.baroManufactInfo; + baroMfgCoeffs->baroPresSensitivity = fpgaSensorReadings.baroPresSensitivity; + baroMfgCoeffs->baroPresOffset = fpgaSensorReadings.baroPresOffset; + baroMfgCoeffs->baroTempCoeffOfPresSense = fpgaSensorReadings.baroTempCoeffOfPresSense; + baroMfgCoeffs->baroTempCoeffPresOffset = fpgaSensorReadings.baroTempCoeffPresOffset; + baroMfgCoeffs->baroRefTemp = fpgaSensorReadings.baroRefTemp; + baroMfgCoeffs->baroTempCoeffOfTemp = fpgaSensorReadings.baroTempCoeffOfTemp; + baroMfgCoeffs->baroPromCRC = fpgaSensorReadings.baroPromCRC; +} + +/*********************************************************************//** + * @brief + * The getH23Pressure function reads the baro sensor pressure. + * @details \b Inputs: fpgaSensorReadings.baroPressure + * @details \b Outputs: none + * @return Latest baro sensor pressure. + *************************************************************************/ +U32 getH23Pressure( void ) +{ + return fpgaSensorReadings.baroPressure; +} + +/*********************************************************************//** + * @brief + * The getH23Temperature function reads the baro sensor temperature. + * @details \b Inputs: fpgaSensorReadings.baroTemperature + * @details \b Outputs: none + * @return Latest baro sensor temperature. + *************************************************************************/ +U32 getH23Temperature( void ) +{ + return fpgaSensorReadings.baroTemperature; +} + +/*********************************************************************//** + * @brief + * The getH23ReadCounter function gets the latest baro pressure + * sensor read counter. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return latest baro pressure sensor read counter + *************************************************************************/ +U08 getH23ReadCounter( void ) +{ + return fpgaSensorReadings.baroReadCount; +} + +/*********************************************************************//** + * @brief + * The getH23ErrorCounter function gets the latest baro pressure + * sensor error counter. + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return latest baro pressure sensor error counter + *************************************************************************/ +U08 getH23ErrorCounter( void ) +{ + return fpgaSensorReadings.baroErrorCount; +} + +/*********************************************************************//** + * @brief * The getFPGABackupAlarmAudioCurrent function gets the latest piezo alarm * audio current reading. * @details \b Inputs: fpgaSensorReadings