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

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

?? sngks32ctimer.c

?? 440bx vxworks bsp
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* sngks32cTimer.c - Samsung S3C44B0X timer library */


/* Copyright 1984-2001 Wind River Systems, Inc. */
#include "copyright_wrs.h"

/*
modification history
--------------------
01o,27jul04,a_m  BSP定制 for 多刃劍開發(fā)板
01e,19apr02,m_h  sysAuxClkConnect for THUMB
01d,27sep01,m_h  sysClkRateSet() doesn't change the clock rate
01c,18jul01,m_h  Fix timestamp timer
01b,26apr01,m_h  convert tabs to spaces for readability
01a,12apr01,m_h  created from snds100 template.
*/

/*

DESCRIPTION
This is a timer driver for Samsung's KS32C50100 microprocessor which 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 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 sngks32cTimer.h file.  The macros SNGKS32C_TIMER_REG_WRITE
and SNGKS32C_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, auxiliary
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 SNGKS32C ARM7 timer register definitions are given in sngks32cTimer.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 sngks32carm7.h to provide parameter checking 
for the sys[Aux]ClkRateSet() routines.

INCLUDES:
sngks32cTimer.h
timestampDev.h

SEE ALSO:
<Samsung KS32C50100 User's Manual>

*/

/* includes */

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

/* defines */

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

#ifndef SNGKS32C_TIMER_REG_READ
#define SNGKS32C_TIMER_REG_READ(reg, result) \
    ((result) = *(volatile UINT32 *)(reg))
#endif /*SNGKS32C_TIMER_READ*/

#ifndef SNGKS32C_TIMER_REG_WRITE
#define SNGKS32C_TIMER_REG_WRITE(reg, data) \
    (*((volatile UINT32 *)(reg)) = (data))
#endif /*SNGKS32C_TIMER_WRITE*/

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

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


/* locals */

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

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



#ifdef INCLUDE_TIMESTAMP

LOCAL BOOL      sysTimestampRunning     = FALSE;         /* running flag */
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 a 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 */
    )
    {


    if (sysClkConnected == FALSE)
        {
        /*SNGKS32C_TIMER_REG_WRITE (SNGKS32C_TIMER_TMOD, SNGKS32C_TIMER_INITIALIZE);*/
		/*  : deleted and added */
        /*dead zone=0, pre0=100*/
        SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCFG0, 0x00000064);
        /*all interrupt, mux0=1/4*/
        SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCFG1, 0x00000001);
        SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCON, 0x00000000);
        
        sysHwInit2 ();
        sysClkConnected = TRUE;
        }

    sysClkRoutine   = NULL;
    sysClkArg        = arg;

#if ((CPU_FAMILY == ARM) && ARM_THUMB)
    /* set b0 so that sysClkConnect() can be used from shell */
    sysClkRoutine = (FUNCPTR)((UINT32)routine | 1);
#else
    sysClkRoutine = routine;
