Skip to content

Commit 4edc53b

Browse files
committed
hal: renesas: rzt: Add WDT support for RZ/T series
Add WDT FSP HAL driver to support Zephyr WDT driver for RZ/T2M Signed-off-by: Nhut Nguyen <[email protected]> Signed-off-by: Quang Le <[email protected]>
1 parent 99f42eb commit 4edc53b

File tree

3 files changed

+588
-0
lines changed

3 files changed

+588
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/*******************************************************************************************************************//**
8+
* @addtogroup WDT WDT
9+
* @{
10+
**********************************************************************************************************************/
11+
12+
#ifndef R_WDT_H
13+
#define R_WDT_H
14+
15+
#include "bsp_api.h"
16+
17+
#include "r_wdt_cfg.h"
18+
#include "r_wdt_api.h"
19+
20+
/* Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */
21+
FSP_HEADER
22+
23+
/***********************************************************************************************************************
24+
* Macro definitions
25+
**********************************************************************************************************************/
26+
27+
/***********************************************************************************************************************
28+
* Typedef definitions
29+
**********************************************************************************************************************/
30+
31+
/** WDT private control block. DO NOT MODIFY. Initialization occurs when R_WDT_Open() is called. */
32+
typedef struct st_wdt_instance_ctrl
33+
{
34+
uint32_t wdt_open; // Indicates whether the open() API has been successfully
35+
// called.
36+
R_WDT0_Type * p_reg; // Base register for this channel
37+
void const * p_context; // Placeholder for user data. Passed to the user callback in
38+
// wdt_callback_args_t.
39+
void (* p_callback)(wdt_callback_args_t * p_args); // Callback provided when a WDT ISR occurs.
40+
wdt_callback_args_t * p_callback_memory; // Pointer to non-secure memory that can be used to pass arguments to a callback in non-secure memory.
41+
} wdt_instance_ctrl_t;
42+
43+
/**********************************************************************************************************************
44+
* Exported global variables
45+
**********************************************************************************************************************/
46+
47+
/** @cond INC_HEADER_DEFS_SEC */
48+
/** Filled in Interface API structure for this Instance. */
49+
extern const wdt_api_t g_wdt_on_wdt;
50+
51+
/** @endcond */
52+
53+
/**********************************************************************************************************************
54+
* Public Function Prototypes
55+
**********************************************************************************************************************/
56+
fsp_err_t R_WDT_Refresh(wdt_ctrl_t * const p_ctrl);
57+
58+
fsp_err_t R_WDT_Open(wdt_ctrl_t * const p_ctrl, wdt_cfg_t const * const p_cfg);
59+
60+
fsp_err_t R_WDT_StatusClear(wdt_ctrl_t * const p_ctrl, const wdt_status_t status);
61+
62+
fsp_err_t R_WDT_StatusGet(wdt_ctrl_t * const p_ctrl, wdt_status_t * const p_status);
63+
64+
fsp_err_t R_WDT_CounterGet(wdt_ctrl_t * const p_ctrl, uint32_t * const p_count);
65+
66+
fsp_err_t R_WDT_TimeoutGet(wdt_ctrl_t * const p_ctrl, wdt_timeout_values_t * const p_timeout);
67+
68+
fsp_err_t R_WDT_CallbackSet(wdt_ctrl_t * const p_ctrl,
69+
void ( * p_callback)(wdt_callback_args_t *),
70+
void const * const p_context,
71+
wdt_callback_args_t * const p_callback_memory);
72+
73+
/* Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
74+
FSP_FOOTER
75+
76+
#endif // R_WDT_H
77+
78+
/*******************************************************************************************************************//**
79+
* @} (end addtogroup WDT)
80+
**********************************************************************************************************************/

0 commit comments

Comments
 (0)