Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -rfd897db8177752330ad08d877e0a13620513dbdc -reca350134b358d583fe4364a117d744684d28788 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision fd897db8177752330ad08d877e0a13620513dbdc) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision eca350134b358d583fe4364a117d744684d28788) @@ -148,6 +148,10 @@ #define DIENER_1000_PUMP_INTERCEPT 0.07040F ///< Speed adjustment intercept factor (Diener 1000 pump) #define DIENER_1000_PUMP_SPEED_FULL_SCALE 3150 ///< Maximum speed factor (Diener 1000 pump) +#define FPGA_D101_SWITCH1_BIT 0x01 ///< D101 connector/cap sensor 1 bit mask. +#define FPGA_D102_SWITCH2_BIT 0x02 ///< D102 connector/cap sensor 2 bit mask. +#define FPGA_D103_CAP_PARKED_BIT 0x04 ///< D103 cap parked bit mask. + #pragma pack(push,1) /// FPGA header struct. typedef struct @@ -3932,4 +3936,62 @@ { return fpgaSensorReadings.fpgaP18CalMemCounter; } + +/*********************************************************************//** + * The getD101HDFCapConnectorStatus function returns the cap connector switch 1 status + * bit 0 (0x01). + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return TRUE if sensor is covered, FALSE if not. + *************************************************************************/ +BOOL getD101HDFCapConnectorStatus( void ) +{ + BOOL result = TRUE; + + if ( ( fpgaSensorReadings.fpgaHallSensorStatus & FPGA_D101_SWITCH1_BIT ) != 0 ) + { + result = FALSE; + } + + return result; +} + +/*********************************************************************//** + * The getD102HDFCapConnectorStatus function returns the cap connector switch 2 status + * bit 1 (0x02). + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return TRUE if sensor is covered, FALSE if not. + *************************************************************************/ +BOOL getD102HDFCapConnectorStatus( void ) +{ + BOOL result = TRUE; + + if ( ( fpgaSensorReadings.fpgaHallSensorStatus & FPGA_D102_SWITCH2_BIT ) != 0 ) + { + result = FALSE; + } + + return result; +} + +/*********************************************************************//** + * The getD103HDFCapParkedStatus function returns the cap parked switch status + * bit 2 (0x04). + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none + * @return TRUE if door is parked, FALSE if not. + *************************************************************************/ +BOOL getD103HDFCapParkedStatus( void ) +{ + BOOL result = TRUE; + + if ( ( fpgaSensorReadings.fpgaHallSensorStatus & FPGA_D103_CAP_PARKED_BIT ) != 0 ) + { + result = FALSE; + } + + return result; +} + /**@}*/