/*
 *  Copyright (c) 1996-2007 Digi International Inc., All Rights Reserved
 *
 *  This software contains proprietary and confidential information of Digi
 *  International Inc.  By accepting transfer of this copy, Recipient agrees
 *  to retain this software in confidence, to prevent disclosure to others,
 *  and to make no use of this software other than that for which it was
 *  delivered.  This is an unpublished copyrighted work of Digi International
 *  Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
 *  prohibited.
 *
 *  Restricted Rights Legend
 *
 *  Use, duplication, or disclosure by the Government is subject to
 *  restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
 *  Technical Data and Computer Software clause at DFARS 252.227-7031 or
 *  subparagraphs (c)(1) and (2) of the Commercial Computer Software -
 *  Restricted Rights at 48 CFR 52.227-19, as applicable.
 *
 *  Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
 *
 * =======================================================================
 *
 * Edit Date/Ver   Edit Description
 * ==============  =======================================================
 *
 *
 */

#ifndef watchdog_h

#define watchdog_h

#ifdef __cplusplus
extern "C"
{
#endif


/*
 * Possible return values.
 */

/*ad*
 * Watchdog API Return Type
 *
 * @external
 * @category BSP:Device_Drivers:WatchdogDriver
 * @since 6.0                         
*ad*/
typedef int WATCHDOG_CCODE;

/*ad*
 * Watchdog API error codes
 *
 * @external
 * @category BSP:Device_Drivers:WatchdogDriver
 * @since 6.0
 * @name watchdog_api_errors "Watchdog API error codes"
 *
 * @param WATCHDOG_SUCCESS                            0: Success
 * @param WATCHDOG_ALREADY_SERVICING_WATCHDOG         1: Watchdog is already armed
 * @param WATCHDOG_WAS_NOT_SERVICING				  2: Watchdog is not armed 
 * @param WATCHDOG_ERROR_CREATING_TIMER_TASK		  3: Failed to create timer task
 * @param WATCHDOG_ERROR_SETTING_INTERRUPT            4: Failed to configure watchdog in interrupt mode
 * 
*ad*/
#define WATCHDOG_SUCCESS                        0
#define WATCHDOG_ALREADY_SERVICING_WATCHDOG     1
#define WATCHDOG_WAS_NOT_SERVICING              2
#define WATCHDOG_ERROR_CREATING_TIMER_TASK      3
#define WATCHDOG_ERROR_SETTING_INTERRUPT        4

void watchdogServiceOnce(void);
WATCHDOG_CCODE watchdogServicePeriodically(void);
WATCHDOG_CCODE watchdogStopServicing(void);    
WATCHDOG_CCODE naWatchdogSetInterruptMode(void);
WATCHDOG_CCODE naWatchdogClearInterruptMode(void);
unsigned watchdogTimeoutInMilliseconds(void);

#ifdef __cplusplus
}
#endif



#endif




