app_aon_wdt.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_aon_wdt.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of AON_WDT app library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup APP_DRIVER APP DRIVER
43 * @{
44 */
45
46 /** @defgroup APP_AON_WDT AON WDT
47 * @brief AON WDT APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_AON_WDT_H_
53 #define _APP_AON_WDT_H_
54
55 #include "grx_hal.h"
56 #include "app_drv_error.h"
57 #include "app_drv_config.h"
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 #ifdef HAL_AON_WDT_MODULE_ENABLED
64
65 /** @addtogroup APP_AON_WDT_TYPEDEFS Type definitions
66 * @{
67 */
68
69 /**
70 * @brief AON_WDT event callback definition
71 */
72 typedef void (*app_aon_wdt_evt_handler_t)(void);
73 /** @} */
74
75 /** @addtogroup APP_AON_WDT_ENUMS Enumerations
76 * @{
77 */
78 /**@brief App aon_wdt state types. */
79 typedef enum
80 {
81 APP_AON_WDT_INVALID = 0,
82 APP_AON_WDT_ACTIVITY,
83 } app_aon_wdt_state_t;
84
85 /** @} */
86
87 /** @addtogroup APP_AON_WDT_STRUCTURES Structures
88 * @{
89 */
90
91 /**
92 * @brief AON_WDT device structure definition
93 */
94 typedef struct
95 {
96 app_aon_wdt_evt_handler_t evt_handler; /**< AON WDT event callback definition. */
97 aon_wdt_handle_t handle; /**< AON WDT handle definition. */
98 app_aon_wdt_state_t aon_wdt_state; /**< AON WDT state types. */
99 }aon_aon_wdt_env_t;
100
101 /**
102 * @brief AON_WDT parameters structure definition
103 */
104 typedef struct
105 {
106 aon_wdt_init_t init; /**< AON WDT init parameters. */
107 aon_aon_wdt_env_t aon_aon_wdt_env; /**< AON_WDT device structure definition. */
108 } app_aon_wdt_params_t;
109 /** @} */
110
111 /* Exported functions --------------------------------------------------------*/
112 /** @addtogroup APP_AON_WDT_DRIVER_FUNCTIONS Functions
113 * @{
114 */
115 /**
116 ****************************************************************************************
117 * @brief Initialize the APP AON WDT DRIVER.
118 *
119 * @param[in] p_params: Pointer to app_aon_wdt_params_t parameter which contains the
120 * configuration information for the specified AON WDT module.
121 * @param[in] evt_handler: AON WDT user callback function.
122 *
123 * @return Result of initialization.
124 ****************************************************************************************
125 */
126 uint16_t app_aon_wdt_init(app_aon_wdt_params_t *p_params, app_aon_wdt_evt_handler_t evt_handler);
127
128 /**
129 ****************************************************************************************
130 * @brief De-initialize the APP AON WDT DRIVER.
131 *
132 * @return Result of De-initialization.
133 ****************************************************************************************
134 */
135 uint16_t app_aon_wdt_deinit(void);
136
137 /**
138 ****************************************************************************************
139 * @brief Refresh the AON WDT.
140 *
141 * @return Result of operation.
142 ****************************************************************************************
143 */
144 uint16_t app_aon_wdt_refresh(void);
145 /** @} */
146
147 #endif
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif
154
155 /** @} */
156 /** @} */
157 /** @} */
158
app_aon_wdt_params_t::aon_aon_wdt_env
aon_aon_wdt_env_t aon_aon_wdt_env
Definition: app_aon_wdt.h:107
aon_aon_wdt_env_t::evt_handler
app_aon_wdt_evt_handler_t evt_handler
Definition: app_aon_wdt.h:96
app_aon_wdt_state_t
app_aon_wdt_state_t
App aon_wdt state types.
Definition: app_aon_wdt.h:80
app_aon_wdt_deinit
uint16_t app_aon_wdt_deinit(void)
De-initialize the APP AON WDT DRIVER.
aon_aon_wdt_env_t::aon_wdt_state
app_aon_wdt_state_t aon_wdt_state
Definition: app_aon_wdt.h:98
APP_AON_WDT_INVALID
@ APP_AON_WDT_INVALID
Definition: app_aon_wdt.h:81
aon_aon_wdt_env_t
AON_WDT device structure definition.
Definition: app_aon_wdt.h:95
app_aon_wdt_evt_handler_t
void(* app_aon_wdt_evt_handler_t)(void)
AON_WDT event callback definition.
Definition: app_aon_wdt.h:72
grx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_aon_wdt_params_t::init
aon_wdt_init_t init
Definition: app_aon_wdt.h:106
app_aon_wdt_refresh
uint16_t app_aon_wdt_refresh(void)
Refresh the AON WDT.
aon_aon_wdt_env_t::handle
aon_wdt_handle_t handle
Definition: app_aon_wdt.h:97
_aon_wdt_handle
AON_WDT handle Structure definition.
Definition: hal_aon_wdt.h:99
app_aon_wdt_params_t
AON_WDT parameters structure definition.
Definition: app_aon_wdt.h:105
_aon_wdt_init
AON_WDT_Configuration init structure definition.
Definition: hal_aon_wdt.h:76
APP_AON_WDT_ACTIVITY
@ APP_AON_WDT_ACTIVITY
Definition: app_aon_wdt.h:82
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.
app_aon_wdt_init
uint16_t app_aon_wdt_init(app_aon_wdt_params_t *p_params, app_aon_wdt_evt_handler_t evt_handler)
Initialize the APP AON WDT DRIVER.