/************************************************************************** * * Copyright (c) 2019-2021 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 OperationModes.h * * @author (last) Sean Nash * @date (last) 11-Aug-2021 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 * ***************************************************************************/ #ifndef __OP_MODES_H__ #define __OP_MODES_H__ #include "HDCommon.h" #include "HDDefs.h" /** * @defgroup HDOperationModes HDOperationModes * @brief Operation Modes module. * * @addtogroup HDOperationModes * @{ */ // ********** public definitions ********** /// Payload record structure for op mode broadcast message typedef struct { U32 opMode; ///< Current operating mode U32 subMode; ///< Current sub-mode of current operating mode } OP_MODE_PAYLOAD_T; // ********** public function prototypes ********** void initOperationModes( void ); // Initialize this module void execOperationModes( void ); // Execute the operation modes state machine (scheduled periodic call) void requestNewOperationMode( HD_OP_MODE_T newMode ); // Request a transition to a new operation mode HD_OP_MODE_T getCurrentOperationMode( void ); // Get the current operation mode HD_OP_MODE_T getPreviousOperationMode( void ); // Get the previous operation mode void initiateAlarmAction( ALARM_ACTION_T action ); // Initiate an alarm or alarm recovery action according to current op mode BOOL testSetOperationMode( HD_OP_MODE_T newMode ); // Force transition to a given mode (if allowed) BOOL testSetOpModePublishIntervalOverride( U32 ms ); BOOL testResetOpModePublishIntervalOverride( void ); /**@}*/ #endif