Common IO - basic v1.0.0
Common IO - basic v1.0.0 Library
 
Loading...
Searching...
No Matches
iot_watchdog.h
Go to the documentation of this file.
1/*
2 * Common IO - basic V1.0.0
3 * Copyright (C) 2020 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 )
57typedef enum
58{
64
68typedef enum
69{
73
77struct IotWatchdogDescriptor;
78
84typedef struct IotWatchdogDescriptor * IotWatchdogHandle_t;
85
96typedef enum
97{
112
126typedef void (* IotWatchdogCallback_t)( void * pvUserContext );
127
141IotWatchdogHandle_t iot_watchdog_open( int32_t lWatchdogInstance );
142
156int32_t iot_watchdog_start( IotWatchdogHandle_t const pxWatchdogHandle );
157
171int32_t iot_watchdog_stop( IotWatchdogHandle_t const pxWatchdogHandle );
172
191int32_t iot_watchdog_restart( IotWatchdogHandle_t const pxWatchdogHandle );
192
213 IotWatchdogCallback_t xCallback,
214 void * pvUserContext );
215
235int32_t iot_watchdog_ioctl( IotWatchdogHandle_t const pxWatchdogHandle,
237 void * const pvBuffer );
238
251int32_t iot_watchdog_close( IotWatchdogHandle_t const pxWatchdogHandle );
252
257#endif /* ifndef _IOT_WATCHDOG_H_ */
int32_t iot_watchdog_restart(IotWatchdogHandle_t const pxWatchdogHandle)
iot_watchdog_restart is used to restart the WatchDog timer to the originally programmed values....
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...
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...
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
IotWatchdogBiteConfig_t
WatchDog timer bite behavior setting.
Definition: iot_watchdog.h:69
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...
IotWatchdogStatus_t
WatchDog timer status values.
Definition: iot_watchdog.h:58
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...
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...
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
IotWatchdogIoctlRequest_t
Ioctl request types.
Definition: iot_watchdog.h:97
void iot_watchdog_set_callback(IotWatchdogHandle_t const pxWatchdogHandle, IotWatchdogCallback_t xCallback, void *pvUserContext)
iot_watchdog_set_callback is used to set the callback to be called when bark time reaches the WatchDo...
@ eWatchdogBiteTimerInterrupt
Definition: iot_watchdog.h:71
@ eWatchdogBiteTimerReset
Definition: iot_watchdog.h:70
@ eWatchdogTimerBiteExpired
Definition: iot_watchdog.h:62
@ eWatchdogTimerStopped
Definition: iot_watchdog.h:59
@ eWatchdogTimerBarkExpired
Definition: iot_watchdog.h:61
@ eWatchdogTimerRunning
Definition: iot_watchdog.h:60
@ eGetWatchdogStatus
Definition: iot_watchdog.h:108
@ eSetWatchdogBiteTime
Definition: iot_watchdog.h:103
@ eGetWatchdogBiteTime
Definition: iot_watchdog.h:107
@ eSetWatchdogBarkTime
Definition: iot_watchdog.h:98
@ eGetWatchdogBarkTime
Definition: iot_watchdog.h:102
@ eSetWatchdogBiteBehaviour
Definition: iot_watchdog.h:109