Пример #1
0
/*
 * Stop hardware timer.
 * and clear the timer IRQ
 */
void	SkHwtStop(
SK_AC	*pAC,	/* Adapters context */
SK_IOC	Ioc)	/* IoContext */
{
	SK_OUT16(Ioc, B2_TI_CRTL, TIM_STOP) ;
	SK_OUT16(Ioc, B2_TI_CRTL, TIM_CLR_IRQ) ;

	pAC->Hwt.TActive = SK_FALSE ;
}
Пример #2
0
/*
 * Stop hardware timer.
 * and clear the timer IRQ
 */
void SkHwtStop(
SK_AC	*pAC,	/* Adapter Context */
SK_IOC	IoC)	/* I/O Context */
{
	SK_OUT16(IoC, B2_TI_CTRL, TIM_STOP);

	SK_OUT16(IoC, B2_TI_CTRL, TIM_CLR_IRQ);

	pAC->Hwt.TActive = SK_FALSE;
}
/*
 *
 * Start hardware timer (clock ticks are 16us).
 *
 */
void	SkHwtStart(
SK_AC	*pAC,	/* Adapters context */
SK_IOC	Ioc,	/* IoContext */
SK_U32	Time)	/* Time in units of 16us to load the timer with. */
{
	SK_U32	Cnt;

	if (Time > SK_HWT_MAX)
		Time = SK_HWT_MAX;

	pAC->Hwt.TStart = Time;
	pAC->Hwt.TStop = 0L;

	Cnt = Time;

	/*
	 * if time < 16 us
	 *	time = 16 us
	 */
	if (!Cnt) {
		Cnt++;
	}

	SK_OUT32(Ioc, B2_TI_INI, Cnt * SK_HWT_FAC);
	
	SK_OUT16(Ioc, B2_TI_CTRL, TIM_START);	/* Start timer. */

	pAC->Hwt.TActive = SK_TRUE;
}
Пример #4
0
/*
 *
 * Start hardware timer (clock ticks are HW-dependent).
 *
 */
void SkHwtStart(
SK_AC	*pAC,	/* Adapter Context */
SK_IOC	IoC,	/* I/O Context */
SK_U32	Time)	/* Time in usec to load the timer */
{
	if (Time > SK_HWT_MAX) {
		Time = SK_HWT_MAX;
	}

	pAC->Hwt.TStart = Time;
	pAC->Hwt.TStop = 0L;

	if (!Time) {
		Time = 1L;
	}

	SK_OUT32(IoC, B2_TI_INI, Time * SK_HWT_FAC);

	SK_OUT16(IoC, B2_TI_CTRL, TIM_START);	/* Start timer */

	pAC->Hwt.TActive = SK_TRUE;
}