Index: firmware/App/Modes/OperationModes.h =================================================================== diff -u -r4efb2d1786c717ca6cf4b1bc992cec8e16820bff -r7d4711edd7b40cd3e29f43e766f79a8a09586fe9 --- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 4efb2d1786c717ca6cf4b1bc992cec8e16820bff) +++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 7d4711edd7b40cd3e29f43e766f79a8a09586fe9) @@ -1,18 +1,19 @@ -/**********************************************************************//** - * - * Copyright (c) 2019-2020 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 - * - * @date 11-Dec-2019 - * @author S. Nash - * - * @brief Header file for Operation Modes. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-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) Dara Navaei +* @date (last) 14-Sep-2023 +* +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 +* +***************************************************************************/ #ifndef __OP_MODES_H__ #define __OP_MODES_H__ @@ -22,22 +23,37 @@ /** * @defgroup DGOperationModes DGOperationModes - * @brief Operation Modes module. - * Manages the top level operation modes of the DG via a state machine. + * @brief Operation Modes module. Manages the top level operation modes of the DG via a state machine. * * @addtogroup DGOperationModes * @{ */ // ********** 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; + // ********** public function prototypes ********** -void initOperationModes( void ); // initialize this module -void execOperationModes( void ); // execute the operation modes state machine (scheduled periodic call) +void initOperationModes( void ); // initialize this module +void execOperationModes( void ); // execute the operation modes state machine (scheduled periodic call) void requestNewOperationMode( DG_OP_MODE_T newMode ); // request a transition to a new operation mode DG_OP_MODE_T getCurrentOperationMode( void ); // get the current operation mode +DG_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. +BOOL testSetOperationMode( DG_OP_MODE_T newMode ); // Force transition to a given mode (if allowed) +BOOL testSetDGOpModePublishIntervalOverride( U32 value ); +BOOL testResetDGOpModePublishIntervalOverride( void ); + /**@}*/ #endif