 /*  keapiVxW.h - KEAPI implemenatation for VxWorks
  *
  *  KEAPI v1.2.0.3 implementation for all sections 
  *  except Library Initialization and System State 
  *  (to be done as common code for all BSPs)
  */

/*
 * Copyright 2011 Kontron KGSC.
 */

/*
 modification history
 --------------------
 01c,18mar11,edv modify debug switch, remove common (non-BSP specific) API
 01b,11mar11,edv eliminate diab warning from debug print
 01a,21feb11,edv initial version
 */

#ifndef KEAPIVXW_H
#define KEAPIVXW_H

#include <vxWorks.h>

#include <../3rdparty/kontron/KEAPI/keapi_types.h>

#ifdef __cplusplus
extern "C" {
#endif

/*****************************************************************************
 *
 *
 * Definitions (constants and types)
 *
 *
 ****************************************************************************/

/* output debug messages from KEAPI functions BY DEFAULT */
#ifndef KEAPI_DEBUG
#       define KEAPI_DEBUG (1)
#endif	

/* debug messages */
#if (KEAPI_DEBUG > 0)
#       include <logLib.h>
#       define KEAPI_DBG(x,a,b,c,d,e,f)  logMsg(x,a,b,c,d,e,f) 
#else
#       define KEAPI_DBG(x,a,b,c,d,e,f)
#endif

#if 0 /* replaced by keapi_types.h */	

/* Battery power states */
#define POWER_STATE_CHARGING     	(0)
#define POWER_STATE_CHARGED      	(1)
#define POWER_STATE_DISCHARGING     	(2)

/* Fan control modes */
#define FAN_METHOD_MAX_SPEED (0)
#define FAN_METHOD_MANUAL (1)
#define FAN_METHOD_THERMAL_CRUISE (2)

/* CPU frequencies */
#define CPU_FREQUENCY_MIN (0)
#define CPU_FREQUENCY_MAX (1)
#define CPU_FREQUENCY_CURRENT (2)

/* CPU performance */
#define CPU_PERFORMANCE_HIGH (0)
#define CPU_PERFORMANCE_POWER_SAVE (1)
#define CPU_PERFORMANCE_ON_DEMAND (2)
#define CPU_PERFORMANCE_CONSERVATIVE (3)
#define CPU_PERFORMANCE_USER (4)

/* GPIO direction */
#define GPIO_DIRECTION_IN (0)
#define GPIO_DIRECTION_OUT (1)

typedef INT8                KEAPI_INT8;
typedef INT16               KEAPI_INT16;
typedef INT32		    KEAPI_INT32;
typedef INT64           KEAPI_INT64;
typedef UINT8       KEAPI_UINT8;
typedef UINT16      KEAPI_UINT16;
typedef UINT32        KEAPI_UINT32;
typedef UINT64  KEAPI_UINT64;
typedef INT8*               KEAPI_PINT8;
typedef INT16*              KEAPI_PINT16;
typedef INT32*                KEAPI_PINT32;
typedef INT64*          KEAPI_PINT64;
typedef UINT8*      KEAPI_PUINT8;
typedef UINT16*     KEAPI_PUINT16;
typedef UINT32*       KEAPI_PUINT32;
typedef UINT64* KEAPI_PUINT64;
typedef float               KEAPI_FLOAT;
typedef double              KEAPI_DOUBLE;
typedef float*              KEAPI_PFLOAT;
typedef double*             KEAPI_PDOUBLE;
typedef char                KEAPI_CHAR;
typedef char*               KEAPI_PCHAR;
typedef UCHAR       KEAPI_UCHAR;
typedef UCHAR*      KEAPI_PUCHAR;
typedef unsigned char       KEAPI_BOOL;
typedef unsigned char*      KEAPI_PBOOL;


/* General return values */
typedef enum {
    KEAPI_RET_SUCCESS = (0x00000000),   /**< The function was successfull                     */
    KEAPI_RET_ERROR = (-1),   /**< General error. Use only when there is no appropriate specific error return value */
    KEAPI_RET_PARAM_ERROR = (0x00000001),  /**< Wrong parameter value */
    KEAPI_RET_PARAM_NULL = (0x00000002),   /**< Parameter is NULL where it is not allowed    */
    KEAPI_RET_HW_COUNT_EXCEEDED = (0x00000006),   /**< HW count exceeded */
    KEAPI_RET_WD_TIMEOUT_NOT_SUPPORTED = (0x00000007),   /**< WD timeout not supported */
    KEAPI_RET_BUFFER_OVERFLOW = (0x00000008),   /**< Buffer overflow (probably configuration error) */
    KEAPI_RET_SETTING_ERROR = (0x00000009),   /**< Error while setting value or feature (enable, disable) */
    KEAPI_RET_WRITE_ERROR = (0x0000000A),   /**< Cannot write */
    KEAPI_RET_READ_ERROR = (0x0000000B),   /**< Cannot read */
    KEAPI_RET_MALLOC_ERROR = (0x0000000C),  /**< Memory allocation failed */
    KEAPI_RET_FUNCTION_NOT_SUPPORTED = (0x00000011),   /**< Function is not supported on current platform/HW */
    KEAPI_RET_RETRIEVAL_ERROR = (0x00000012),   /**< Error while retrieving information               */
    KEAPI_RET_FUNCTION_NOT_IMPLEMENTED = (0x00000013)   /**< Function is not yet implemented */
} KEAPI_RETVAL;

/** \brief Structure for temperature sensor info*/
typedef struct Temp_Sensor
{
	KEAPI_CHAR	name[MAX_STR]; 	/**< Sensor name*/
	KEAPI_INT32	value;		/**< Value obtained from sensor in millidegrees*/
} TEMP_SENSOR, *PTEMP_SENSOR;


/** \brief Structure for voltage sensor info*/
typedef struct Voltage_Sensor
{
    KEAPI_CHAR  name[MAX_STR];		/**< Sensor name*/
    KEAPI_INT32 value;			/**< Value obtained from the sensor in millivolts*/
} VOLTAGE_SENSOR, *PVOLTAGE_SENSOR;


/** \brief Structure for fan info	*/
typedef struct Fan
{
	KEAPI_CHAR	name[MAX_STR];	/**< Fan name*/
	KEAPI_UINT32	rpm;		/**< Revolutions per minute*/
	KEAPI_UINT8	pwm;		/**< Pulse width modulation fan control*/
	KEAPI_UINT8	powerMode;	/**< Fan speed control mode 0 = DC, 1 = PWM*/
	KEAPI_UINT8	method;		/**< Method of control - Maximal speed, manual control or thermal cruise */
} FAN, *PFAN;

#endif /* replaced by keapi_types.h */
	
/*****************************************************************************
 *
 *
 * KEAPI function prototypes
 *
 *
 ****************************************************************************/

/**
\brief          Initialization of Kontron EAPI.
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_ERROR
*/
IMPORT KEAPI_RETVAL keapiLibInitialize(void);


/*****************************************************************************
 * General information
 ****************************************************************************/

/**
\brief          Provides actual information whether computer case was opened or not
\param[out]     pIntruderStatus  Pointer to a variable that receives actual intruder status
* - INTRUDER_STATUS_CASE CLOSED, 0
* - INTRUDER_STATUS_CASE OPENED , 1
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetIntruderStatus (
	KEAPI_PINT32 pIntruderStatus
);

/**
\brief          Resets the case intruder status
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiResetIntruderStatus (void);

/*****************************************************************************
 * Temperature sensors information
 ****************************************************************************/

/**
\brief          Provides number of temperature sensors
\param[out]     pTempSensorCount Pointer to number of installed temperature sensors
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetTempSensorCount (
	KEAPI_PINT32 pTempSensorCount
);

/**
\brief          Provides information about temperature sensors (their name and current value), stored in the TEMP_SENSOR structure
\param[in]      tempSensorCount Number of temperature sensors
\param[out]     pTempSensors Pointer to the temperature sensors structure
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetTempSensorList (
	PTEMP_SENSOR pTempSensors,
	KEAPI_INT32 tempSensorCount
);

/**
\brief          Derives information about current value of a temperature sensor with a given ID
\param[in]      tempSensorNr Number (index) of a temperature sensor. Numbers start with 0
\param[out]     pTempSensorValue Pointer to the value of a given temperature sensor
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetTempSensorValue (
	KEAPI_INT32 tempSensorNr,
	KEAPI_PINT32 pTempSensorValue
);

/*
\brief          Provides information about actual temperature of the selected CPU
\param[in]      cpuNr       Selected CPU number. CPU numbers start with zero
\param[out]     pCpuTemp    Pointer to a variable that receives selected CPU’s core temperature in Kelvins
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetCpuTemp (
	KEAPI_INT32 cpuNr,
	KEAPI_PINT32 pCpuTemp
);

/**
\brief          Provides information about actual chipset temperature
\param[out]     pChipsetTemp Pointer to a variable that receives chipset temperature in Kelvins
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetChipsetTemp (
	KEAPI_PINT32 pChipsetTemp
);

/**
\brief          Provides information about actual system temperature
\param[out]     pSystemTemp Pointer to a variable that receives system temperature in Kelvins
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetSystemTemp (
	KEAPI_PINT32 pSystemTemp
);

/*****************************************************************************
 * Voltage sensors information
 ****************************************************************************/

/**
\brief          Provides number of voltage sensors
\param[out]     pVoltageSensorCount Pointer to the voltage sensors count
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetVoltageSensorCount (
	KEAPI_PINT32 pVoltageSensorCount
);

/**
\brief          Provides information about voltage sensors in the structure VOLTAGE_SENSOR
\param[in]      voltageSensorCount Number of sensors, obtained from the function keapiGetVoltageSensorCount
\param[out]     pVoltageSensors Pointer to the voltage sensors structure VOLTAGE_SENSOR
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetVoltageSensorList (
	PVOLTAGE_SENSOR pVoltageSensors,
	KEAPI_INT32 voltageSensorCount
);

/**
\brief          Provides current voltage value of a selected voltage sensor
\param[in]      voltageSensorNr Number (index) of a voltage sensor you are interested in. Numbers start with 0 
\param[out]     pVoltageSensorValue Pointer to the value of the selected sensor, in millivolts 
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetVoltageSensorValue (
	KEAPI_INT32 voltageSensorNr,
	KEAPI_PINT32 pVoltageSensorValue
);

/*****************************************************************************
 * Fan control
 ****************************************************************************/


/**
\brief          Provides number of fans
\param[out]     pFanCount Pointer to number of fans
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetFanCount (
	KEAPI_PINT32 pFanCount
);

/**
\brief          Provides information about fans
\param[in]      fanCount Number of fans, which can be obtained from the keapiGetFanCount function
\param[out]     pFans Pointer to PFAN structure
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetFanList (
	PFAN pFans,
	KEAPI_INT32 fanCount
);

/**
\brief          Provides information about fan speed
\param[in]      fanNr Number (index) of a fan you are interested in. Fan numbers start with 0
\param[out]     pwm Returned fan speed in pwm. Can be set to NULL if not wanted.
\param[out]     rpm Returned fan speed in rpm. Can be set to NULL if not wanted.
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetFanSpeed (
	KEAPI_INT32 fanNr,
	KEAPI_PUINT8 pwm,
	KEAPI_PINT32 rpm
);

/**
\brief          Provides information about fan mode.
*  - Maximal speed: FAN_METHOD_MAX_SPEED, 0
*  - Manual control: FAN_METHOD_MANUAL, 1
*  - Thermal cruise: FAN_METHOD_THERMAL_CRUISE, 2
\param[in]      fanNr Number (index) of a fan you are interested in. Fan numbers start with 0.
\param[out]     fanMode Mode in which the fan currently is (max speed, manual control, thermal cruise). 
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetFanMode (
	KEAPI_UINT32 fanNr,
	KEAPI_PUINT8 fanMode
);

/**
\brief          Sets the fan into manual control mode 
\param[in]      fanNr Number (index) of a fan you are interested in. Fan numbers start with 0.
\param[in]      targetPwm Desired speed of the fan, in pwm, must be in a range of 0 - 255 (full speed)
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiSetFanModeManual (
	KEAPI_INT32 fanNr,
	KEAPI_UINT8 targetPwm
);

/**
\brief          Sets the fan into thermal cruise mode 
\param[in]      fanNr Number (index) of a fan you are interested in. Fan numbers start with 0.
\param[in]      targetTemp What temperature should not be exceeded, in millidegrees 
\param[in]      toleranceTemp Tolerance of the target temperature. The controlled temperature should fluctuate around the target temperature within given tolerance. I.e. If the target temperature is 30 degrees Celsius, and the toleranece is set to 2 degrees Celsius, then the temperature is controlled in the range of 28 - 32 degrees Celsius. 30 degrees can be therefore exceeded, but 32 degrees 
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiSetFanModeThermalCruise (
	KEAPI_UINT32 fanNr,
	KEAPI_UINT32 targetTemp,
	KEAPI_UINT32 toleranceTemp
);

/**
\brief          Provides information about CPU fan speed (revolutions per minute)
\param[out]     pCpuFanRpm   Pointer to a variable that receives cpu fan rpm
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetCpuFanSpeed (
	KEAPI_PINT32 pCpuFanRpm
);

/**
\brief          Sets speed of CPU fan using Pulse Width Modulation
\param[in]      cpuFanSpeedPwm Required CPU fan speed pwm 0 - 255 (max. speed)
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiSetCpuFanSpeed (
	KEAPI_UINT8 cpuFanSpeedPwm
);

/**
\brief          Provides information about system fan speed (revolutions per minute)
\param[out]     pSystemFanRpm  Pointer to a variable that receives system fan rpm
* RETURNS: 
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetSystemFanSpeed (
	KEAPI_PINT32 pSystemFanRpm
);

/**
\brief          Sets speed of system fan using Pulse Width Modulation.
\param[in]      systemFanSpeedPwm  Required system fan speed pwm 0 - 255 (max. speed)
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiSetSystemFanSpeed (
	KEAPI_UINT8 systemFanSpeedPwm
);

/*****************************************************************************
 * Storage area
 ****************************************************************************/

/**
\brief          Provides information about EEPROM storage areas count
\param[out]     pStorageCount Number of available storage areas
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetStorageCount(
    KEAPI_PINT32 pStorageCount
);

/**
\brief          Provides information about EEPROM storage area sizes 
\param[in]      storageNr Number of the storage area. Number of storage areas can be obtained from the keapiGetStorageCount function
\param[out]     pStorageSize  Pointer to array of sizes of available storage areas. Length of the array is StorageCount * sizeof(KEAPI_INT32)
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiGetStorageSize (
	KEAPI_INT32 storageNr,
	KEAPI_PINT32 pStorageSize
);

/**
\brief          Reads block of bytes from selected EEPROM
\param[in]      storageNr    EEPROM storage number. Number of storage areas can be obtained from keapiGetStorageCount function
\param[in]      offset       Start address offset
\param[out]     pData      Pointer to buffer that receives data
\param[in]      dataLength    Number of bytes to read
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiStorageRead (
	KEAPI_INT32 storageNr,
	KEAPI_INT32 offset,
	KEAPI_PUINT8 pData,
	KEAPI_INT32 dataLength
);

/**
\brief          Writes block of bytes to selected EEPROM
\param[in]      storageNr    EEPROM storage number. Number of storage areas can be obtained FROM keapiGetStorageCount function
\param[in]      offset       Start address offset
\param[in]      pData      Pointer to buffer that contains data to write to EEPROM
\param[in]      dataLength    Number of bytes to write
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiStorageWrite (
	KEAPI_INT32 storageNr,
	KEAPI_INT32 offset,
	KEAPI_PUINT8 pData,
	KEAPI_INT32 dataLength
);

/*****************************************************************************
 * I2C
 ****************************************************************************/

IMPORT KEAPI_RETVAL keapiGetI2cBusCount (
	KEAPI_PUCHAR pI2cBusCount
); 

IMPORT KEAPI_RETVAL keapiI2cWrite(
        KEAPI_UCHAR     i2cNr,
        KEAPI_UCHAR     i2cAddress,
        KEAPI_UCHAR     memoryAddress,
        KEAPI_PUCHAR    pData,
        KEAPI_UINT32    dataLength
);

IMPORT KEAPI_RETVAL keapiI2cRead (
	KEAPI_UCHAR i2cNr,
	KEAPI_UCHAR i2cAddress,
	KEAPI_UCHAR memoryAddress,
	KEAPI_BOOL memoryAddressUsed,
	KEAPI_PUCHAR pData,
	KEAPI_PUINT32 pDataLength
); 

/*****************************************************************************
 * SMBus
 ****************************************************************************/

IMPORT KEAPI_RETVAL keapiGetSmbusCount (
	KEAPI_PUCHAR pSmbusCount
); 

IMPORT KEAPI_RETVAL keapiSmbusQuickCommand (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR operation
); 

IMPORT KEAPI_RETVAL keapiSmbusSendByte(
        KEAPI_UCHAR     smbusNr,
        KEAPI_UCHAR     smbusAddress,
        KEAPI_UCHAR     byte
);

IMPORT KEAPI_RETVAL keapiSmbusReceiveByte (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_PUCHAR pByte
); 

IMPORT KEAPI_RETVAL keapiSmbusWriteByte (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_UCHAR byte
); 

IMPORT KEAPI_RETVAL keapiSmbusReadByte (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_PUCHAR pByte
); 

IMPORT KEAPI_RETVAL keapiSmbusWriteWord (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_UINT16 word
); 

IMPORT KEAPI_RETVAL keapiSmbusReadWord (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_PUINT16 pWord
); 

IMPORT KEAPI_RETVAL keapiSmbusWriteBlock (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_PUCHAR pData,
	KEAPI_UCHAR dataLength
);

IMPORT KEAPI_RETVAL keapiSmbusReadBlock (
	KEAPI_UCHAR smbusNr,
	KEAPI_UCHAR smbusAddress,
	KEAPI_UCHAR command,
	KEAPI_PUCHAR pData,
	KEAPI_PUCHAR pDataLength
); 

/*****************************************************************************
 * GPIO
 ****************************************************************************/

IMPORT KEAPI_RETVAL keapiGpioGetCount(
        KEAPI_PUINT32   pGpioCount
);

IMPORT KEAPI_RETVAL keapiGpioGetDirectionCaps (
	KEAPI_UINT32 gpioNr,
	KEAPI_PBOOL pIsInput,
	KEAPI_PBOOL pIsOutput
);

IMPORT KEAPI_RETVAL keapiGpioGetDirection (
	KEAPI_UINT32 gpioNr,
	KEAPI_PUCHAR pDirection
); 

IMPORT KEAPI_RETVAL keapiGpioSetDirection (
	KEAPI_UINT32 gpioNr,
	KEAPI_UCHAR  direction
); 

IMPORT KEAPI_RETVAL keapiGpioGetLevel (
	KEAPI_UINT32 gpioNr,
	KEAPI_PUCHAR pLevel
); 

IMPORT KEAPI_RETVAL keapiGpioSetLevel(
        KEAPI_UINT32    gpioNr,
        KEAPI_UCHAR     level
);

/*****************************************************************************
 * Watchdog
 ****************************************************************************/

/**
\brief          Enables the watchdog
\param[in]      timeout  Watchdog timeout interval in milliseconds
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiWatchdogEnable (
	KEAPI_INT32 timeout
);

/**
\brief          Disables the watchdog
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiWatchdogDisable(void);

/**
\brief          Triggers the WatchDog timer
* RETURNS:          
* - KEAPI_RET_SUCCESS on success
* - KEAPI_RET_NOT_INITIALIZED when library is not initialized
*/
IMPORT KEAPI_RETVAL keapiWatchdogTrigger(void);

#ifdef __cplusplus
} // #ifdef __cplusplus
#endif

#endif  /* KEAPIVXW_H */