#endif /* CPU_FAMILY == ARM */

    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;*/	/*  : deleted */
    
    if (sysClkRunning)
        {
      	/*  : deleted */  
        /*SNGKS32C_TIMER_REG_READ (SNGKS32C_TIMER_TMOD, oier);*/
        /*SNGKS32C_TIMER_REG_WRITE (SNGKS32C_TIMER_TMOD, oier & ~(1));*/
		/*  : added */
		SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCON, 0x00000000);
		
        /* disable timer interrupt in the interrupt controller */
    
        SNGKS32C_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;*/	/*  : deleted */

    if (!sysClkRunning)
        {

        /*
         * 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 thats OK.
         */
		/*  : deleted */
        /*SNGKS32C_TIMER_REG_WRITE (SNGKS32C_TIMER_TDATA_0, SYS_TIMER_CLK / sysClkTicksPerSecond);*/
        /*SNGKS32C_TIMER_REG_READ (SNGKS32C_TIMER_TMOD,oier);*/
        /*SNGKS32C_TIMER_REG_WRITE (SNGKS32C_TIMER_TMOD, oier|1);*/

		/*  : added */
		/*set T0 count*/
		SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCNTB0, (165*(1000/sysClkTicksPerSecond)));
        /*update T0*/
        SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCON, 0x00000002);
        /*auto reload and start T0*/
		SNGKS32C_TIMER_REG_WRITE (S3C44B0X_TCON, 0x00000009);
        
        /* enable clock interrupt in interrupt controller */
        
        SNGKS32C_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);

    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97精品视频在线观看自产线路二| 日韩欧美精品三级| 97se亚洲国产综合在线| 福利一区二区在线| 成人免费看的视频| 粉嫩aⅴ一区二区三区四区五区| 狠狠色丁香婷综合久久| 狠狠色丁香婷婷综合久久片| 韩国三级电影一区二区| 国产一区二区三区四区在线观看| 国内精品在线播放| 成人性视频网站| 99精品欧美一区二区蜜桃免费| 91网站在线播放| 欧美日韩在线播放三区| 欧美一区二区三区成人| 精品国产91亚洲一区二区三区婷婷| 精品国产髙清在线看国产毛片 | www国产成人| 精品盗摄一区二区三区| 国产色产综合色产在线视频| 中文字幕一区二区三区视频| 亚洲午夜一区二区三区| 免费观看30秒视频久久| 国产精品伊人色| 97久久精品人人澡人人爽| 欧美日韩国产高清一区二区 | 欧美狂野另类xxxxoooo| 91精品国产综合久久精品性色| 4hu四虎永久在线影院成人| 精品日韩99亚洲| 国产精品久久久久久久久动漫| 樱花草国产18久久久久| 日韩精品久久久久久| 国产精品香蕉一区二区三区| 在线观看日韩电影| 日韩欧美高清在线| 中文字幕在线播放不卡一区| 性欧美疯狂xxxxbbbb| 国产乱码精品一区二区三区五月婷 | 久久99久久久欧美国产| 粉嫩一区二区三区性色av| 在线视频综合导航| 久久伊人中文字幕| 亚洲视频在线一区| 九九热在线视频观看这里只有精品| 成人午夜激情在线| 717成人午夜免费福利电影| 国产视频一区二区在线| 偷拍自拍另类欧美| a级高清视频欧美日韩| 欧美一级国产精品| 亚洲人一二三区| 久久国内精品视频| 91污片在线观看| 久久毛片高清国产| 亚洲国产裸拍裸体视频在线观看乱了 | 精品免费99久久| 亚洲色欲色欲www| 精彩视频一区二区三区| 在线视频中文字幕一区二区| 国产欧美日韩中文久久| 日本亚洲最大的色成网站www| 国产福利91精品一区| 欧美日韩精品免费| 免费观看在线综合| 一区二区三区产品免费精品久久75| 亚洲天堂av一区| 国内精品伊人久久久久av影院 | 欧美精品久久99久久在免费线 | 国产欧美日韩精品一区| 精品久久人人做人人爰| 精品久久久久av影院 | 精品国产亚洲一区二区三区在线观看| 欧美性淫爽ww久久久久无| 91社区在线播放| 91理论电影在线观看| caoporn国产一区二区| 99re免费视频精品全部| 99精品视频一区| 日本电影亚洲天堂一区| 色94色欧美sute亚洲线路一久| 一本一道综合狠狠老| 91高清视频在线| 欧美日韩中文另类| 欧美一区二区视频在线观看2020 | 欧美在线观看一二区| 欧美性一二三区| 欧美女孩性生活视频| 欧美猛男超大videosgay| 欧美日韩综合一区| 欧美一区二区三区视频在线| 欧美不卡激情三级在线观看| 国产亚洲一区二区三区四区| 国产欧美日韩精品a在线观看| 中文字幕一区二区三区av| 夜夜爽夜夜爽精品视频| 日本中文字幕一区二区视频| 韩国av一区二区| 91在线看国产| 5566中文字幕一区二区电影| 欧美精品一区二区久久婷婷| 国产精品色一区二区三区| 亚洲精品久久7777| 日韩av电影免费观看高清完整版| 久草中文综合在线| 白白色 亚洲乱淫| 欧美系列日韩一区| 久久影院视频免费| 一区二区在线观看免费视频播放| 婷婷成人综合网| 国产精品一卡二卡| 欧美视频一区在线| 久久亚洲免费视频| 一区二区三区在线观看视频| 久久精工是国产品牌吗| 色综合久久天天| 日韩一区二区不卡| 亚洲精品国产精品乱码不99| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产99久久久国产精品潘金网站| 欧美午夜精品久久久| 久久亚洲欧美国产精品乐播| 亚洲国产精品一区二区www在线| 国产一区免费电影| 欧美日韩一区中文字幕| 中文成人av在线| 男男gaygay亚洲| 色94色欧美sute亚洲线路一ni| 日韩欧美一级片| 亚洲国产成人精品视频| 大美女一区二区三区| 欧美一区二区网站| 一区二区视频在线| www.日韩精品| 2021久久国产精品不只是精品| 亚洲制服丝袜av| 99国产精品视频免费观看| 日韩免费观看高清完整版在线观看| 一级日本不卡的影视| 99久久国产综合色|国产精品| www久久久久| 九色|91porny| 欧美一区日本一区韩国一区| 亚洲综合一二三区| 99在线热播精品免费| 久久久久国产一区二区三区四区| 日韩不卡免费视频| 欧美日韩成人综合天天影院| 亚洲免费在线看| 99久久精品免费看国产免费软件| 久久先锋影音av| 国产美女视频91| 精品久久久久久久久久久久久久久| 日本最新不卡在线| 69精品人人人人| 日韩精品久久理论片| 337p亚洲精品色噜噜| 性欧美大战久久久久久久久| 91黄色小视频| 一区二区三区在线观看视频| 日本黄色一区二区| 亚洲欧美日韩国产成人精品影院 | 激情久久五月天| 欧美本精品男人aⅴ天堂| 日本不卡123| 欧美一区二区三区系列电影| 日韩成人免费在线| 日韩欧美电影在线| 国产一区在线视频| 久久久久久电影| www.欧美日韩国产在线| 亚洲人成精品久久久久| 色天使久久综合网天天| 一个色综合av| 欧美一区二区三区在线电影 | 亚洲1区2区3区4区| 欧美电影在哪看比较好| 奇米888四色在线精品| 日韩精品一区二区在线| 国产激情视频一区二区三区欧美 | 美女爽到高潮91| 久久精品男人天堂av| av不卡一区二区三区| 依依成人综合视频| 欧美一级高清片| 国产九色sp调教91| 国产精品成人免费在线| 欧美在线观看视频一区二区三区| 亚洲成人av一区| 欧美大片在线观看一区| 成人av在线看| 午夜视频在线观看一区二区 | 欧美日韩精品是欧美日韩精品| 日韩不卡在线观看日韩不卡视频| 精品国产自在久精品国产| 不卡的电视剧免费网站有什么| 亚洲综合男人的天堂| 欧美精品一区二区三| 91丝袜美腿高跟国产极品老师 |