亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sndstimer.c

?? 三星官方基于VXWORKS的S3C2510的BSP
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* sndsTimer.c - Samsung SNDS100 timer library */

/*
modification history
--------------------
01b,27sep99.nb  added timestamp support and documentation	
01a,21aug99.knp  snds specific timer, adapted from WRS template
*/

/*

DESCRIPTION
Samsung's SNDS100 Ver 1.0 board is an evaluation board for their KS32C50100
microprocessor.  This is an ARM based processor with several integrated peripherals.
It has an interrupt controller, two 32-bit timers, one Ethernet controller,
two HDLC controllers, one IIC controller, general purpose I/O ports, and a 
2-channel DMA controller.

The 32-bit timers can be programmed in interval mode or toggle mode.  In
interval mode, an output pulse is generated when the countdown value in
the count register reaches  zero.  This will generate a pule frequency of
(SYSCLK/count).  On the other hand, in the toggle mode, the output toggles
its state for each time the countdown value reaches zero.  In this case, the
output frequency will be (SYSCLK/(2*count)).

The Timer Data register is used to load the countdown value.  When the timer
is enabled using the Timer Mode register, the Timer Count register is loaded
with the count in Timer Data register.  The count value is decremented for every
internal clock edge.  Once the count becomes zero, an interrupt is generated
(if enabled in the interrupt controller) and the Timer Count register is
reloaded automatically.

The internal timer registers are accessed in a straight-forward fashion.
They are accessible as 32-bit integers from the internal system register
offsets, as given in sndstimer.h file.  The macros SNDS_TIMER_REG_WRITE
and SNDS_TIMER_REG_READ does nothing but reading and writing 32-bit
integers from and to the given addresses.

This driver provides 3 main functions, system clock support, auxilliary
clock support, and timestamp timer support.  If necessary, each function
may be conditioned by a separate INCLUDE_ macro.  The timestamp function
is always conditional upon the INCLUDE_TIMESTAMP macro.

The SNDS100 timer register definitions are given in sndstimer.h file.

The macros SYS_CLK_RATE_MIN, SYS_CLK_RATE_MAX, AUX_CLK_RATE_MIN, and
AUX_CLK_RATE_MAX must be defined in snds100.h to provide parameter checking 
for the sys[Aux]ClkRateSet() routines.

INCLUDES:
sndstimer.h
timestampDev.h
*/

/* includes */

#include "vxWorks.h"
#include "config.h"
#include "drv/timer/timerDev.h"
#include "drv/timer/timestampDev.h"
#include "sndsTimer.h"

/* defines */

/* The default is to assume memory mapped I/O */

#ifndef SNDS_TIMER_REG_READ
#define SNDS_TIMER_REG_READ(reg, result) \
	((result) = *(volatile UINT32 *)(reg))
#endif /*SNDS_TIMER_READ*/

#ifndef SNDS_TIMER_REG_WRITE
#define SNDS_TIMER_REG_WRITE(reg, data) \
	(*((volatile UINT32 *)(reg)) = (data))
#endif /*SNDS_TIMER_WRITE*/

#ifndef SNDS_TIMER_INT_ENABLE
#define SNDS_TIMER_INT_ENABLE(level) intEnable(level)
#endif

#ifndef SNDS_TIMER_INT_DISABLE
#define SNDS_TIMER_INT_DISABLE(level) intDisable(level)
#endif


/* locals */

LOCAL FUNCPTR sysClkRoutine	= NULL; /* routine to call on clock tick */
LOCAL int sysClkArg		= NULL; /* its argument */
LOCAL int sysClkRunning		= FALSE;
LOCAL int sysClkTicksPerSecond	= 60;

LOCAL FUNCPTR sysAuxClkRoutine	= NULL;
LOCAL int sysAuxClkArg		= NULL;
LOCAL int sysAuxClkRunning	= FALSE;
LOCAL int sysAuxClkTicksPerSecond = 100;
LOCAL int sysAuxClkTicks;

#ifdef INCLUDE_TIMESTAMP

