/************************************************************************** * * Copyright (c) 2019-2023 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 Buttons.h * * @author (last) Dara Navaei * @date (last) 18-Jan-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 * ***************************************************************************/ #ifndef __BUTTONS_H__ #define __BUTTONS_H__ #include "HDCommon.h" /** * @defgroup Buttons Buttons * @brief The Buttons module monitors and manages the off and stop buttons. * * @addtogroup Buttons * @{ */ // ********** public definitions ********** /// Enumeration of hardware button states. typedef enum Button_States { BUTTON_STATE_RELEASED = 0, ///< Button is in the released state BUTTON_STATE_PRESSED, ///< Button is in the pressed state NUM_OF_BUTTON_STATES ///< Number of button states } BUTTON_STATE_T; #pragma pack(push,1) /// Payload record structure for an off button confirmation message from the UI. typedef struct { U08 confirmed; ///< 1 = confirmed, 0 = rejected/timed out } OFF_BUTTON_MESSAGE_FROM_UI_PAYLOAD_T; #pragma pack(pop) /// Power off warning message payload data. typedef struct { U32 powerOffWarning; ///< Power off warning message. } POWER_OFF_WARNING_DATA_T; // ********** public function prototypes ********** void initButtons( void ); void execButtons( void ); BOOL isStopButtonPressed( void ); void userConfirmOffButton( U08 response ); SELF_TEST_STATUS_T execStuckButtonTest( void ); void resetStuckButtonPOSTState( void ); BUTTON_STATE_T getOffButtonState( void ); BUTTON_STATE_T getStopButtonState( void ); void initiatePowerOff( void ); BOOL testSetOffButtonStateOverride( U32 value ); BOOL testResetOffButtonStateOverride( void ); BOOL testSetStopButtonStateOverride( U32 value ); BOOL testResetStopButtonStateOverride( void ); /**@}*/ #endif