Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -rd47b9bcbd4796a8c51d9e87436422c5868292ac6 -r1158d9e342ab00e93e264b8f161696c012302751 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision d47b9bcbd4796a8c51d9e87436422c5868292ac6) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 1158d9e342ab00e93e264b8f161696c012302751) @@ -463,6 +463,56 @@ U16 fpgaACDCPMonVrms; ///< Reg 824. AC DC Power Supply RMS Voltage U16 fpgaACHeaterPMonIrms; ///< Reg 826. AC Heater RMS Current U16 fpgaACHeaterPMonVrms; ///< Reg 828. AC Heater RMS Voltage. + U08 fpgaD10FaultStatus; ///< Reg 830. DRV8434S Fault Status Register for D10. + U08 fpgaD10DiagStatus1; ///< Reg 831. DRV8434S Diag Status1 Register for D10. + U08 fpgaD10DiagStatus2; ///< Reg 832. DRV8434S Diag Status2 Register for D10. + U08 fpgaD10CtrlReg1Status; ///< Reg 833. DRV8434S CtrlReg1 Status for D10. + U08 fpgaD10CtrlReg2Status; ///< Reg 834. DRV8434S CtrlReg2 Status for D10. + U08 fpgaD10CtrlReg3Status; ///< Reg 835. DRV8434S CtrlReg3 Status for D10. + U08 fpgaD10CtrlReg4Status; ///< Reg 836. DRV8434S CtrlReg4 Status for D10. + U08 fpgaD10CtrlReg5Status; ///< Reg 837. DRV8434S CtrlReg5 Status for D10. + U08 fpgaD10CtrlReg6Status; ///< Reg 838. DRV8434S CtrlReg6 Status for D10. + U08 fpgaD10CtrlReg7Status; ///< Reg 839. DRV8434S CtrlReg7 Status for D10. + U08 fpgaD10CtrlReg8Status; ///< Reg 840. DRV8434S CtrlReg8 Status for D10. + U08 fpgaD10CtrlReg9Status; ///< Reg 841. DRV8434S CtrlReg9 Status for D10. + U08 fpgaD11FaultStatus; ///< Reg 842. DRV8434S Fault Status Register for D11. + U08 fpgaD11DiagStatus1; ///< Reg 843. DRV8434S Diag Status1 Register for D11. + U08 fpgaD11DiagStatus2; ///< Reg 844. DRV8434S Diag Status2 Register for D11. + U08 fpgaD11CtrlReg1Status; ///< Reg 845. DRV8434S CtrlReg1 Status for D11. + U08 fpgaD11CtrlReg2Status; ///< Reg 846. DRV8434S CtrlReg2 Status for D11. + U08 fpgaD11CtrlReg3Status; ///< Reg 847. DRV8434S CtrlReg3 Status for D11. + U08 fpgaD11CtrlReg4Status; ///< Reg 848. DRV8434S CtrlReg4 Status for D11. + U08 fpgaD11CtrlReg5Status; ///< Reg 849. DRV8434S CtrlReg5 Status for D11. + U08 fpgaD11CtrlReg6Status; ///< Reg 850. DRV8434S CtrlReg6 Status for D11. + U08 fpgaD11CtrlReg7Status; ///< Reg 851. DRV8434S CtrlReg7 Status for D11. + U08 fpgaD11CtrlReg8Status; ///< Reg 852. DRV8434S CtrlReg8 Status for D11. + U08 fpgaD11CtrlReg9Status; ///< Reg 853. DRV8434S CtrlReg9 Status for D11. + U08 fpgaD76FaultStatus; ///< Reg 854. DRV8434S Fault Status Register for D76. + U08 fpgaD76DiagStatus1; ///< Reg 855. DRV8434S Diag Status1 Register for D76. + U08 fpgaD76DiagStatus2; ///< Reg 856. DRV8434S Diag Status2 Register for D76. + U08 fpgaD76CtrlReg1Status; ///< Reg 857. DRV8434S CtrlReg1 Status for D76. + U08 fpgaD76CtrlReg2Status; ///< Reg 858. DRV8434S CtrlReg2 Status for D76. + U08 fpgaD76CtrlReg3Status; ///< Reg 859. DRV8434S CtrlReg3 Status for D76. + U08 fpgaD76CtrlReg4Status; ///< Reg 860. DRV8434S CtrlReg4 Status for D76. + U08 fpgaD76CtrlReg5Status; ///< Reg 861. DRV8434S CtrlReg5 Status for D76. + U08 fpgaD76CtrlReg6Status; ///< Reg 862. DRV8434S CtrlReg6 Status for D76. + U08 fpgaD76CtrlReg7Status; ///< Reg 863. DRV8434S CtrlReg7 Status for D76. + U08 fpgaD76CtrlReg8Status; ///< Reg 864. DRV8434S CtrlReg8 Status for D76. + U08 fpgaD76CtrlReg9Status; ///< Reg 865. DRV8434S CtrlReg9 Status for D76. + U08 fpgaD92FaultStatus; ///< Reg 866. DRV8434S Fault Status Register for D92. + U08 fpgaD92DiagStatus1; ///< Reg 867. DRV8434S Diag Status1 Register for D92. + U08 fpgaD92DiagStatus2; ///< Reg 868. DRV8434S Diag Status2 Register for D92. + U08 fpgaD92CtrlReg1Status; ///< Reg 869. DRV8434S CtrlReg1 Status for D92. + U08 fpgaD92CtrlReg2Status; ///< Reg 870. DRV8434S CtrlReg2 Status for D92. + U08 fpgaD92CtrlReg3Status; ///< Reg 871. DRV8434S CtrlReg3 Status for D92. + U08 fpgaD92CtrlReg4Status; ///< Reg 872. DRV8434S CtrlReg4 Status for D92. + U08 fpgaD92CtrlReg5Status; ///< Reg 873. DRV8434S CtrlReg5 Status for D92. + U08 fpgaD92CtrlReg6Status; ///< Reg 874. DRV8434S CtrlReg6 Status for D92. + U08 fpgaD92CtrlReg7Status; ///< Reg 875. DRV8434S CtrlReg7 Status for D92. + U08 fpgaD92CtrlReg8Status; ///< Reg 876. DRV8434S CtrlReg8 Status for D92. + U08 fpgaD92CtrlReg9Status; ///< Reg 877. DRV8434S CtrlReg9 Status for D92. + U16 fpgaCondSensorCalCmdStatus; ///< Reg 878. Conductivity sensor cal commands status + U08 fpgaCondSensorCmdSensorID; ///< Reg 880. Conductivty sensor cal command sensor ID } DD_FPGA_SENSORS_T; // TODO: Remove when Beta 1.9 is obsolete @@ -626,6 +676,25 @@ U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control U32 fpgaD92PumpSpeed; ///< Reg 138. HDF Pump Speed/RPM Control U32 fpgaD92PumpRevCount; ///< Reg 142. HDF pump revolution count + + U32 fpgaCondSensCalData1; ///< Reg 146 Conductivity Sensor Calibration Coefficient 1 + U32 fpgaCondSensCalData2; ///< Reg 150 Conductivity Sensor Calibration Coefficient 2 + U32 fpgaCondSensCalData3; ///< Reg 154 Conductivity Sensor Calibration Coefficient 3 + U32 fpgaCondSensCalData4; ///< Reg 158 Conductivity Sensor Calibration Coefficient 4 + U32 fpgaCondSensCalData5; ///< Reg 162 Conductivity Sensor Calibration Coefficient 5 + U32 fpgaCondSensCalData6; ///< Reg 166 Conductivity Sensor Calibration Coefficient 6 + U32 fpgaCondSensCalData7; ///< Reg 170 Conductivity Sensor Calibration Coefficient 7 + U32 fpgaCondSensCalData8; ///< Reg 174 Conductivity Sensor Calibration Coefficient 8 + U32 fpgaCondSensCalData9; ///< Reg 178 Conductivity Sensor Calibration Coefficient 9 + U32 fpgaCondSensCalData10; ///< Reg 182 Conductivity Sensor Calibration Coefficient 10 + U32 fpgaCondSensCalData11; ///< Reg 186 Conductivity Sensor Calibration Coefficient 11 + U32 fpgaCondSensCalData12; ///< Reg 190 Conductivity Sensor Calibration Coefficient 12 + U32 fpgaCondSensCalibrationTime; ///< Reg 194 Conductivity Sensor Calibration Time + U16 fpgaCondSensCalibrationCRC; ///< Reg 198 Conductivity Sensor Calibration Data CRC + U08 fpgaCondSensorID; ///< Reg 200 Conductivity Sensor Id + U08 fpgaCondSensorCmd; ///< Reg 201 Conductivity Sensor Command + U32 fpgaCondSensorHwVer; ///< Reg 202 Conductivity Sensor Hardware Version Number + U32 fpgaCondSensorSerialNum; ///< Reg 206 Conductivity Sensor Serial Number } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -2197,6 +2266,7 @@ { return fpgaSensorReadings.fpgaD17CalMemCounter; } + /*********************************************************************//** * @brief * The getFPGAD27CondReadCount function gets D27 conductivity sensor read count. @@ -4068,4 +4138,285 @@ return fpgaSensorReadings.fpgaACHeaterPMonVrms; } +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData1 function sets Calibration Data Coefficient 1 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData1 + * @param Value of the Calibration data Coefficient 1 + * @return none + *************************************************************************/ +void setFPGACondSensCalData1( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData1 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData2 function sets Calibration Data Coefficient 2 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData2 + * @param Value of the Calibration data Coefficient 2 + * @return none + *************************************************************************/ +void setFPGACondSensCalData2( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData2 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData3 function sets Calibration Data Coefficient 3 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData3 + * @param Value of the Calibration data Coefficient 3 + * @return none + *************************************************************************/ +void setFPGACondSensCalData3( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData3 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData4 function sets Calibration Data Coefficient 4 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData4 + * @param Value of the Calibration data Coefficient 4 + * @return none + *************************************************************************/ +void setFPGACondSensCalData4( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData4 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData5 function sets Calibration Data Coefficient 5 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData5 + * @param Value of the Calibration data Coefficient 5 + * @return none + *************************************************************************/ +void setFPGACondSensCalData5( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData5 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData6 function sets Calibration Data Coefficient 6 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData6 + * @param Value of the Calibration data Coefficient 6 + * @return none + *************************************************************************/ +void setFPGACondSensCalData6( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData6 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData7 function sets Calibration Data Coefficient 7 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData7 + * @param Value of the Calibration data Coefficient 7 + * @return none + *************************************************************************/ +void setFPGACondSensCalData7( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData7 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData8 function sets Calibration Data Coefficient 8 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData8 + * @param Value of the Calibration data Coefficient 8 + * @return none + *************************************************************************/ +void setFPGACondSensCalData8( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData8 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData9 function sets Calibration Data Coefficient + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData9 + * @param Value of the Calibration data Coefficient 9 + * @return none + *************************************************************************/ +void setFPGACondSensCalData9( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData9 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData10 function sets Calibration Data Coefficient 10 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData10 + * @param Value of the Calibration data Coefficient 10 + * @return none + *************************************************************************/ +void setFPGACondSensCalData10( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData10 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData11 function sets Calibration Data Coefficient 11 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData11 + * @param Value of the Calibration data Coefficient 11 + * @return none + *************************************************************************/ +void setFPGACondSensCalData11( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData11 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalData12 function sets Calibration Data Coefficient 12 + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalData12 + * @param Value of the Calibration data Coefficient 12 + * @return none + *************************************************************************/ +void setFPGACondSensCalData12( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalData12 = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalibrationTime function sets the Conductivity Sensor + * Calibration Time + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalibrationTime + * @param Value of the Conductivity Sensor Calibration Time + * @return none + *************************************************************************/ +void setFPGACondSensCalibrationTime( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalibrationTime = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensCalibrationCRC function sets the Conductivity Sensor + * Calibration Data CRC + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensCalibrationCRC + * @param Value of the Conductivity Sensor Calibration Data CRC + * @return none + *************************************************************************/ +void setFPGACondSensCalibrationCRC( U16 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensCalibrationCRC = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorId function sets the Conductivity Sensor Id + * When 01 : Will send data to P9_P10 + * When 02 : Will send data to P18_P19 + * When 03 : Will send data to D16_D17 + * When 04 : Will send data to D74_D75 + * When 05 : Will send data to D27_D28 + * When 06 : Will send data to D29_D30 + * When 07 : Will send data to D43_D44 + * Any other value, the FPGA will not transmit data. + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorID + * @param Value of the Conductivity Sensor Id + * @return none + *************************************************************************/ +void setFPGACondSensorId( U08 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorID = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorCommand function sets the Conductivity Sensor Command + * Use this command byte to inform FPGA that new Cal Coefficients are ready + * to be sent to conductive sensor + * Bit 0 : When a 0 to 1 transitions, the FPGA will send + * Calibration Coefficents (Command T) + * Bit 1 : When a 0 to 1 transitions, the FPGA will send + * Hardware Version and Serial Number (Command V) + * Bit 2 : When a 0 to 1 transitions, the FPGA will send + * reset to all conductivity sensors + * Any other bits will be ignored in this command. + * Please note only one command can be done at 1 time so + * do not toggle more than 1 bit at a time + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorCmd + * @param Value of the Conductivity Sensor Command + * @return none + *************************************************************************/ +void setFPGACondSensorCommand( U08 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorCmd = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorHwVer function sets the Conductivity Sensor + * Hardware Version Number + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorHwVer + * @param Value of the the Conductivity Sensor Hardware Version Number + * @return none + *************************************************************************/ +void setFPGACondSensorHwVer( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorHwVer = value; +} + +/*********************************************************************//** + * @brief + * The setFPGACondSensorSerialNum function sets the Conductivity Sensor + * Serial Number + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCondSensorSerialNum + * @param Value of the Conductivity Sensor Serial Number + * @return none + *************************************************************************/ +void setFPGACondSensorSerialNum( U32 value ) +{ + fpgaActuatorSetPoints.fpgaCondSensorSerialNum = value; +} + +/*********************************************************************//** + * @brief + * The getFPGACalCmdStatus function gets conductivity sensor command status + * @details \b Inputs: fpgaCondSensorCalCmdStatus + * @details \b Outputs: none + * @return cal command status. + *************************************************************************/ +U16 getFPGACalCmdStatus( void ) +{ + return fpgaSensorReadings.fpgaCondSensorCalCmdStatus; +} + +/*********************************************************************//** + * @brief + * The getFPGACalCmdSensorId function gets conductivity sensor ID for commands + * @details \b Inputs: fpgaCondSensorCmdSensorID + * @details \b Outputs: none + * @return conductivity sensor ID. + *************************************************************************/ +U08 getFPGACalCmdSensorId( void ) +{ + return fpgaSensorReadings.fpgaCondSensorCmdSensorID; +} + /**@}*/