LOCAL BOOL	sysTimestampRunning	= FALSE; /* running flag */
LOCAL int	sysTimestampPeriodValue	= NULL;  /* Max counter value */
LOCAL FUNCPTR	sysTimestampRoutine	= NULL;  /* routine to call on intr */
LOCAL int	sysTimestampArg		= 0;     /* arg for routine */
      void	sysTimestampInt (void);		 /* forward declaration */

#endif  /* INCLUDE_TIMESTAMP */


/*******************************************************************************
*
* sysClkInt - interrupt level processing for system clock
*
* This routine handles an system clock interrupt.  It acknowledges the
* interrupt and calls the routine installed by sysClkConnect().
*/

void sysClkInt (void)
    {

	/* call system clock service routine */

	if (sysClkRoutine != NULL)
		(* sysClkRoutine) (sysClkArg);
    }


/*******************************************************************************
*
* sysClkConnect - connect a routine to the system clock interrupt
*
* This routine specifies the interrupt service routine to be called at each
* clock interrupt.  Normally, it is called from usrRoot() in usrConfig.c to 
* connect usrClock() to the system clock interrupt.
*
* RETURN: OK, or ERROR if the routine cannot be connected to the interrupt.
*
* SEE ALSO: intConnect(), usrClock(), sysClkEnable()
*/

STATUS sysClkConnect
    (
    FUNCPTR routine,	/* routine to be called at each clock interrupt */
    int arg		/* argument with which to call routine */
    )
    {
    static BOOL beenHere = FALSE;

    if (!beenHere)
	{
	beenHere = TRUE;
	sysHwInit2 ();
	}

    sysClkRoutine   = NULL;
    sysClkArg	    = arg;
    sysClkRoutine   = routine;

    return (OK);
    }


/*******************************************************************************
*
* sysClkDisable - turn off system clock interrupts
*
* This routine disables system clock interrupts.
*
* RETURNS: N/A
*
* SEE ALSO: sysClkEnable()
*/

void sysClkDisable (void)
    {

    int oier;
    
    if (sysClkRunning)
	{
		
	SNDS_TIMER_REG_READ (SNDS_TIMER_TMOD, oier);
        SNDS_TIMER_REG_WRITE (SNDS_TIMER_TMOD, oier & ~(1));
	
	/* disable timer interrupt in the interrupt controller */
	
	SNDS_TIMER_INT_DISABLE (SYS_TIMER_INT_LVL);

	sysClkRunning = FALSE;
	}
    }


/*******************************************************************************
*
* sysClkEnable - turn on system clock interrupts
*
* This routine enables system clock interrupts.
*
* RETURNS: N/A
*
* SEE ALSO: sysClkConnect(), sysClkDisable(), sysClkRateSet()
*/

void sysClkEnable (void)
    {
    UINT32 oier;
    int sysClkTicks;

    if (!sysClkRunning)
	{
	/*

	 * Calculate the number of ticks of the timer clock that this
	 * period requires.  Do this once, here, so that the timer interrupt
	 * routine does not need to perform a division.
	 */
	sysClkTicks = (SYS_TIMER_CLK / sysClkTicksPerSecond);

	/*
	 * Load the match register with a new value calculated by
	 * adding the ticks per interrupt to the current value of the
	 * counter register.  Note that this may wraparound to a value
	 * less than the current counter value but that's OK.
	 */

	SNDS_TIMER_REG_WRITE (SNDS_TIMER_TDATA_0, sysClkTicks);

	SNDS_TIMER_REG_READ (SNDS_TIMER_TMOD,oier);
	SNDS_TIMER_REG_WRITE (SNDS_TIMER_TMOD, oier|1);

	/* enable clock interrupt in interrupt controller */

	SNDS_TIMER_INT_ENABLE (SYS_TIMER_INT_LVL);
	sysClkRunning = TRUE;
	}
    }


/*******************************************************************************
*
* sysClkRateGet - get the system clock rate
*
* This routine returns the system clock rate.
*
* RETURNS: The number of ticks per second of the system clock.
*
* SEE ALSO: sysClkEnable(), sysClkRateSet()
*/

int sysClkRateGet (void)
    {
    return (sysClkTicksPerSecond);
    }


/*******************************************************************************
*
* sysClkRateSet - set the system clock rate
*
* This routine sets the interrupt rate of the system clock.
* It is called by usrRoot() in usrConfig.c.
*
* RETURNS: OK, or ERROR if the tick rate is invalid or the timer cannot be set.
*
* SEE ALSO: sysClkEnable(), sysClkRateGet()
*/

