Index: firmware/App/Services/FpgaTD.h =================================================================== diff -u -r50f4b79164155c1bc375dd3ff0e8588f934dc729 -rb824ef4b479578c5aa702abd9147aef505a6fb04 --- firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision 50f4b79164155c1bc375dd3ff0e8588f934dc729) +++ firmware/App/Services/FpgaTD.h (.../FpgaTD.h) (revision b824ef4b479578c5aa702abd9147aef505a6fb04) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2024 Diality Inc. - All Rights Reserved. +* Copyright (c) 2024-2025 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file FPGA.h +* @file FpgaTD.h * -* @author (last) Sean Nash -* @date (last) 30-Jul-2024 +* @author (last) Dara Navaei +* @date (last) 30-Oct-2025 * * @author (original) Sean Nash -* @date (original) 30-Jul-2024 +* @date (original) 01-Aug-2024 * ***************************************************************************/ @@ -32,9 +32,12 @@ // ********** public definitions ********** // Bit definitions for pinch valve control register -#define FPGA_PINCH_VALVES_1_32_STEP 0x03 ///< Bit mask for configuring pinch valve for 1/32 step. -#define FPGA_PINCH_VALVES_REVERSE 0x08 ///< Bit mask for configuring pinch valve for reverse direction. +#define FPGA_PINCH_VALVES_1_8_STEP 0x07 ///< Bit mask for configuring pinch valve for 1/8 step microstepping. +#define FPGA_PINCH_VALVES_ENABLE_ENCODER 0x00 ///< Bit mask for configuring pinch valve enable encoder. +#define FPGA_PINCH_VALVES_RESET_ENCODER 0x08 ///< Bit mask for configuring pinch valve to reset the encoder. +#define FPAG_PINCH_VALVES_ENABLE 0x00 ///< Bit mask for configuring pinch valve to enable. #define FPGA_PINCH_VALVES_DISABLE 0x10 ///< Bit mask for configuring pinch valve to be disabled. +#define FPGA_PINCH_VALVES_RESET 0x00 ///< Bit mask for configuring pinch valve to be in reset. #define FPGA_PINCH_VALVES_NOT_RESET 0x20 ///< Bit mask for configuring pinch valve to not be in reset. #define FPGA_PINCH_VALVES_NOT_SLEEP 0x40 ///< Bit mask for configuring pinch valve to not be in sleep mode. #define FPGA_PINCH_VALVES_NEW_POS_CMD 0x80 ///< Bit mask for configuring pinch valve to accept a new position command. @@ -48,6 +51,19 @@ #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. +/// Baro sensor manufacturing coefficients +typedef struct +{ + 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. +} BARO_PRES_SENSOR_MFG_T; + // ********** public function prototypes ********** void initFpgaTD( void ); @@ -70,9 +86,12 @@ void setH4Direction( MOTOR_DIR_T dir ); void setH4SetSpeed( U16 rpm ); U16 getH4Period( void ); +void setH4BrakeAndHoldTorque( void ); S16 getH4RotorCount( void ); +S16 getH4TorqueCount( void ); U08 getH6Status( void ); +U08 getH6RotorStatus( void ); void setH5ControlFlags( U08 ctrl ); U08 getH5ControlFlags( void ); @@ -88,6 +107,12 @@ U08 getH14ReadCounter( void ); U08 getH14ErrorCounter( void ); +void getH23MfgCoeffs( BARO_PRES_SENSOR_MFG_T* baroMfgCoeffs ); +U32 getH23Pressure( void ); +U32 getH23Temperature( void ); +U08 getH23ReadCounter( void ); +U08 getH23ErrorCounter( void ); + F32 getFPGABackupAlarmAudioCurrent( void ); void getFPGAAirTrapLevels( BOOL *airAtLower, BOOL *airAtUpper ); @@ -104,16 +129,14 @@ void setH19Control( U08 controlBits ); U08 getH19Control( void ); -void setH19Position( U16 setPoint ); +void setH19Position( S16 setPoint ); S16 getH19EncoderPosition( void ); -S16 getH19CmdPosition( void ); U16 getH19Status( void ); void setH1Control( U08 controlBits ); U08 getH1Control( void ); -void setH1Position( U16 setPoint ); +void setH1Position( S16 setPoint ); S16 getH1EncoderPosition( void ); -S16 getH1CmdPosition( void ); U16 getH1Status( void ); U16 getFPGABoardTemperature( void );