Index: firmware/App/Services/FpgaTD.c =================================================================== diff -u -r3a8cf075eb6f0d255f516ac26bac7fbaacfde14a -rb824ef4b479578c5aa702abd9147aef505a6fb04 --- firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision 3a8cf075eb6f0d255f516ac26bac7fbaacfde14a) +++ firmware/App/Services/FpgaTD.c (.../FpgaTD.c) (revision b824ef4b479578c5aa702abd9147aef505a6fb04) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2024-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.c +* @file FpgaTD.c * -* @author (last) Sean Nash -* @date (last) 30-Jul-2024 +* @author (last) Dara Navaei +* @date (last) 07-Nov-2025 * * @author (original) Sean Nash -* @date (original) 30-Jul-2024 +* @date (original) 01-Aug-2024 * ***************************************************************************/ @@ -45,13 +45,13 @@ #define MAX_FPGA_COMM_FAILURES 3 ///< FPGA maximum comm failures per MAX_FPGA_COMM_FAILURES_WINDOW_MS #define MIN_POWER_ON_TIME_FOR_COMM_FAILS ( 1 * MS_PER_SECOND ) ///< Allow FPGA comm errors for first second after power-up -#define FPGA_PINCH_VALVES_STOPPED 0x00 ///< FPGA pinch valve control register setting to stop valve motors. -#define FPGA_VBV_CLOSED_LOOP 0x01 ///< Bit mask for running VBV motor in closed loop mode. -#define FPGA_VBA_CLOSED_LOOP 0x02 ///< Bit mask for running VBA motor in closed loop mode. -#define FPGA_VBV_OPEN_LOOP 0x04 ///< Bit mask for running VBV motor in open loop mode. -#define FPGA_VBA_OPEN_LOOP 0x80 ///< Bit mask for running VBA motor in open loop mode. +#define FPGA_H4_ENABLE_BIT_MASK 0x01 ///< Bit mask for enabling the blood pump. +#define FPGA_H4_DIR_FORWARD_BIT_MASK 0x02 ///< Bit mask for setting the blood pump direction. +#define FPGA_H4_BRAKE_AND_HOLD_TORQUE 0x06 ///< Bit mask for braking the blood pump while holding the torque of the pump. +#define FPGA_H4_BIT_2_INDEX 2 ///< Blood pump bit 2 index. -//#define FPGA_VALVES_MIN_PWM_MODE_COUNT 2500 ///< FPGA valves minimum PWM in PWM mode in counts. +#define FPGA_H13_OPEN_BIT_MASK 0x01 ///< Bit mask for setting H13 valve position to open. +#define FPGA_H20_OPEN_BIT_MASK 0x02 ///< Bit mask for setting H20 valve position to open. #define FPGA_INPUT_VOLTAGE_SCALE 3.0F ///< FPGA source and aux voltage. #define FPGA_PVN_VOLTAGE_SCALE 1.0F ///< FPGA pvn voltage. @@ -61,18 +61,26 @@ #define FPGA_BACKUP_ALARM_AUDIO_CONVERT 0.4F ///< Converts backup (piezo) alarm audio ADC volts to amps. -#define FRONT_DOOR_SWITCH_MASK 0x0010 ///< Front door switch bit mask. Bit 4 of the GPIO register. -#define PUMP_TRACK_SWITCH_MASK 0x0020 ///< Pump track switch bit mask. Bit 5 of the GPIO register. +#define H9_SWITCH_MASK 0x0001 ///< Front door switch bit mask. Bit 0 of the GPIO register. -#define FPGA_AIRTRAP_LEVEL_LOW_MASK 0x0008 ///< Bit mask for air trap lower level sensor. -#define FPGA_AIRTRAP_LEVEL_HIGH_MASK 0x0004 ///< Bit mask for air trap upper level sensor. +#define FPGA_AIRTRAP_LEVEL_LOW_H17_MASK 0x0008 ///< Bit mask for air trap lower level sensor. +#define FPGA_AIRTRAP_LEVEL_HIGH_H16_MASK 0x0004 ///< Bit mask for air trap upper level sensor. -#define FPGA_ADV_BUBBLE_STATUS_MASK 0x0002 ///< Bit mask for venous air bubble detector input status. -#define FPGA_ADV_BUBBLE_SELF_TEST_CMD 0x08 ///< Bit for venous air bubble detector self-test command. +#define FPGA_H18_BUBBLE_STATUS_MASK 0x0002 ///< Bit mask for venous air bubble detector input status. +#define FPGA_H18_BUBBLE_SELF_TEST_CMD 0x08 ///< Bit for venous air bubble detector self-test command. -#define FPGA_PBO_TEMP_DIVISOR 2047.0F ///< Used in conversion of PBo temperature reading to deg C. -#define FPGA_PBO_TEMP_GAIN 200.0F ///< Used in conversion of PBo temperature reading to deg C. -#define FPGA_PBO_TEMP_OFFSET 50.0F ///< Used in conversion of PBo temperature reading to deg C. +/// Control bits to run syringe pump in reverse direction // TODO - move to syringe pump controller unit when implemented. +static const U08 SYRINGE_PUMP_CONTROL_RUN_REVERSE = SYRINGE_PUMP_CONTROL_SLEEP_OFF | + SYRINGE_PUMP_CONTROL_NOT_RESET | + SYRINGE_PUMP_CONTROL_ENABLE | + SYRINGE_PUMP_CONTROL_REVERSE_DIR | + SYRINGE_PUMP_CONTROL_32TH_STEP; +/// Control bits to run syringe pump in forward direction // TODO - move to syringe pump controller unit when implemented. +static const U08 SYRINGE_PUMP_CONTROL_RUN_FORWARD = SYRINGE_PUMP_CONTROL_SLEEP_OFF | + SYRINGE_PUMP_CONTROL_NOT_RESET | + SYRINGE_PUMP_CONTROL_ENABLE | + SYRINGE_PUMP_CONTROL_FORWARD_DIR | + SYRINGE_PUMP_CONTROL_32TH_STEP; // FPGA Sensors Record #pragma pack(push,1) @@ -93,74 +101,99 @@ U08 errorCountProcessor; ///< Reg 258. Error count for processor communications. U08 errorCountPC; ///< Reg 259. Error count for TBD. U08 sPumpDACRdStatus; ///< Reg 260. Syringe pump DAC read status. - U08 reserved1; ///< Reg 261. Reserved and available for future use. + U08 h6HallStatus; ///< Reg 261. H6 hall sensor status. U16 sPumpDACSet; ///< Reg 262. Syringe pump DAC setting. U16 sPumpDACEEProm; ///< Reg 264. Syringe pump DAC EEProm data. - S32 PBoPressure; ///< Reg 266. PBo raw pressure data. - S32 PBoTemperature; ///< Reg 270. PBo raw temperature data. - U08 PBoReadCount; ///< Reg 274. PBo read count. - U08 PBoErrorCount; ///< Reg 275. PBo error count. - S32 PBAPressure; ///< Reg 276. PBA raw pressure data. - S32 PBATemperature; ///< Reg 280. PBA raw temperature data. - U08 PBAReadCount; ///< Reg 284. PBA read count. - U08 PBAErrorCount; ///< Reg 285. PBA error count. - S16 ATAPSpeed; ///< Reg 286. ATAP speed. - U08 BEMStatus; ///< Reg 288. BEM status. - U08 BEMEncStatus; ///< Reg 289. BEM encoder status. - S32 BEMEncPosition; ///< Reg 290. BEM encoder position. - S16 BPSpeed; ///< Reg 294. BP measured speed. - S16 BPTorque; ///< Reg 296. BP measured torque. - S16 BPSpeedFromHall; ///< Reg 298. BP measured speed from hall sensor(s). - S16 VBVPosition; ///< Reg 300. VBV encoder position. - U08 VBVStatus; ///< Reg 302. VBV status register. - U08 VBAStatus; ///< Reg 303. VBA status register. - S16 VBAPosition; ///< Reg 304. VBA encoder position. - U16 GPIOReg; ///< Reg 306. GPIO register. - U08 HEPStatus; ///< Reg 308. HEP status register. - U08 HEPAdcReadCount; ///< Reg 309. HEP ADC read counter. - U08 HEPAdcDacStatus; ///< Reg 310. HEP ADC/DAC status register. - U08 HEPEncStatus; ///< Reg 311. HEP encoder status register. - S32 HEPEncPosition; ///< Reg 312. HEP encoder position. - U16 HEPAdcCh0; ///< Reg 316. HEP ADC channel 0 reading. - U16 HEPAdcCh1; ///< Reg 318. HEP ADC channel 1 reading. - U16 HEPAdcCh2; ///< Reg 320. HEP ADC channel 2 reading. - U16 HEPAdcCh3; ///< Reg 322. HEP ADC channel 3 reading. - U16 fpgaAdcTemperature; ///< Reg 324. FPGA ADC temperature. - U16 fpga1msTimerCounter; ///< Reg 326. FPGA 1 millisecond timer counter. - U16 alarmBuzzerCurrentAdc; ///< Reg 328. Alarm buzzer current ADC reading. - U16 fpgaVccInternalAdc; ///< Reg 330. FPGA Vcc internal voltage ADC reading. - U16 fpgaCompatibilityRev; ///< Reg 332. Compatibility revision. - U08 VBTStatus; ///< Reg 334. VBT status register. - U08 VBTStatusPWM; ///< Reg 335. VBT PWM status register. + U16 h14Pressure; ///< Reg 266. H14 raw pressure data. + S16 h14Temperature; ///< Reg 268. H14 raw temperature data. + U08 h14ReadCount; ///< Reg 270. H14 read count. + U08 h14ErrorCount; ///< Reg 271. H14 error count. + U16 h2Pressure; ///< Reg 272. H2 raw pressure data. + 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 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. + U16 reserved3; ///< Reg 288. Reserved and available for future use. + 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). + 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. + U16 GPIOReg; ///< Reg 302. GPIO register. + U08 HEPStatus; ///< Reg 304. HEP status register. + U08 HEPAdcReadCount; ///< Reg 305. HEP ADC read counter. + U08 HEPAdcDacStatus; ///< Reg 306. HEP ADC/DAC status register. + U08 HEPEncStatus; ///< Reg 307. HEP encoder status register. + S32 HEPEncPosition; ///< Reg 308. HEP encoder position. + U16 HEPAdcCh0; ///< Reg 312. HEP ADC channel 0 reading. + U16 HEPAdcCh1; ///< Reg 314. HEP ADC channel 1 reading. + U16 HEPAdcCh2; ///< Reg 316. HEP ADC channel 2 reading. + U16 HEPAdcCh3; ///< Reg 318. HEP ADC channel 3 reading. + U16 fpgaAdcTemperature; ///< Reg 320. FPGA ADC temperature. + U16 fpga1msTimerCounter; ///< Reg 322. FPGA 1 millisecond timer counter. + U16 alarmBuzzerCurrentAdc; ///< Reg 324. Alarm buzzer current ADC reading. + U16 fpgaVccInternalAdc; ///< Reg 326. FPGA Vcc internal voltage ADC reading. + U16 fpgaCompatibilityRev; ///< Reg 328. Compatibility revision. + U08 VBTStatus; ///< Reg 330. VBT status register. + U08 VBTStatusPWM; ///< Reg 331. VBT PWM status register. + S16 ACPower1Current; ///< Reg 332. AC power current - 1. + S16 ACPower1Voltage; ///< Reg 334. AC power voltage - 1. + S16 ACPower2Current; ///< Reg 336. AC power current - 2. + S16 ACPower2Voltage; ///< Reg 338. AC power voltage - 2. + S16 ACPower3Current; ///< Reg 340. AC power current - 3. + 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; ///< + 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. typedef struct { U16 fpgaGenWrRd; ///< Reg 04. FPGA general write/read-back register (mirrored to a general read register in read page at addr 256). - U08 VBTControl; ///< Reg 06. VBT valve control register. - U08 reserved1; ///< Reg 07. Reserved. - U08 VBTPWMEnable; ///< Reg 08. VBT valve PWM enable register. - U08 reserved2; ///< Reg 09. Reserved. - U16 VBTPWMLowPeriod; ///< Reg 10. VBT PWM low signal period register. - U16 VBTPWMPeriod; ///< Reg 12. VBT PWM period register. - U16 VBTPWMPUllInTime; ///< Reg 14. VBT PWM pull in time register. - U16 ATAPSetSpeed; ///< Reg 16. Air pump speed set register. - U08 ATAPControl; ///< Reg 18. Air pump control register. - U08 BEMControl; ///< Reg 19. Blood ejector stepper motor control register. - U16 BEMSetSpeed; ///< Reg 20. Blood ejector stepper motor step register. - U16 BPSetSpeed; ///< Reg 22. Blood pump speed set register. - U08 BPControl; ///< Reg 24. Blood pump control register. - U08 pinchValveControl; ///< Reg 25. Pinch valve control register (VBA and VBV). - S16 VBVPosition; ///< Reg 26. VBV position set register. - S16 VBAPosition; ///< Reg 28. VBA position set register. - U16 VBVStepSpeed; ///< Reg 30. VBV step speed set register. - U16 VBAStepSpeed; ///< Reg 32. VBA step speed set register. - U08 alarmControl; ///< Reg 34. Alarm audio register. - U08 reserved3; ///< Reg 35. Reserved. - U32 reserved4; ///< Reg 36. Reserved. - U32 reserved5; ///< Reg 40. Reserved. - U08 sensorTest; ///< Reg 44. Sensor self-test control register. + U08 h13h20AirTrapValveControl; ///< Reg 06. H13 & H20 air trap valve control register. + U08 h13h20AirTrapValvePWMEnable; ///< Reg 07. H13 & H20 air trap valve PWM enable register. + U16 h13PWMLowPeriod; ///< Reg 08. H13 PWM low signal period register. + U16 h13PWMPeriod; ///< Reg 10. H13 PWM period register. + U16 h13PWMPUllInTime; ///< Reg 12. H13 PWM pull in time register. + U08 h12Control; ///< Reg 14. H12 Air pump control register. + U08 h5Control; ///< Reg 15. H5 ejector stepper motor control register. + U16 NotUsed; ///< Reg 16. Reserved. + U16 h4SetSpeed; ///< Reg 18. H4 Blood pump speed set register (RPM). + U08 h4Control; ///< Reg 20. H4 Blood pump control register. + U08 h19Control; ///< Reg 21. H19 control register. + S16 h19Position; ///< Reg 22. H19 position set register (200 steps/rev). + U16 NotUsed2; ///< Reg 24. Reserved. + S16 h1Position; ///< Reg 26. H1 position set register (200 steps/rev). + U16 NotUsed3; ///< Reg 28. Reserved. + U08 h1Control; ///< Reg 30. H1 control register. + U08 h1h19ValveEncoderControl; ///< Reg 31. H1/H19 valve encoder control register. + U08 alarmControl; ///< Reg 32. Alarm audio control register. + U08 syrPumpControl; ///< Reg 33. Syringe pump control register. + U32 syrPumpSpeed; ///< Reg 34. Syringe pump time between step toggle (1/2 step period). + U16 syrPumpDACData; ///< Reg 38. Syringe pump DAC data (12 bits). + U16 syrPumpDACControl; ///< Reg 40. Syringe pump ADC and DAC control register. + U16 h12Period; ///< Reg 42. H12 Air pump time period for each count in PWM register. + U32 h5SetSpeed; ///< Reg 44. H5 ejector motor set speed. } FPGA_ACTUATORS_T; #pragma pack(pop) @@ -196,16 +229,34 @@ memset( &fpgaActuatorSetPoints, 0, sizeof(FPGA_ACTUATORS_T) ); fpgaActuatorSetPoints.alarmControl = (U08)MIN_ALARM_VOLUME_ATTENUATION << 2; // Start alarm audio volume at maximum - // Set VBA and VBV to be "stopped". - // the valves will not move to 0 position - fpgaActuatorSetPoints.pinchValveControl = FPGA_PINCH_VALVES_STOPPED; + // Set H1 and H19 to default configuration + disabled so they do not run immediately on power up + fpgaActuatorSetPoints.h1Control = FPGA_PINCH_VALVES_1_8_STEP | FPGA_PINCH_VALVES_DISABLE | FPGA_PINCH_VALVES_NOT_RESET | FPGA_PINCH_VALVES_NOT_SLEEP; + fpgaActuatorSetPoints.h19Control = FPGA_PINCH_VALVES_1_8_STEP | FPGA_PINCH_VALVES_DISABLE | FPGA_PINCH_VALVES_NOT_RESET | FPGA_PINCH_VALVES_NOT_SLEEP; // initialize FPGA comm failures windowed timer count initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES, MAX_FPGA_COMM_FAILURES, MAX_FPGA_COMM_FAILURES_WINDOW_MS); } /*********************************************************************//** * @brief + * The fpgaResetTransitoryCmds function resets any transitory commands in + * the actuator registers. + * @note This function should be called by FPGA driver after actuator registers + * copied to transmit buffer to clear command bits that are only intended to + * be sent to FPGA once. + * @details \b Inputs: none + * @details \b Outputs: Transitory command bits cleared + * @return none + *************************************************************************/ +void fpgaResetTransitoryCmds( void ) +{ + // Reset pinch valve position change command bits + setH1Control( ( getH1Control() & ~FPGA_PINCH_VALVES_NEW_POS_CMD ) ); + setH19Control( ( getH19Control() & ~FPGA_PINCH_VALVES_NEW_POS_CMD ) ); +} + +/*********************************************************************//** + * @brief * The execFPGATest function executes the FPGA self-test. * @details \b Alarm: ALARM_ID_TD_FPGA_POST_TEST_FAILED if self-test fails. * @details \b Inputs: fpgaHeader @@ -407,146 +458,382 @@ /*********************************************************************//** * @brief - * The getFPGABloodPumpHallSensorCount function gets the latest blood pump - * hall sensor count. Count is a 16 bit free running counter. If counter is - * counting up, indicates motor is running in forward direction. If counter is - * counting down, indicates motor is running in reverse direction. Counter will - * wrap at 0/65535. - * @details \b Inputs: fpgaSensorReadings + * The setH4Enabled function enables or disables the blood pump per + * the given flag. + * @details \b Inputs: none + * @details \b Outputs: Blood pump enabled or disabled (bit 0 of BP control register) + * @param enable TRUE if BP enable is requested, FALSE if BP disable is requested + * @return none + *************************************************************************/ +void setH4Enabled( BOOL enable ) +{ + if ( TRUE == enable ) + { + fpgaActuatorSetPoints.h4Control |= FPGA_H4_ENABLE_BIT_MASK; + } + else + { + fpgaActuatorSetPoints.h4Control &= ~((U08)FPGA_H4_ENABLE_BIT_MASK); + } +} + +/*********************************************************************//** + * @brief + * The setH4Direction function sets the direction for the blood pump + * motor to the given direction. + * @details \b Inputs: none + * @details \b Outputs: Blood pump motor direction is set (bit 1 and 2 of BP control register). + * 0 - CW (forward) + * 1 - CCW (reverse) + * @param dir the desired direction for the blood pump motor (fwd or rev) + * @return none + *************************************************************************/ +void setH4Direction( MOTOR_DIR_T dir ) +{ + if ( MOTOR_DIR_FORWARD == dir ) + { + // First clear bit 2 if it is on otherwise the pump can be kept on brake + fpgaActuatorSetPoints.h4Control &= ~( 1 << FPGA_H4_BIT_2_INDEX ); + fpgaActuatorSetPoints.h4Control |= FPGA_H4_DIR_FORWARD_BIT_MASK; + } + else + { + fpgaActuatorSetPoints.h4Control &= ~((U08)FPGA_H4_DIR_FORWARD_BIT_MASK); + } +} + +/*********************************************************************//** + * @brief + * The setH4SetSpeed function sets the fpga blood pump set speed + * to the given speed (0..3000 RPM). + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h4SetSpeed + * @param rpm the set point for the H4 pump speed (in RPM). + * @return none + *************************************************************************/ +void setH4SetSpeed( U16 rpm ) +{ + fpgaActuatorSetPoints.h4SetSpeed = rpm; +} + +/*********************************************************************//** + * @brief + * The getH4Period function gets the latest blood pump period (in 10uSec) + * from the FPGA. + * @details \b Inputs: fpgaSensorReadings.h4Period * @details \b Outputs: none + * @return Latest blood pump period. + *************************************************************************/ +U16 getH4Period( void ) +{ + return fpgaSensorReadings.h4Period; +} + +/*********************************************************************//** + * @brief + * The setH4BrakeAndHoldTorque function brakes the pump while holding the torque. + * The pump will not coast. + * @details \b Inputs: none + * @details \b Outputs: Blood pump motor control register + * @return none + *************************************************************************/ +void setH4BrakeAndHoldTorque( void ) +{ + fpgaActuatorSetPoints.h4Control |= FPGA_H4_BRAKE_AND_HOLD_TORQUE; +} + +/*********************************************************************//** + * @brief + * The getH6Status function gets the latest blood pump hall sensor status. + * Bit 0: 1=Magnet is detected (used for homing in forward direction) + * Bit 1: 0=Reverse pump direction detected, 1=Forward pump direction detected + * Bit 2..7: Not used. + * @details \b Inputs: fpgaSensorReadings.h6HallStatus + * @details \b Outputs: none + * @return Latest blood pump hall sensor status bits. + *************************************************************************/ +U08 getH6Status( void ) +{ + return fpgaSensorReadings.h6HallStatus; +} + +/*********************************************************************//** + * @brief + * The getH6RotorStatus function gets the latest blood pump hall sensor status. + * Bit 0: 0=Magnet is detected (used for homing in forward direction) + * Bit 1: 0=Reverse pump direction detected, 1=Forward pump direction detected + * Bit 2..7: Not used. + * @details \b Inputs: fpgaSensorReadings.h6RotorStatus + * @details \b Outputs: none + * @return Latest blood pump hall sensor status bits. + *************************************************************************/ +U08 getH6RotorStatus( void ) +{ + return fpgaSensorReadings.h6RotorStatus; +} + +/*********************************************************************//** + * @brief + * The getH4RotorCount function gets the latest blood pump + * hall sensor count. Count is number of ms between rotor revolutions. + * If direction is forward, the count will be positive. If direction is + * reverse, the count will be negative. + * @details \b Inputs: fpgaSensorReadings.h4RotorHallCount + * @details \b Outputs: none * @return Latest blood pump hall sensor count reading. *************************************************************************/ -U16 getFPGABloodPumpHallSensorCount( void ) +S16 getH4RotorCount( void ) { - return 0;//fpgaSensorReadings.bloodPumpHallSensorCount; + return fpgaSensorReadings.h4RotorHallCount; } /*********************************************************************//** * @brief - * The getFPGABloodPumpHallSensorStatus function gets the latest blood pump - * hall sensor status. - * Bit 7 - Derived direction of the blood pump motor (0=Fwd, 1=Rev) - * Bit 6 - Unused - * Bit 5-0 - Direction error count since power-up (rolls over) - * @details \b Inputs: fpgaSensorReadings + * The getH4TorqueCount function gets the latest blood pump + * torque count. Count is the period in 10 uS resolution. Firmware converts + * the period to frequency and 1kHz = 10mN.m. + * @details \b Inputs: fpgaSensorReadings.h4Torque * @details \b Outputs: none - * @return latest blood pump hall sensor status reading. + * @return Latest blood pump torque sensor count reading. *************************************************************************/ -U08 getFPGABloodPumpHallSensorStatus( void ) +S16 getH4TorqueCount( void ) { - return 0;//fpgaSensorReadings.bloodPumpHallSensorStatus; + return fpgaSensorReadings.h4Torque; } /*********************************************************************//** * @brief - * The getPBAPressure function gets the latest arterial pressure reading. - * High byte indicates alarm status for ADC channel. - * @note Low 24-bits are channel reading. Subtract 2^23 from low 24 bits to get - * signed channel reading. + * The setH5ControlFlags function sets the control flags for the H5 ejector + * stepper motor. + * @note Bit 0 - MS1 (bit 1 of microstepping configuration setting) + * Bit 1 - MS2 (bit 2 of microstepping configuration setting) + * Bit 2 - MS3 (bit 3 of microstepping configuration setting) + * Bit 3 - Direction (1=forward, 0=reverse) + * Bit 4 - Disable (0=enabled, 1=disabled) + * Bit 5 - Reset (0=reset, 1=not reset) + * Bit 6 - Sleep (0=sleep, 1=not sleep) + * Bit 7 - Reserved + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h5Control + * @param ctrl Bit flags for H5 stepper motor control + * @return none + *************************************************************************/ +void setH5ControlFlags( U08 ctrl ) +{ + fpgaActuatorSetPoints.h5Control = ctrl; +} + +/*********************************************************************//** + * @brief + * The getH5ControlFlags function gets the currently set control flags for + * the H5 ejector stepper motor. + * @details \b Inputs: fpgaActuatorSetPoints.h5Control + * @details \b Outputs: none + * @return Currently set control flags for H5 ejector motor + *************************************************************************/ +U08 getH5ControlFlags( void ) +{ + return fpgaActuatorSetPoints.h5Control; +} + +/*********************************************************************//** + * @brief + * The setH5StepToggleTime function sets the ejector motor set speed step + * toggle time (in uSec). + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h5SetSpeed + * @return latest arterial pressure reading + *************************************************************************/ +void setH5StepToggleTime( U32 microSeconds ) +{ + fpgaActuatorSetPoints.h5SetSpeed = microSeconds; +} + +/*********************************************************************//** + * @brief + * The getH2Pressure function gets the latest arterial pressure reading. + * The high 2 bits are status bits: 00=ok, 01=cmd mode, 10=stale data, 11=diag + * The low 14 bits are data. Zero is at 1638. Values above are positive, + * below are negative. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest arterial pressure reading *************************************************************************/ -S32 getPBAPressure( void ) +U16 getH2Pressure( void ) { - return fpgaSensorReadings.PBAPressure; + return fpgaSensorReadings.h2Pressure; } /*********************************************************************//** * @brief - * The getPBATemperature function gets the latest arterial pressure + * The getH2Temperature function gets the latest arterial pressure * sensor temperature reading. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest arterial pressure sensor temperature reading *************************************************************************/ -S32 getPBATemperature( void ) +S16 getH2Temperature( void ) { - return fpgaSensorReadings.PBATemperature; + return fpgaSensorReadings.h2Temperature; } /*********************************************************************//** * @brief - * The getPBAReadCounter function gets the latest arterial + * The getH2ReadCounter function gets the latest arterial * pressure sensor read counter. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest arterial pressure sensor read counter *************************************************************************/ -U08 getPBAReadCounter( void ) +U08 getH2ReadCounter( void ) { - return fpgaSensorReadings.PBAReadCount; + return fpgaSensorReadings.h2ReadCount; } /*********************************************************************//** * @brief - * The getPBAErrorCounter function gets the latest arterial + * The getH2ErrorCounter function gets the latest arterial * pressure sensor error counter. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest arterial pressure sensor error counter *************************************************************************/ -U08 getPBAErrorCounter( void ) +U08 getH2ErrorCounter( void ) { - return fpgaSensorReadings.PBAErrorCount; + return fpgaSensorReadings.h2ErrorCount; } /*********************************************************************//** * @brief - * The getPBOPressure function gets the latest venous pressure reading. + * The getH14Pressure function gets the latest venous pressure reading. * The high 2 bits are status bits: 00=ok, 01=cmd mode, 10=stale data, 11=diag * The low 14 bits are data. Zero is at 1638. Values above are positive, * below are negative. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest venous pressure reading *************************************************************************/ -S32 getPBOPressure( void ) +U16 getH14Pressure( void ) { - return fpgaSensorReadings.PBoPressure; + return fpgaSensorReadings.h14Pressure; } /*********************************************************************//** * @brief - * The getPBOTemperature function gets the latest venous pressure + * The getH14Temperature function gets the latest venous pressure * sensor temperature reading. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest venous pressure sensor temperature reading *************************************************************************/ -S32 getPBOTemperature( void ) +S16 getH14Temperature( void ) { - return fpgaSensorReadings.PBoTemperature; + return fpgaSensorReadings.h14Temperature; } /*********************************************************************//** * @brief - * The getPBOReadCounter function gets the latest venous pressure + * The getH14ReadCounter function gets the latest venous pressure * sensor read counter. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest venous pressure sensor read counter *************************************************************************/ -U08 getPBOReadCounter( void ) +U08 getH14ReadCounter( void ) { - return fpgaSensorReadings.PBoReadCount; + return fpgaSensorReadings.h14ReadCount; } /*********************************************************************//** * @brief - * The getPBOErrorCounter function gets the latest venous pressure + * The getH14ErrorCounter function gets the latest venous pressure * sensor error counter. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return latest venous pressure sensor error counter *************************************************************************/ -U08 getPBOErrorCounter( void ) +U08 getH14ErrorCounter( void ) { - return fpgaSensorReadings.PBoErrorCount; + return fpgaSensorReadings.h14ErrorCount; } /*********************************************************************//** * @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 & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @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 & MASK_OFF_U32_MSB ); +} + +/*********************************************************************//** + * @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 @@ -572,39 +859,97 @@ void getFPGAAirTrapLevels( BOOL *airAtLower, BOOL *airAtUpper ) { U16 fpgaGPIO = fpgaSensorReadings.GPIOReg; - U16 lower = fpgaGPIO & FPGA_AIRTRAP_LEVEL_LOW_MASK; - U16 upper = fpgaGPIO & FPGA_AIRTRAP_LEVEL_HIGH_MASK; + U16 lower = fpgaGPIO & FPGA_AIRTRAP_LEVEL_LOW_H17_MASK; + U16 upper = fpgaGPIO & FPGA_AIRTRAP_LEVEL_HIGH_H16_MASK; *airAtLower = ( 0 == lower ? FALSE : TRUE ); *airAtUpper = ( 0 == upper ? FALSE : TRUE ); } /*********************************************************************//** * @brief - * The setFPGAValvesControlMode function sets the valves control mode. - * @details \b Inputs: fpgaActuatorSetPoints - * @details \b Outputs: fpgaActuatorSetPoints - * @param bits : The bits to enable the PID controller of a valve + * The setH13ValveState function sets the command position for H13 valve. + * @note VBTControl register bit 0 will drive state of H13 valve (0=closed, 1=open). + * @details \b Inputs: fpgaActuatorSetPoints.h13h20AirTrapValveControl + * @details \b Outputs: fpgaActuatorSetPoints.h13h20AirTrapValveControl + * @param state : The valve state to command H13 valve to * @return none *************************************************************************/ -void setFPGAValvesControlMode( U16 bits ) +void setH13ValveState( VALVE_3WAY_STATE_T state ) { - //fpgaActuatorSetPoints.fpgaPIDControl = bits; + if ( VALVE_3WAY_COMMON_TO_OPEN_STATE == state ) + { + fpgaActuatorSetPoints.h13h20AirTrapValveControl |= FPGA_H13_OPEN_BIT_MASK; + } + else + { + fpgaActuatorSetPoints.h13h20AirTrapValveControl &= ~((U08)FPGA_H13_OPEN_BIT_MASK); + } } /*********************************************************************//** * @brief - * The ADVBubbleDetected function determines whether ADV bubble detector + * The setH20ValveState function sets the command position for H20 valve. + * @note VBTControl register bit 0 will drive state of H13 valve (0=closed, 1=open). + * @details \b Inputs: fpgaActuatorSetPoints.h13h20AirTrapValveControl + * @details \b Outputs: fpgaActuatorSetPoints.h13h20AirTrapValveControl + * @param state The valve state to command H13 valve to + * @return none + *************************************************************************/ +void setH20ValveState( VALVE_3WAY_STATE_T state ) +{ + if ( VALVE_3WAY_COMMON_TO_OPEN_STATE == state ) + { + fpgaActuatorSetPoints.h13h20AirTrapValveControl |= FPGA_H20_OPEN_BIT_MASK; + } + else + { + fpgaActuatorSetPoints.h13h20AirTrapValveControl &= ~((U08)FPGA_H20_OPEN_BIT_MASK); + } +} + +/*********************************************************************//** + * @brief + * The setH12AirPumpMotorPowerLevel function sets the air pump motor power level + * to 0 to turn pump off or 1..255 for varying power levels. + * @details \b Inputs: fpgaActuatorSetPoints.h12Control + * @details \b Outputs: fpgaActuatorSetPoints.h12Control + * @param power The set power level to set the H12 air pump to. + * @return none + *************************************************************************/ +void setH12AirPumpMotorPowerLevel( U08 power ) +{ + fpgaActuatorSetPoints.h12Control = power; +} + +/*********************************************************************//** + * @brief + * The setH12AirPumpMotorPWMCntTime function sets the air pump motor PWM count + * time in increments of 10 nS. The PWM period will then be 255 x given + * value x 10 nS. + * @details \b Inputs: fpgaActuatorSetPoints.h12Period + * @details \b Outputs: fpgaActuatorSetPoints.h12Period + * @param tenNS The time associated with each PWM count in power level setting. + * @return none + *************************************************************************/ +void setH12AirPumpMotorPWMCntTime( U16 tenNS ) +{ + fpgaActuatorSetPoints.h12Period = tenNS; +} + +/*********************************************************************//** + * @brief + * The H18BubbleDetected function determines whether H18 bubble detector * sensor is currently detecting a bubble. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return TRUE if latest ADV reading shows bubble detected, FALSE if not + * @return TRUE if latest H18 reading shows bubble detected, FALSE if not *************************************************************************/ -BOOL ADVBubbleDetected( void ) +BOOL H18BubbleDetected( void ) { U16 noBubbleDetected = 0; - noBubbleDetected = fpgaSensorReadings.GPIOReg & FPGA_ADV_BUBBLE_STATUS_MASK; + noBubbleDetected = fpgaSensorReadings.GPIOReg & FPGA_H18_BUBBLE_STATUS_MASK; return ( 0 == noBubbleDetected ? TRUE : FALSE ); } @@ -619,7 +964,7 @@ *************************************************************************/ void setFPGAVenousBubbleSelfTest( void ) { - fpgaActuatorSetPoints.sensorTest |= FPGA_ADV_BUBBLE_SELF_TEST_CMD; +// fpgaActuatorSetPoints.sensorTest |= FPGA_ADV_BUBBLE_SELF_TEST_CMD; } /*********************************************************************//** @@ -632,111 +977,177 @@ *************************************************************************/ void clearFPGAVenousBubbleSelfTest( void ) { - fpgaActuatorSetPoints.sensorTest &= ~FPGA_ADV_BUBBLE_SELF_TEST_CMD; +// fpgaActuatorSetPoints.sensorTest &= ~FPGA_ADV_BUBBLE_SELF_TEST_CMD; } /*********************************************************************//** * @brief - * The setVBVPosition function sets the target encoder position of VBV - * in counts + * The setH19Control function sets the control bits for the venous pinch valve. + * Microstep setting: bits 0..2: + * 0=full step (100% torque) + * 1=1/2 step (100% torque) + * 2=1/16 step + * 3=1/32 step + * 4=full step (modified) + * 5=1/2 step (modified) + * 6=1/4 step + * 7=1/8 step + * Direction: bit 3 + * 1=reset encoder + * Enable: bit 4 (active low) + * 0=enabled + * 1=disabled + * Reset: bit 5 (active low) + * 0=reset (set to 1 after power up) + * Sleep: bit 6 (active low) + * 0=sleep mode + * Reserved: bit 7 * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints - * @param setPoint The target encoder position of the VBV in counts + * @details \b Outputs: fpgaActuatorSetPoints.h19Control + * @param controlBits The control bits to apply to the venous pinch valve. * @return none *************************************************************************/ -void setVBVPosition( S16 setPoint ) +void setH19Control( U08 controlBits ) { - fpgaActuatorSetPoints.VBVPosition = setPoint; + fpgaActuatorSetPoints.h19Control = controlBits; } /*********************************************************************//** * @brief - * The getVBVPosition function returns the current encoder position of - * VBV in counts - * @details \b Inputs: fpgaSensorReadings + * The getH19Control function gets the current control bits for the H19 valve. + * @details \b Inputs: fpgaActuatorSetPoints.h19Control * @details \b Outputs: none - * @return The current encoder position of VBV + * @return fpgaActuatorSetPoints.H19Control *************************************************************************/ -S16 getVBVPosition( void ) +U08 getH19Control( void ) { - return fpgaSensorReadings.VBVPosition; + return fpgaActuatorSetPoints.h19Control; } /*********************************************************************//** * @brief - * The getVBVStatus function reads the status of the venous pinch valve. + * The setH19Position function sets the travel from current position for the + * H19 valve in counts (or microcounts if microstepping is set in control register). + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h19Position + * @param setPoint The target encoder position of the H19 valve in counts + * @return none + *************************************************************************/ +void setH19Position( S16 setPoint ) +{ + fpgaActuatorSetPoints.h19Position = setPoint; +} + +/*********************************************************************//** + * @brief + * The getH19EncoderPosition function reads the current encoder position of the + * H19 valve in counts. + * @note There are 1024 encoder counts per revolution. The encoder position + * register provides the number of steps traveled since last command given. * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none - * @return Latest status of the venous pinch valve + * @return The current encoder position of H19 valve *************************************************************************/ -U16 getVBVStatus( void ) +S16 getH19EncoderPosition( void ) { - return fpgaSensorReadings.VBVStatus; + return fpgaSensorReadings.h19EncPosition; } /*********************************************************************//** * @brief - * The getFPGAValveBloodVenousCurrentCounts function returns the current - * of VBV in counts - * @details \b Inputs: fpgaSensorReadings + * The getH19Status function reads the status of the venous pinch valve. + * @details \b Inputs: fpgaSensorReadings.h19Status * @details \b Outputs: none - * @return The latest current of VBV + * @return Latest status of the venous pinch valve *************************************************************************/ -U16 getFPGAValveBloodVenousCurrentCounts( void ) +U16 getH19Status( void ) { - return 0;//fpgaSensorReadings.VBVCurrent; + return fpgaSensorReadings.h19Status; } /*********************************************************************//** * @brief - * The setVBAPosition function sets the target encoder position of the VBA - * in counts + * The setH1Control function sets the control bits for the arterial pinch valve. + * Microstep setting: bits 0..2: + * 0=full step (100% torque) + * 1=1/2 step (100% torque) + * 2=1/16 step + * 3=1/32 step + * 4=full step (modified) + * 5=1/2 step (modified) + * 6=1/4 step + * 7=1/8 step + * Encoder Reset: bit 3 + * 0=not reset + * 1=reset + * Enable: bit 4 (active low) + * 0=enabled + * 1=disabled + * Reset: bit 5 (active low) + * 0=reset (set to 1 after power up) + * Sleep: bit 6 (active low) + * 0=sleep mode + * Reserved: bit 7 * @details \b Inputs: none - * @details \b Outputs: fpgaActuatorSetPoints - * @param setPoint The target encoder position of the VBA in counts + * @details \b Outputs: fpgaActuatorSetPoints.h1Control + * @param controlBits The control bits to apply to the arterial pinch valve. * @return none *************************************************************************/ -void setVBAPosition( S16 setPoint ) +void setH1Control( U08 controlBits ) { - fpgaActuatorSetPoints.VBAPosition = setPoint; + fpgaActuatorSetPoints.h1Control = controlBits; } /*********************************************************************//** * @brief - * The getVBAPosition function reads the current encoder position of the - * VBA in counts - * @details \b Inputs: fpgaSensorReadings + * The getH1Control function gets the current control bits for the H1 valve. + * @details \b Inputs: fpgaActuatorSetPoints.h1Control * @details \b Outputs: none - * @return The latest encoder position of VBA + * @return fpgaActuatorSetPoints.h1Control *************************************************************************/ -S16 getVBAPosition( void ) +U08 getH1Control( void ) { - return fpgaSensorReadings.VBAPosition; + return fpgaActuatorSetPoints.h1Control; } /*********************************************************************//** * @brief - * The getVBAStatus function reads the status of the arterial pinch valve. - * @details \b Inputs: fpgaSensorReadings + * The setH1Position function sets the travel from current position for the + * H1 valve in counts (or microcounts if microstepping is set in control register). + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.h1Position + * @param setPoint The target encoder position of the H1 valve in counts + * @return none + *************************************************************************/ +void setH1Position( S16 setPoint ) +{ + fpgaActuatorSetPoints.h1Position = setPoint; +} + +/*********************************************************************//** + * @brief + * The getH1EncoderPosition function reads the current encoder position of the + * H1 valve in counts. + * @note There are 1024 encoder counts per revolution + * @details \b Inputs: fpgaSensorReadings.h1EncPosition * @details \b Outputs: none - * @return Latest status of the arterial pinch valve + * @return The latest encoder position of H1 valve *************************************************************************/ -U16 getVBAStatus( void ) +S16 getH1EncoderPosition( void ) { - return fpgaSensorReadings.VBAStatus; + return fpgaSensorReadings.h1EncPosition; } /*********************************************************************//** * @brief - * The getFPGAValveBloodArterialCurrentCounts function reads the current - * of VBA in counts - * @details \b Inputs: fpgaSensorReadings + * The getH1Status function reads the status of the arterial pinch valve. + * @details \b Inputs: fpgaSensorReadings.h1Status * @details \b Outputs: none - * @return The latest current of VBA + * @return Latest status of the arterial pinch valve *************************************************************************/ -U16 getFPGAValveBloodArterialCurrentCounts( void ) +U16 getH1Status( void ) { - return 0;//fpgaSensorReadings.; + return fpgaSensorReadings.h1Status; } /*********************************************************************//** @@ -752,17 +1163,17 @@ } /*********************************************************************//** - * The getFPGAFrontDoorStatus function returns the FPGA front door status + * The getH9FrontDoorClosedStatus function returns the FPGA front door status * bit (0x10). * @details \b Inputs: fpgaSensorReadings * @details \b Outputs: none * @return TRUE if front door is closed, FALSE if not. *************************************************************************/ -BOOL getFPGAFrontDoorClosedStatus( void ) +BOOL getH9FrontDoorClosedStatus( void ) { BOOL result = TRUE; - if ( ( fpgaSensorReadings.GPIOReg & FRONT_DOOR_SWITCH_MASK ) != 0 ) + if ( ( fpgaSensorReadings.GPIOReg & H9_SWITCH_MASK ) != 0 ) { result = FALSE; } @@ -779,7 +1190,7 @@ *************************************************************************/ U32 getFPGAPBAADCTemperature( void ) { - return fpgaSensorReadings.PBATemperature; + return fpgaSensorReadings.h2Temperature; } /*********************************************************************//** @@ -810,7 +1221,9 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { +#ifndef TEST_DEBUGGER SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.errorCountProcessor ) +#endif } } } @@ -836,7 +1249,9 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { +#ifndef TEST_DEBUGGER SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.errorCountProcessor ) +#endif } } }