/**
 * @file        apm32f4xx_iwdt_cfg.c
 *
 * @brief       This file provides configuration support for IWDT
 *
 * @version     V1.0.0
 *
 * @date        2023-07-31
 *
 * @attention
 *
 *  Copyright (C) 2023 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
 *  and limitations under the License.
 */

/* Includes ***************************************************************/
#include "apm32f4xx_iwdt_cfg.h"

/* Private includes *******************************************************/

/* Private macro **********************************************************/

/* Private typedef ********************************************************/

/* Private variables ******************************************************/
IWDT_HandleTypeDef hiwdt;

/* Private function prototypes ********************************************/

/* External variables *****************************************************/

/* External functions *****************************************************/

/**
 * @brief   IWDT configuration
 *
 * @param   None
 *
 * @retval  None
 */
void DAL_IWDT_Config(void)
{
    /* Colck is 1000Hz(32K / 32) */
    hiwdt.Instance = IWDT;
    hiwdt.Init.Prescaler = IWDT_PSCESCALER_32;
    hiwdt.Init.Reload = 4095U;
    if (DAL_IWDT_Init(&hiwdt) != DAL_OK)
    {
        Error_Handler();
    }
}
