/************************************************************************** * * Copyright (c) 2024-2024 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) Vinayakam Mani * @date (last) 05-Aug-2024 * * @author (original) Vinayakam Mani * @date (original) 05-Aug-2024 * ***************************************************************************/ #ifndef __OP_MODES_H__ #define __OP_MODES_H__ #include "DDCommon.h" #include "DDDefs.h" #include "TDDefs.h" /** * @defgroup DDOperationModes DDOperationModes * @brief Operation Modes unit. Manages the top level operation modes of the DD via a state machine. * * @addtogroup DDOperationModes * @{ */ // ********** public definitions ********** #define NO_SUB_STATE 0xFF ///< value for when submode does not have specific substates and is not applicable. /// Operation modes data structure typedef struct { U32 currentMode; ///< Current Mode. U32 currentSubMode; ///< Current Submode. } OP_MODES_DATA_T; /// TD mode and TD submode typedef struct { TD_OP_MODE_T tdMode; ///< TD mode U32 tdSubMode; ///< TD submode } TD_MODE_SUB_MODE_T; // ********** public function prototypes ********** void initOperationModes( void ); // initialize this unit void execOperationModes( void ); // execute the operation modes state machine (scheduled periodic call) void requestNewOperationMode( DD_OP_MODE_T newMode ); // request a transition to a new operation mode DD_OP_MODE_T getCurrentOperationMode( void ); // get the current operation mode DD_OP_MODE_T getPreviousOperationMode( void ); // get the previous operation mode U32 getCurrentOperationSubMode( void ); // get current operation sub mode void setCurrentSubState( U32 subState ); // Set the current substate. void setTDOperationMode( U32 mode, U32 subMode ); // set TD operation mode which is received from TD void getTDOperationMode( TD_MODE_SUB_MODE_T* mode ); // get TD operation mode BOOL testSetOperationMode( DD_OP_MODE_T newMode ); // Force transition to a given mode (if allowed) BOOL testSetDDOpModePublishIntervalOverride( U32 value ); BOOL testResetDDOpModePublishIntervalOverride( void ); /**@}*/ #endif