/**
  ******************************************************************************
  * @file    WWDG_CFG.h
  * @author  SINOMCU-AE
  * @brief   Header file of WWDG_CFG.c file.
  *    
  *          This file describes the WWDG macro definitions used:
  *              WWDT count timer and window timer.
  *         
  ******************************************************************************
  * @attention 
  *                           DISCLAIMER
  * The present firmware which is for guidance only aims at providing customers
  * with coding information regarding their products in order for them to save
  * time. As a result, SinoMCU shall not be held liable for any direct,indirect
  * or consequential damages with respect to any claims arising from the content 
  * of such firmware and/or the use made by customers of the coding information 
  * contained herein in connection with their products.
  *
  * <h2><center>&copy; Copyright (c) 2021 sinomcu All rights reserved.</center></h2>
  *
  ******************************************************************************
  */

#ifndef __WWDG_CFG_H
#define __WWDG_CFG_H

#include "ms32f0xx.h"

#define SYSCLK_USE_PLL_48M   0         // 1:sysclk PLL48M,0:HSI 8M 

// 20ms------10ms--------T6 toggle(reset)
//            |- refresh -|      
// 7bit,CNT= (t*Pclk/4096/perscaler-1)+T6(64)
#if(defined(SYSCLK_USE_PLL_48M) && SYSCLK_USE_PLL_48M) 
#define WWDG_CNT_USER        92        // 7bit,20ms;48M:(20ms*48M/4096/8-1)+(64)=92
#define WWDG_WIN_USER        78        // 7bit,10ms;48M:(10ms*48M/4096/8-1)+(64)=78
#else
#define WWDG_CNT_USER        102       // 7bit,20ms;8M:(20ms*8M/4096/1-1)+(64)=102;
#define WWDG_WIN_USER        83        // 7bit,10ms;8M:(10ms*8M/4096/1-1)+(64)=83;
#endif
#define REFRESH_WWDG_5S      500       // unit WWDG_WIN:10ms

void wwdg_init(void);

#endif /* __WWDG_CFG_H */ 

/******************************** END OF FILE *********************************/
