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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sndstimer.c

?? 三星公司出arm7內核4510VXWORKS環境下驅動開發包
?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一综合色| 日韩av电影天堂| 国内外成人在线视频| 欧美日韩成人一区| 亚洲人xxxx| 99久久久久久99| 1区2区3区精品视频| 丰满放荡岳乱妇91ww| 国产亚洲精品7777| 国产不卡视频在线观看| 国产欧美一区在线| 国产精品中文字幕欧美| 2023国产精品视频| 国产精品一卡二卡在线观看| 亚洲精品在线三区| 激情国产一区二区| 精品国产在天天线2019| 紧缚捆绑精品一区二区| 精品国产精品网麻豆系列| 久久电影网电视剧免费观看| 日韩欧美国产小视频| 国内精品免费在线观看| 精品国产一区二区三区久久影院| 激情深爱一区二区| 久久久亚洲国产美女国产盗摄 | 精品在线一区二区| 欧美va在线播放| 国产一区二区不卡老阿姨| 久久综合久久鬼色| 成人免费观看av| 亚洲视频一区二区在线| 91黄色免费网站| 午夜精品福利在线| 日韩一区二区免费视频| 久久国产夜色精品鲁鲁99| 国产日韩一级二级三级| 99久久精品国产一区| 一区二区三区不卡视频| 8v天堂国产在线一区二区| 久久综合综合久久综合| 国产亚洲综合在线| 99国产欧美久久久精品| 亚洲一区二区三区精品在线| 在线成人免费视频| 国产精品综合在线视频| 中文字幕亚洲一区二区av在线| 色哟哟一区二区在线观看| 亚洲成国产人片在线观看| 欧美一区二区久久| 国产成人精品亚洲午夜麻豆| 中文字幕中文字幕在线一区| 欧美午夜精品一区二区三区 | 亚洲国产另类精品专区| 91精品国产综合久久久久| 国产一区二区美女| 亚洲女厕所小便bbb| 欧美精品v日韩精品v韩国精品v| 精品一区二区精品| 国产精品国产自产拍高清av王其| 欧美午夜精品久久久| 久久精工是国产品牌吗| 中文字幕一区二区在线观看| 欧美久久一区二区| 国产999精品久久久久久绿帽| 亚洲精品第1页| 精品国产一区二区三区不卡| 91视频一区二区| 青青国产91久久久久久| 国产精品无人区| 欧美精品在线观看一区二区| 国产精品一区二区在线观看不卡 | 日韩视频一区二区三区在线播放| 国产成人免费在线视频| 午夜视黄欧洲亚洲| 国产欧美日韩三级| 欧美三级蜜桃2在线观看| 国产高清不卡一区| 亚洲永久精品国产| 久久精品视频一区二区三区| 欧美日韩aaa| 成人91在线观看| 日韩黄色小视频| 亚洲色图视频免费播放| 精品国产1区二区| 欧洲在线/亚洲| 国产91丝袜在线播放| 视频在线观看国产精品| 最新不卡av在线| 2017欧美狠狠色| 欧美日韩欧美一区二区| av高清久久久| 欧美久久一区二区| 色悠悠久久综合| 国产成人av一区二区三区在线| 亚洲成va人在线观看| 成人免费一区二区三区视频| 久久久夜色精品亚洲| 666欧美在线视频| 色哟哟一区二区| 国产不卡在线播放| 久久97超碰国产精品超碰| 亚洲一区二区三区视频在线播放| 国产精品乱人伦中文| 精品国产一区二区三区忘忧草 | 欧美日韩第一区日日骚| 99久久精品免费看| 国产精品综合久久| 麻豆91在线看| 日本不卡一区二区三区高清视频| 亚洲免费观看高清完整版在线| 久久精品亚洲国产奇米99| 欧美电影免费观看高清完整版在线观看| 在线免费观看一区| a美女胸又www黄视频久久| 韩国欧美一区二区| 美女免费视频一区| 日韩一区欧美二区| 亚洲国产视频直播| 一区二区三区欧美日韩| 国产精品国产馆在线真实露脸| 久久蜜臀精品av| 亚洲精品一区二区精华| 日韩一级精品视频在线观看| 欧美精品久久天天躁| 欧美性videosxxxxx| 91福利视频在线| 色综合天天综合给合国产| 不卡一区二区在线| 成人黄色在线网站| 国产ts人妖一区二区| 国产精品一区二区视频| 国产一区高清在线| 激情久久五月天| 国产在线不卡一卡二卡三卡四卡| 久久99精品一区二区三区| 精品在线视频一区| 国产一区二区视频在线| 国产伦理精品不卡| 国产精品99久久久久久久女警 | 成人亚洲一区二区一| 懂色av噜噜一区二区三区av| 盗摄精品av一区二区三区| 成人免费高清视频| 99精品热视频| 欧美在线播放高清精品| 欧美日韩综合色| 欧美一区二区福利在线| 精品久久久久香蕉网| 久久久av毛片精品| 国产精品久线在线观看| 亚洲色图丝袜美腿| 午夜精品福利在线| 另类欧美日韩国产在线| 国产精品一区二区无线| 97se狠狠狠综合亚洲狠狠| 91久久精品网| 欧美一区二区三区在线观看 | 色综合久久久久| 欧美少妇xxx| 欧美高清激情brazzers| 欧美一区二区精品久久911| 4hu四虎永久在线影院成人| a级精品国产片在线观看| 在线观看欧美日本| 欧美疯狂做受xxxx富婆| 日韩一区二区三区精品视频| 欧美精品乱码久久久久久按摩| 91精品国产入口在线| 日韩免费电影网站| 欧美成va人片在线观看| 久久久久国产精品免费免费搜索| 久久久久久久电影| 亚洲日本青草视频在线怡红院| 亚洲精品ww久久久久久p站| 亚洲动漫第一页| 毛片av一区二区| 成人h动漫精品一区二区| 91视频观看视频| 欧美日韩精品一区二区三区| 欧美剧情电影在线观看完整版免费励志电影| 在线看日本不卡| 7777精品伊人久久久大香线蕉最新版| 欧美一区二区三区免费视频| 精品乱码亚洲一区二区不卡| 国产婷婷一区二区| 亚洲精品高清在线| 韩国一区二区视频| av电影在线观看不卡| 欧美视频日韩视频| 欧美在线观看禁18| 26uuu色噜噜精品一区| 中文字幕中文字幕在线一区| 偷拍一区二区三区| 成人高清免费观看| 欧美日韩综合在线| 久久精品人人做人人爽97| 亚洲视频在线一区二区| 日韩av中文字幕一区二区| 国产成人免费网站| 欧美午夜在线一二页|