STATUS sysClkRateSet
    (
    int ticksPerSecond	    /* number of clock interrupts per second */
    )
    {
    if (ticksPerSecond < SYS_CLK_RATE_MIN || ticksPerSecond > SYS_CLK_RATE_MAX)
	return (ERROR);

    sysClkTicksPerSecond = ticksPerSecond;

    if (sysClkRunning)
	{
	sysClkDisable ();
	sysClkEnable ();
	}

    return (OK);
    }

/*******************************************************************************
*
* sysAuxClkInt - handle an auxiliary clock interrupt
*
* This routine handles an auxiliary clock interrupt.  It acknowledges the
* interrupt and calls the routine installed by sysAuxClkConnect().
*
* RETURNS: N/A
*/

void sysAuxClkInt (void)
    {
    /* call auxiliary clock service routine */

    if (sysAuxClkRoutine != NULL)
	(*sysAuxClkRoutine) (sysAuxClkArg);
    }

/*******************************************************************************
*
* sysAuxClkConnect - connect a routine to the auxiliary clock interrupt
*
* This routine specifies the interrupt service routine to be called at each
* auxiliary clock interrupt.  It does not enable auxiliary clock interrupts.
*
* RETURNS: OK, or ERROR if the routine cannot be connected to the interrupt.
*
* SEE ALSO: intConnect(), sysAuxClkEnable()
*/

