/* ======================================================================
 *   Copyright (c) 2021 Texas Instruments Incorporated
 *
 *   All rights reserved. Property of Texas Instruments Incorporated.
 *   Restricted rights to use, duplicate or disclose this code are
 *   granted through contract.
 *
 *   The program may not be used without the written permission
 *   of Texas Instruments Incorporated or against the terms and conditions
 *   stipulated in the agreement under which this program has been
 *   supplied.
 * ==================================================================== */

/**
 *  \file     WdgApp.h
 *
 *  \brief    WDG example header file
 *
 */

#ifndef WDG_APP_H_
#define WDG_APP_H_

/* ========================================================================== */
/*                             Include Files                                  */
/* ========================================================================== */

/* None */

#ifdef __cplusplus
extern "C"
{
#endif

/* ========================================================================== */
/*                           Macros & Typedefs                                */
/* ========================================================================== */

#define APP_NAME                        "WDG_APP"

/* Default loop count. */
#define WDG_APP_LOOP_COUNT              (1U)

/* Number of times to service wdt before letting it expire */
#define WDG_APP_SERVICE_LOOP_COUNT         (0xFFU)
/* ========================================================================== */
/*                         Structures and Enums                               */
/* ========================================================================== */

/**
 *  \brief SPI application test parameters.
 *  The test case execution happens based on values of this structure
 */
typedef struct
{
    char          *testDescStr;
    /**< Test description. */
    uint32         loopCount;
    /**< Number of iteration. */
    uint32         serviceInterval;
    /**< wdg service interval (in millisecond) */
    const Wdg_ConfigType *wdgConfig;
    /**< WDG configuration */
    uint32         numServiceCount;
    /**< Number of times to service the watchdog before letting it expire */
    uint32         testId;
    /**< Test ID for print purpose. This is initialized in the code */
} WdgApp_TestParams;

/* ========================================================================== */
/*                          Function Declarations                             */
/* ========================================================================== */
extern CONST(Wdg_ConfigType, WDG_PBCFG) WdgSettingsConfig;

static WdgApp_TestParams gWdgAppTestPrms[] =
{
    [0] =
    {
        .testId = 0U,
        .loopCount       = WDG_APP_LOOP_COUNT,
        .testDescStr     = "TPR12 WDG Example",
        .numServiceCount = WDG_APP_SERVICE_LOOP_COUNT,
        .serviceInterval = 3, /* In millisecond */
        .wdgConfig       = &WdgSettingsConfig,
    },
};

#ifdef __cplusplus
}
#endif

#endif  /* #ifndef WDG_APP_H_ */
