lib_wdt.h 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
/**
  ******************************************************************************
  * @file    lib_wdt.h 
  * @author  Application Team
  * @version V1.1.0
  * @date    2019-10-28
  * @brief   WDT library.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
#ifndef __LIB_WDT_H
#define __LIB_WDT_H

#ifdef __cplusplus
 extern "C" {
#endif

#include "target.h"


#define WDT_2_SECS            (0x0U << PMU_WDTEN_WDTSEL_Pos)
#define WDT_4_SECS            (0x1U << PMU_WDTEN_WDTSEL_Pos)
#define WDT_8_SECS            (0x2U << PMU_WDTEN_WDTSEL_Pos)
#define WDT_16_SECS           (0x3U << PMU_WDTEN_WDTSEL_Pos)

/* Private macros ------------------------------------------------------------*/
#define IS_WDT_PERIOD(__PERIOD__)  (((__PERIOD__) == WDT_2_SECS)   ||\
                                    ((__PERIOD__) == WDT_4_SECS)   ||\
                                    ((__PERIOD__) == WDT_8_SECS) ||\
                                    ((__PERIOD__) == WDT_16_SECS))

/* Exported Functions ------------------------------------------------------- */
void WDT_Enable(void);
void WDT_Disable(void);
void WDT_Clear(void);
void WDT_SetPeriod(uint32_t period);
uint16_t WDT_GetCounterValue(void);
   
#ifdef __cplusplus
}
#endif
     
#endif  /* __LIB_WDT_H */

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