STATUS sysAuxClkConnect

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色一区在线观看| 欧美日韩成人在线一区| 自拍偷拍国产亚洲| 在线看国产一区二区| 国产精品伦理一区二区| 91成人免费在线| 日韩av电影免费观看高清完整版| 精品日韩欧美在线| 91视频免费看| 麻豆成人久久精品二区三区红| 成人欧美一区二区三区白人| 日韩亚洲欧美一区| 欧美三电影在线| 99久久免费视频.com| 国精产品一区一区三区mba桃花| 亚洲影院免费观看| 国产精品成人免费| 久久精品视频在线免费观看| 欧美一级欧美一级在线播放| 色一情一乱一乱一91av| 国产成人综合在线观看| 秋霞午夜鲁丝一区二区老狼| 亚洲第一二三四区| 一区二区三区日韩欧美精品| 欧美激情综合五月色丁香| 亚洲精品一区在线观看| 欧美一区国产二区| 欧美日韩激情一区二区三区| 99国内精品久久| 成人黄色综合网站| 国产精品88av| 国产资源在线一区| 精品亚洲成a人| 日本中文字幕一区二区有限公司| 亚洲国产美女搞黄色| 亚洲美女视频在线观看| 亚洲欧洲www| 亚洲日本va午夜在线影院| 国产农村妇女毛片精品久久麻豆| 国产午夜精品一区二区三区四区 | 国产在线精品一区在线观看麻豆| 午夜精品久久久久影视| 午夜精品一区二区三区三上悠亚| 亚洲成人7777| 丝袜美腿高跟呻吟高潮一区| 丝袜美腿高跟呻吟高潮一区| 石原莉奈一区二区三区在线观看| 亚洲成人av福利| 免费高清在线一区| 精品系列免费在线观看| 黄网站免费久久| 国产suv一区二区三区88区| 国产成人自拍网| 成人爽a毛片一区二区免费| 成人av中文字幕| 91蝌蚪porny| 欧美视频日韩视频在线观看| 欧美性猛交一区二区三区精品| 欧美日韩在线亚洲一区蜜芽| 91精品国产福利| 精品粉嫩aⅴ一区二区三区四区| 2021中文字幕一区亚洲| 国产精品每日更新在线播放网址| 亚洲欧美在线观看| 亚洲国产一区二区在线播放| 日韩国产精品久久| 国产精品一区二区x88av| 成人激情综合网站| 欧美三区在线视频| 日韩免费电影网站| 中文字幕欧美日本乱码一线二线| 亚洲欧美中日韩| 亚洲电影一级片| 精品一区二区免费视频| av午夜精品一区二区三区| 欧洲一区二区av| 欧美一区二区黄| 欧美激情一二三区| 亚洲一区视频在线| 国产在线国偷精品产拍免费yy| 粉嫩aⅴ一区二区三区四区| 欧美午夜精品理论片a级按摩| 在线播放欧美女士性生活| 久久久久国产一区二区三区四区 | 美女精品一区二区| 国产成人在线观看免费网站| 日本道色综合久久| 日韩精品一区二区在线| 日韩美女啊v在线免费观看| 亚洲韩国精品一区| 国产一区二区三区久久久 | 久久九九99视频| 亚洲国产中文字幕| 国产不卡视频一区二区三区| 精品视频在线免费| 欧美国产激情一区二区三区蜜月 | 日韩福利电影在线| 成人黄色777网| 日韩一区二区电影网| 国产精品久久久久久久久免费相片| 日韩专区欧美专区| 91麻豆123| 国产亚洲成aⅴ人片在线观看| 香蕉影视欧美成人| 不卡一区中文字幕| 精品国产乱码久久久久久浪潮 | 激情综合色综合久久综合| 色综合色狠狠综合色| 久久香蕉国产线看观看99| 亚洲一区二区三区三| 白白色亚洲国产精品| 精品国产百合女同互慰| 亚洲国产精品久久不卡毛片| 99国内精品久久| 久久久久久久综合日本| 免费在线看成人av| 欧美日韩一区二区欧美激情| 中文字幕在线不卡一区| 狠狠色狠狠色综合| 欧美一区二区三区小说| 性做久久久久久久免费看| 色综合久久综合网97色综合| 国产清纯美女被跳蛋高潮一区二区久久w| 午夜久久久影院| 欧美曰成人黄网| 综合中文字幕亚洲| 丁香亚洲综合激情啪啪综合| 亚洲精品一区二区三区精华液| 日本欧美一区二区三区| 在线成人免费观看| 午夜精品爽啪视频| 欧美日韩国产免费| 亚洲v日本v欧美v久久精品| 91成人免费在线| 亚洲国产精品自拍| 欧美日韩国产在线播放网站| 亚洲最色的网站| 色噜噜狠狠色综合中国| 自拍偷拍亚洲欧美日韩| 91看片淫黄大片一级| 一区二区三区四区精品在线视频| 91论坛在线播放| 一区二区三区.www| 色88888久久久久久影院野外 | 国内精品第一页| 久久夜色精品国产欧美乱极品| 国产美女在线精品| 久久亚洲一级片| 国产白丝精品91爽爽久久| 亚洲国产精品v| av在线不卡免费看| 一区二区三区日本| 7777精品伊人久久久大香线蕉完整版| 日本欧美在线观看| 久久久综合九色合综国产精品| 极品美女销魂一区二区三区免费 | 亚洲乱码国产乱码精品精小说| 91精彩视频在线观看| 亚洲国产精品久久人人爱| 欧美日韩五月天| 美腿丝袜亚洲色图| 久久九九久久九九| 91麻豆6部合集magnet| 亚洲va欧美va国产va天堂影院| 日韩欧美一区二区三区在线| 国产自产高清不卡| 亚洲欧美另类在线| 欧美三级三级三级| 国产自产高清不卡| 自拍偷拍国产精品| 91精品国产综合久久久久久久| 国产一区二区视频在线播放| 国产精品毛片久久久久久| 在线精品视频免费播放| 蜜桃视频在线观看一区| 中文字幕 久热精品 视频在线| 欧美色图天堂网| 国产一区二区精品在线观看| 亚洲视频每日更新| 日韩一区二区精品在线观看| 国产大陆精品国产| 亚洲成a人片综合在线| 欧美成人精品二区三区99精品| 成人sese在线| 男女性色大片免费观看一区二区 | 久久久国产一区二区三区四区小说| 99久久免费精品高清特色大片| 日韩成人免费在线| 国产日韩高清在线| 555www色欧美视频| www.欧美日韩国产在线| 美女视频黄 久久| 亚洲乱码国产乱码精品精98午夜| 欧美成人vps| 欧美日韩亚洲高清一区二区| 国产成人亚洲综合a∨猫咪| 午夜伦理一区二区| 中文字幕亚洲视频| 久久久久久99久久久精品网站| 欧美日韩久久久|