WXK
2024-12-16 78e84fcf264afd731cd66c807d9fcb690fe12126
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**************************************************************************//**
* @file     pan_hal_wdt.h
* @version  V0.0.0
* $Revision: 1 $
* $Date:    23/09/10 $
* @brief    Panchip series Watchdog Timer (WDT) HAL header file.
* @note     Copyright (C) 2023 Panchip Technology Corp. All rights reserved.
*****************************************************************************/
 
 
#ifndef __PAN_HAL_WDT_H
#define __PAN_HAL_WDT_H
 
#include "pan_hal_def.h"
 
/**
 * @defgroup pan_hal_wdt WDT driver
 * @{
 * @ingroup pan_wdt
 * @brief   Watchdog Timer (WDT) driver group description.
 */
 
/**
 * @brief  Structure definition for initializing the Watchdog Timer.
 */
typedef struct 
{
    WDT_TimeoutDef Timeout;      /**< @ref WDT_TimeoutDef: Timeout duration for the WDT. */
    WDT_ResetDelayDef ResetDelay;/**< @ref WDT_ResetDelayDef: Delay before the WDT initiates a reset after timeout. */
    uint32_t  ClockSource;       /**< Clock source for the WDT. */
    uint32_t ResetSwitch;        /**< Enable or disable the reset functionality of the WDT. */
    uint32_t WakeupSwitch;       /**< Enable or disable the wakeup functionality of the WDT. */
}WDT_Init_Opt;
 
/**
 * @brief  Type definition for the Watchdog Timer callback function.
 */
typedef void (*WDT_CallbackFunc)(void);
 
/**
 * @struct WDT_Interrupt_Opt
 * @brief  WDT interrupt configuration structure definition.
 */
typedef struct
{   
    WDT_CallbackFunc CallbackFunc;
}WDT_Interrupt_Opt;
 
/**
 * @brief  Initialize the Watchdog Timer.
 * 
 * @param  wdt Pointer to a @ref WDT_HandleTypeDef structure that contains
 *         the configuration information for the specified Watchdog Timer.
 */
void HAL_WDT_Init(WDT_Init_Opt *wdt);
 
/**
 * @brief  DeInitialize the specified Watchdog Timer.
 * 
 * @param  wdt Pointer to a @ref WDT_HandleTypeDef structure that contains
 *         the configuration information for the specified Watchdog Timer.
 */
void HAL_WDT_DeInit(void);
 
/**
 * @brief  Reset the counter of the specified Watchdog Timer.
 * 
 * @param  wdt Pointer to a @ref WDT_HandleTypeDef structure representing
 *         the Watchdog Timer instance.
 */
void HAL_WDT_Feed(WDT_Init_Opt *wdt);
 
/**
 * @brief  Initialize the specified Watchdog Timer and enable its interrupts.
 * 
 * @param  wdt Pointer to a @ref WDT_HandleTypeDef structure that contains
 *         the configuration information for the specified Watchdog Timer.
 */
void HAL_WDT_Init_INT(WDT_Interrupt_Opt *opt);
 
/**
 * @brief  DeInitialize the specified Watchdog Timer and disable its interrupts.
 * 
 * @param  wdt Pointer to a @ref WDT_HandleTypeDef structure that contains
 *         the configuration information for the specified Watchdog Timer.
 */
void HAL_WDT_DeInit_INT(void);
 
/**
 * @brief  Interrupt handler for the Watchdog Timer.
 */
void WDT_IRQHandler(void);
/** @} */ // end of group
#endif /* __PAN_HAL_WDT_H */