feat: KT mBMS 펌웨어 3종(HW1/2/3) 및 통합 빌드 환경 초기 커밋 (V4.0.0.1)
This commit is contained in:
45
APP_R3221/App/Hardware/iwdg.c
Normal file
45
APP_R3221/App/Hardware/iwdg.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file iwdg.c
|
||||
* @author AMG Energy Solution Application Team
|
||||
* @version V1.0.0
|
||||
* @date 25-January-2022
|
||||
* @brief Watchdog Service Routines.
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "iwdg.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* WDT count cycle definition */
|
||||
#define WDT_COUNT_CYCLE (16384u)
|
||||
|
||||
/* Reset source definition */
|
||||
#define RESET_WDT_TRIGGER (0u)
|
||||
#define RESET_OTHER_TRIGGER (1u)
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
//Initialize watch-dog
|
||||
void IWDG_Init(void)
|
||||
{
|
||||
stc_wdt_init_t stcWdtInit;
|
||||
|
||||
/* configure structure initialization */
|
||||
MEM_ZERO_STRUCT(stcWdtInit);
|
||||
|
||||
stcWdtInit.enClkDiv = WdtPclk3Div8192;
|
||||
stcWdtInit.enCountCycle = WdtCountCycle16384;
|
||||
stcWdtInit.enRefreshRange = WdtRefresh100Pct; //WdtRefresh0To25Pct;
|
||||
stcWdtInit.enSleepModeCountEn = Disable;
|
||||
stcWdtInit.enRequestType = WdtTriggerResetRequest;
|
||||
WDT_Init(&stcWdtInit);
|
||||
|
||||
/* First refresh to start WDT */
|
||||
WDT_RefreshCounter();
|
||||
}
|
||||
Reference in New Issue
Block a user