FreeRTOS: Common I/O
AWS IoT Common I/O library
Return to main page ↑
iot_watchdog.h
Go to the documentation of this file.
1 /*
2  * FreeRTOS Common IO V1.0.0
3  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25 
26 /*******************************************************************************
27  * @file iot_watchdog.h
28  *
29  * @brief HAL APIs for WatchDog driver
30  *******************************************************************************
31  */
32 
38 #ifndef _IOT_WATCHDOG_H_
39 #define _IOT_WATCHDOG_H_
40 
49 #define IOT_WATCHDOG_SUCCESS ( 0 )
50 #define IOT_WATCHDOG_INVALID_VALUE ( 1 )
51 #define IOT_WATCHDOG_TIME_NOT_SET ( 2 )
52 #define IOT_WATCHDOG_FUNCTION_NOT_SUPPORTED ( 3 )
57 typedef enum
58 {
64 
68 typedef enum
69 {
73 
77 struct IotWatchdogDescriptor;
78 
84 typedef struct IotWatchdogDescriptor * IotWatchdogHandle_t;
85 
96 typedef enum
97 {
112 
126 typedef void (* IotWatchdogCallback_t)( void * pvUserContext );
127 
141 IotWatchdogHandle_t iot_watchdog_open( int32_t lWatchdogInstance );
142 
156 int32_t iot_watchdog_start( IotWatchdogHandle_t const pxWatchdogHandle );
157 
171 int32_t iot_watchdog_stop( IotWatchdogHandle_t const pxWatchdogHandle );
172 
191 int32_t iot_watchdog_restart( IotWatchdogHandle_t const pxWatchdogHandle );
192 
212 void iot_watchdog_set_callback( IotWatchdogHandle_t const pxWatchdogHandle,
213  IotWatchdogCallback_t xCallback,
214  void * pvUserContext );
215 
235 int32_t iot_watchdog_ioctl( IotWatchdogHandle_t const pxWatchdogHandle,
236  IotWatchdogIoctlRequest_t xRequest,
237  void * const pvBuffer );
238 
251 int32_t iot_watchdog_close( IotWatchdogHandle_t const pxWatchdogHandle );
252 
257 #endif /* ifndef _IOT_WATCHDOG_H_ */
void(* IotWatchdogCallback_t)(void *pvUserContext)
WatchDog notification callback type. This callback is passed to the driver by using iot_watchdog_set_...
Definition: iot_watchdog.h:126
int32_t iot_watchdog_start(IotWatchdogHandle_t const pxWatchdogHandle)
iot_watchdog_start is used to start the WatchDog timer counter. WatchDog expiry (bite) time must be s...
int32_t iot_watchdog_close(IotWatchdogHandle_t const pxWatchdogHandle)
iot_watchdog_close is used to de-initializes the WatchDog, stops the timer if it was started and rese...
struct IotWatchdogDescriptor * IotWatchdogHandle_t
IotWatchdogHandle_t type is the WatchDog handle returned by calling iot_watchdog_open() this is initi...
Definition: iot_watchdog.h:84
int32_t iot_watchdog_ioctl(IotWatchdogHandle_t const pxWatchdogHandle, IotWatchdogIoctlRequest_t xRequest, void *const pvBuffer)
iot_watchdog_ioctl is used to configure the WatchDog timer properties like the WatchDog timeout value...
void iot_watchdog_set_callback(IotWatchdogHandle_t const pxWatchdogHandle, IotWatchdogCallback_t xCallback, void *pvUserContext)
iot_wathcdog_set_callback is used to set the callback to be called when bark time reaches the WatchDo...
Definition: iot_watchdog.h:98
Definition: iot_watchdog.h:59
IotWatchdogBiteConfig_t
WatchDog timer bite behavior setting.
Definition: iot_watchdog.h:68
IotWatchdogHandle_t iot_watchdog_open(int32_t lWatchdogInstance)
iot_watchdog_open is used to initialize the WatchDog, This function will stop the timer if it was sta...
Definition: iot_watchdog.h:103
Definition: iot_watchdog.h:62
Definition: iot_watchdog.h:60
Definition: iot_watchdog.h:61
Definition: iot_watchdog.h:102
Definition: iot_watchdog.h:70
Definition: iot_watchdog.h:108
Definition: iot_watchdog.h:107
IotWatchdogIoctlRequest_t
Ioctl request types.
Definition: iot_watchdog.h:96
Definition: iot_watchdog.h:109
int32_t iot_watchdog_restart(IotWatchdogHandle_t const pxWatchdogHandle)
iot_watchdog_restart is used to restart the WatchDog timer to the originally programmed values...
Definition: iot_watchdog.h:71
IotWatchdogStatus_t
WatchDog timer status values.
Definition: iot_watchdog.h:57
int32_t iot_watchdog_stop(IotWatchdogHandle_t const pxWatchdogHandle)
iot_watchdog_stop is used to stop and resets the WatchDog timer counter. After stopping the timer and...