/*********************************************************************//**
 * @brief 		Update WDT timeout value and feed
 * @param[in]	timeout	WDT timeout (us)
 * @return		none
 **********************************************************************/
void WWDT_SetTimeOut(uint32_t timeout)
{
	uint32_t timeoutVal;

	timeoutVal = WDT_GET_FROM_USEC(timeout);

	if(timeoutVal < WWDT_TIMEOUT_MIN)
	{
		timeoutVal = WWDT_TIMEOUT_MIN;
	}
	else if (timeoutVal > WWDT_TIMEOUT_MAX)
	{
		timeoutVal = WWDT_TIMEOUT_MAX;
	}

	LPC_WWDT->TC = timeoutVal;
}
/********************************************************************//**
 * @brief 		Update WDT timeout value and feed
 * @param[in]	WindowedTime	expected time to set watchdog window event(us)
 * @return		none
 *********************************************************************/
void WWDT_SetWindow(uint32_t WindowedTime)
{
	uint32_t wndVal;

	wndVal = WDT_GET_FROM_USEC(WindowedTime);

	if(wndVal <= WWDT_WINDOW_MIN)
	{
		wndVal = WWDT_WINDOW_MIN;
	}
	else if (wndVal >= WWDT_WINDOW_MAX)
	{
		wndVal = WWDT_WINDOW_MAX;
	}

	LPC_WWDT->WINDOW = wndVal;
}
/********************************************************************//**
 * @brief 		Update WDT timeout value and feed
 * @param[in]	WarnTime	time to generate watchdog warning interrupt(us)
 * 				should be in range: 2048 .. 8192
 * @return		None
 *********************************************************************/
void WWDT_SetWarning(uint32_t WarnTime)
{
	uint32_t warnVal;

	warnVal = WDT_GET_FROM_USEC(WarnTime);

	if(warnVal <= WWDT_WARNINT_MIN)
	{
		warnVal = WWDT_WARNINT_MIN;
	}
	else if (warnVal >= WWDT_WARNINT_MAX)
	{
		warnVal = WWDT_WARNINT_MAX;
	}

	LPC_WWDT->WARNINT = warnVal;
}
Beispiel #4
0
/********************************************************************//**
 * @brief       Set WDT timeout (cal by usec) to TC register
 *
 * @param[in]   timeout The time (usec) to generate watchdog event if 
 *              the watchdog counter reach this value
 *
 * @return      WWDT_FUNC_OK if success
 *********************************************************************/
int8_t WWDT_SetTimeOut(uint32_t timeout)
{
    return WWDT_SetTimeOutRaw(WDT_GET_FROM_USEC(timeout));
}
Beispiel #5
0
/********************************************************************//**
 * @brief       Update WDT Windows value (by usec) to Window Register
 *              of WatchDog
 *
 * @param[in]   WindowedTime Expected time (usec) to set watchdog window event
 *
 * @return      WWDT_FUNC_OK if success
 *********************************************************************/
int8_t WWDT_SetWindow(uint32_t WindowedTime)
{
    return WWDT_SetWindowRaw(WDT_GET_FROM_USEC(WindowedTime));
}
Beispiel #6
0
/********************************************************************//**
 * @brief       Update WDT warning time (cal by usec) to warning register
 *
 * @param[in]   WarnTime The time (usec) to generate watchdog warning
 *              interrupt should be in range: 2048 .. 8192
 *
 * @return      WWDT_FUNC_OK if success
 *********************************************************************/
int8_t WWDT_SetWarning(uint32_t WarnTime)
{
    return WWDT_SetWarningRaw(WDT_GET_FROM_USEC(WarnTime));
}