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

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

?? i82527.c

?? CAN例程 源碼 CAN例程 源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
		chipStuff->errorInt = FALSE;		        if(intMask & WNCAN_INT_WAKE_UP)		chipStuff->wakeUpInt = TRUE;	else		chipStuff->wakeUpInt = FALSE;			if((chipStuff->wakeUpInt == TRUE) || (chipStuff->errorInt == TRUE))		regCtrl |= I82527_B_SIE;	else		regCtrl &= ~I82527_B_SIE;		/*     The error warning interrupt is generated when errors on the bus exceed     warning limits and if the controller becomes bus off. The interrupt      is also raised when the controller goes into error active state from      being bus off	*/	if(intMask & WNCAN_INT_BUS_OFF)	{		chipStuff->busOffInt = TRUE;	        regCtrl |= I82527_B_EIE;	}	else	{		chipStuff->busOffInt = FALSE;		regCtrl &= ~I82527_B_EIE;	}		oldLevel = intLock();		pDev->pBrd->canOutByte(pDev, I82527_R_CTRL, regCtrl);	        intUnlock(oldLevel);    }    return retCode;}/************************************************************************** I82527_EnableInt - enable CAN interrupts** This routine enables CAN interrupts on the controller.** RETURNS: N/A*   * ERRNO:   N/A**/static void I82527_EnableInt      (	  struct WNCAN_Device *pDev	  ){    UCHAR       regCtrl;    int         oldLevel;    oldLevel = intLock();        /* read the control register */    regCtrl = pDev->pBrd->canInByte(pDev, I82527_R_CTRL);    	regCtrl |= I82527_B_IE;    /* write control register */    pDev->pBrd->canOutByte(pDev, I82527_R_CTRL, regCtrl);    intUnlock(oldLevel);    return;}/************************************************************************** I82527_DisableInt - disable CAN interrupts** This routine disbles interrupts on the controller.** RETURNS: N/A*   * ERRNO:   N/A**/static void I82527_DisableInt      (	  struct WNCAN_Device *pDev	  ){    int    oldLevel;    UCHAR  regCtrl;    oldLevel = intLock();        regCtrl = pDev->pBrd->canInByte(pDev, I82527_R_CTRL);    	regCtrl &= ~I82527_B_IE;    /* write control register */    pDev->pBrd->canOutByte(pDev, I82527_R_CTRL, regCtrl);    intUnlock(oldLevel);    return;}/************************************************************************** I82527_GetBusStatus - get the bus status** This routine returns the status of the CAN bus. The bus is  either in a* WNCAN_BUS_OFF state resulting from an excessive number of errors, a * WNCAN_BUS_WARN state indicating that there is an abnormal rate of * occurances of errors. ** RETURNS: status of the CAN bus = WNCAN_BUS_OK, WNCAN_BUS_WARN, *          or WNCAN_BUS_OFF*   * ERRNO: N/A**/static WNCAN_BusStatus I82527_GetBusStatus      (	  struct WNCAN_Device *pDev	  ){    /* read the status register */    WNCAN_BusStatus regStatus = pDev->pBrd->canInByte(pDev, I82527_R_SR);    if(regStatus & I82527_B_BOFF)        return(WNCAN_BUS_OFF);    else if (regStatus & I82527_B_WARN)        return(WNCAN_BUS_WARN);    else        return(WNCAN_BUS_OK);}/************************************************************************** I82527_GetBusError - get the bus error** This routine returns the first bus error.** RETURNS: the first bus error*   * ERRNO: N/A**/static WNCAN_BusError I82527_GetBusError      (	  struct WNCAN_Device *pDev	  ){   WNCAN_BusError    error;   UCHAR       regStatus;   /* read the status register */   regStatus = pDev->pBrd->canInByte(pDev, I82527_R_SR);    switch(regStatus & 0x07)    {        case 1:            error = WNCAN_ERR_STUFF;            break;        case 2:            error = WNCAN_ERR_FORM;            break;        case 3:            error = WNCAN_ERR_ACK;            break;        case 4:            error = WNCAN_ERR_BIT; /* Bit1 error */            break;        case 5:            error = WNCAN_ERR_BIT; /* Bit0 error */            break;        case 6:            error = WNCAN_ERR_CRC;            break;        default:            error = WNCAN_ERR_NONE;            break;    }       return error;}/************************************************************************** I82527_GetIntStatus - get the interrupt status on the controller** This routine gets the interrupt status of the controller.* If the interrupt was caused by the transmission or reception of a * message, the channel number that generated the interrupt is set. * Otherwise, the channelNum value is set to an invalid channel number.** RETURNS: the interrupt status = WNCAN_INT_NONE, WNCAN_INT_ERROR,*          WNCAN_INT_TX, or WNCAN_INT_RX*   * ERRNO: N/A**/static WNCAN_IntType I82527_GetIntStatus( struct WNCAN_Device *pDev, UCHAR *channelNum ){	    WNCAN_IntType   intStatus=WNCAN_INT_NONE;    UCHAR       tmpCTRL0;    UCHAR       regInt;    UCHAR       regStatus = WNCAN_INT_NONE;	    struct  i82527ChipSpecific *chipStuff;	    regInt = pDev->pBrd->canInByte(pDev, I82527_R_INT);    	    if(regInt == 0)    {      intStatus = WNCAN_INT_NONE;    }    else if(regInt == 1)    {		/* Set default values in chip specific struct*/		chipStuff = (struct i82527ChipSpecific *)pDev->pCtrl->csData;					/* read the status register */		regStatus = pDev->pBrd->canInByte(pDev, I82527_R_SR);					/*		A status change interrupt has occurred		Unless the user is directly accessing the CAN controller's 		registers, this indicates that the user wants notification of		a BUS OFF, WAKE UP or error interrupt.		I82527 does not have separate interrupt sources for these conditions.		Therefore, the status register must be checked and the correct cause		of the status update returned.		*/		if((chipStuff->wakeUpInt == TRUE) && (regStatus & I82527_B_WAKE))			intStatus = WNCAN_INT_WAKE_UP;						if((chipStuff->busOffInt == TRUE) && (regStatus & I82527_B_BOFF))			intStatus = WNCAN_INT_BUS_OFF;						if((chipStuff->errorInt == TRUE) && (regStatus & 0x07))			intStatus = WNCAN_INT_ERROR;				/*		If neither of the above three conditions are true, the status change		must have been due to a transmission or reception.		We want this status change interrupt ignored. Tx / Rx interrupts should		be flagged by channel interrupt pending bits, therefore the interrupt		status is set to WNCAN_INT_SPURIOUS		*/		if(intStatus == WNCAN_INT_NONE)			intStatus = WNCAN_INT_SPURIOUS;		    }    else if(regInt == 2)    {        *channelNum = 14;        intStatus = WNCAN_INT_RX;    }    else if(regInt <= 0x10)    {        *channelNum = regInt - 3;		        /* reading the control register 0 */        tmpCTRL0 = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +             (I82527_OFFS_MSG * (*channelNum)) + I82527_OFFS_CTRL0));			/* checking if this is an receive interrupt 	(on message object 1 to 14) */        if (tmpCTRL0 & 0x08)        {            intStatus = WNCAN_INT_RX;        }        else        {            intStatus = WNCAN_INT_TX;        }    }    else    {        intStatus = WNCAN_INT_SPURIOUS; /* unallowed interrupt (should not happen) */    }	    return intStatus;}/************************************************************************** I82527_ReadID - read the CAN Id** This function reads the CAN Id corresponding to the channel number on* the controller. The standard or extended flag is set by the function.* The mode of the channel cannot be WNCAN_CHN_INACTIVE or WNCAN_CHN_INVALID** RETURNS:    The CAN Id, or -1 if an input parameter is invalid** ERRNO:      S_can_illegal_channel_no*             S_can_illegal_config**/static long I82527_ReadID(struct WNCAN_Device *pDev, UCHAR channelNum, BOOL* ext){    UCHAR    value;    unsigned long  msgID=0; /* invalid msg id */	    if (channelNum >= I82527_MAX_MSG_OBJ)    {        errnoSet(S_can_illegal_channel_no);				return(-1);    }    	if((pDev->pCtrl->chnMode[channelNum] == WNCAN_CHN_INACTIVE) ||		(pDev->pCtrl->chnMode[channelNum] == WNCAN_CHN_INVALID))    {        errnoSet(S_can_illegal_config);        		return(-1);    }	/* mark this message object as invalid */	pDev->pBrd->canOutByte(pDev, (I82527_R_XMT +		(I82527_OFFS_MSG * channelNum) + I82527_OFFS_CTRL0), 0x7f);		/* read the message configuration register to determine if the message	is standard or extended */	value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +		(I82527_OFFS_MSG * channelNum) + I82527_OFFS_MCR));		if (value & 0x4)	{		/* extended CAN message ID */		*ext = TRUE;		value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT));				msgID = value << 24;   				value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT + 1));				msgID |= value << 16;   						value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT + 2));				msgID |= value << 8;   						value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT+ 3));				msgID |= value;		msgID >>= 3;	}	else	{		/* standard CAN message ID */		*ext = FALSE;		value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT));				msgID = value << 8;   				value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_ARBIT + 1));				msgID |= value;   		msgID >>= 5;	}		/* mark this message object as valid */	pDev->pBrd->canOutByte(pDev, (I82527_R_XMT +		(I82527_OFFS_MSG * channelNum) + I82527_OFFS_CTRL0), 0xbf);        return(msgID);}/************************************************************************** I82527_WriteID - write the CAN Id  to the channel number ** This function writes the CAN Id to the channel. The type of Id * (standard or extended) is specified. the behaviour of the function for* every channel mode is specified as follows:* WNCAN_CHN_INVALID: not allowed. ERROR is returned.* WNCAN_CHN_INACTIVE: not allowed. ERROR is returned.* WNCAN_CHN_RECEIVE: CAN messages with this Id will be received.* WNCAN_CHN_TRANSMIT: CAN meesage with the specified ID will be transmitted* when CAN_Tx is called* WNCAN_CHN_RTR_REQUESTER: CAN message with this id and RTR bit set will* be transmitted when CAN_TX is called* WNCAN_CHN_RTR_RESPONDER: CAN message with this id will be automatically* transmitted when a matching RTR request is received. CAN_WriteData should* be called to set up data for response.*** RETURNS:        OK, or ERROR** ERRNO:          S_can_illegal_channel_no,*                 S_can_illegal_config**/static STATUS I82527_WriteID      (	  struct WNCAN_Device *pDev,	  UCHAR channelNum,	  unsigned long canId,	  BOOL ext	  ){    STATUS retCode = ERROR; /* pessimistic */    UCHAR  value;	UCHAR  prevState;	        if (channelNum >= I82527_MAX_MSG_OBJ)    {        errnoSet(S_can_illegal_channel_no);    }    else if((pDev->pCtrl->chnMode[channelNum] == WNCAN_CHN_INACTIVE) ||		(pDev->pCtrl->chnMode[channelNum] == WNCAN_CHN_INVALID))    {        errnoSet(S_can_illegal_config);            }    else    {				/*Check if EnableChannel has been called earlier and channel		marked as valid. If yes, store state to restore later */		prevState = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_CTRL0));		/*		mark message object as invalid:            MsgVal   = 0 1		unchanged transmit interrupt enable:       TXIE     = 1 1 		unchanged receive interrrupt enable:       RXIE     = 1 1		reset interrupt pending:                   IntPnd   = 0 1		7 6      5 4   3 2   1 0		MsgVal   TXIE  RXIE  IntPnd		*/				pDev->pBrd->canOutByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_CTRL0), 0x7d);			/* 		remote transmission pending unchanged  RmtPnd = 0 1		reset transmit request:                TxRqst = 0 1		reset new data:                        NewDat = 0 1		set CPU update :                       CPUUpd = 1 0			7 6      5 4      3 2      1 0		RmtPnd   TxRqst   NewDat   CPUUpd 		*/			pDev->pBrd->canOutByte(pDev, (I82527_R_XMT +			(I82527_OFFS_MSG * channelNum) + I82527_OFFS_CTRL1), 0x56);					if (ext == FALSE)        {            /* standard message */            value = pDev->pBrd->canInByte(pDev, (I82527_R_XMT +

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品久久99不卡| 精品久久久久99| 日韩免费观看2025年上映的电影| 国产女主播在线一区二区| 亚洲成a天堂v人片| 成人免费毛片嘿嘿连载视频| 日韩一卡二卡三卡国产欧美| 亚洲免费观看高清完整版在线观看熊 | 国产丝袜欧美中文另类| 亚洲成人久久影院| 91在线视频免费观看| 欧美精品一区二区三区蜜桃视频| 亚洲午夜三级在线| 91国内精品野花午夜精品| 国产亚洲自拍一区| 久久成人18免费观看| 欧美日韩在线观看一区二区| 成人免费一区二区三区视频| 国产原创一区二区| 精品国产一区二区三区四区四| 亚洲成人综合网站| 欧美视频一区二| 亚洲欧美日韩国产一区二区三区| 成人中文字幕合集| 国产调教视频一区| 大白屁股一区二区视频| 久久九九久久九九| 大桥未久av一区二区三区中文| 精品国产亚洲在线| 久久精品国产精品青草| 欧美一二区视频| 精品一区二区三区免费播放| 欧美一二三在线| 久久国产福利国产秒拍| 久久综合色天天久久综合图片| 久久国产夜色精品鲁鲁99| 日韩免费在线观看| 国产精品亚洲专一区二区三区| 久久久久国产精品厨房| 福利一区二区在线观看| 欧美国产精品久久| 91啦中文在线观看| 五月婷婷久久综合| 日韩欧美视频在线| 国产激情一区二区三区四区| 国产欧美一区二区精品久导航 | 成人永久免费视频| 国产精品日韩精品欧美在线| 成人免费不卡视频| 亚洲综合区在线| 欧美一级艳片视频免费观看| 韩国欧美一区二区| 国产精品盗摄一区二区三区| 色婷婷av一区| 蓝色福利精品导航| 国产精品网站在线观看| 欧美综合欧美视频| 老司机午夜精品| 国产精品夫妻自拍| 欧美日韩卡一卡二| 国产精品一二一区| 亚洲一区二区三区中文字幕在线| 日韩免费高清视频| jlzzjlzz国产精品久久| 调教+趴+乳夹+国产+精品| 久久亚洲精品小早川怜子| 99久久精品久久久久久清纯| 日本三级亚洲精品| 国产精品欧美经典| 91麻豆精品国产自产在线 | 99久久夜色精品国产网站| 亚洲自拍与偷拍| 久久久夜色精品亚洲| 欧洲人成人精品| 高清日韩电视剧大全免费| 亚洲成人三级小说| 国产精品美日韩| 日韩午夜三级在线| 色94色欧美sute亚洲线路二| 狠狠色综合色综合网络| 一区二区国产盗摄色噜噜| 国产午夜精品理论片a级大结局 | 国产成人免费网站| 视频精品一区二区| 亚洲三级视频在线观看| 久久综合九色综合97婷婷| 在线亚洲人成电影网站色www| 国产一区亚洲一区| 日韩专区一卡二卡| 一区二区三区视频在线看| 久久久久久久久蜜桃| 色av一区二区| 粉嫩av亚洲一区二区图片| 久久精品国产99| 亚洲一区中文日韩| 亚洲日本欧美天堂| 中文字幕第一页久久| 久久天堂av综合合色蜜桃网| 这里只有精品视频在线观看| 欧洲日韩一区二区三区| 色婷婷久久久久swag精品| 成人免费毛片片v| 国产成人精品免费在线| 免费成人在线观看视频| 亚洲国产一区二区视频| 亚洲精品视频在线观看免费| 中文字幕在线一区| 国产精品久久久久影院亚瑟| 久久婷婷国产综合国色天香| 欧美一区二区免费视频| 91精品国产综合久久婷婷香蕉 | 欧美亚洲国产bt| 色综合色狠狠天天综合色| 99久久99久久久精品齐齐| 不卡视频一二三四| a美女胸又www黄视频久久| 日本中文字幕一区二区有限公司| 日韩视频免费观看高清完整版在线观看 | 一本色道久久加勒比精品| 国产不卡视频在线播放| 国产乱码精品一区二区三区av| 免费观看在线综合色| 美女视频一区二区三区| 久久精品人人做人人综合 | 成人免费视频在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲视频在线观看一区| 一区二区三区四区激情| 亚洲激情自拍偷拍| 亚洲国产aⅴ天堂久久| 首页国产欧美久久| 精品一区二区三区久久久| 国产精品一区二区久久不卡| 成人黄色网址在线观看| 91成人免费在线视频| 欧美精品免费视频| 337p日本欧洲亚洲大胆精品 | 日韩欧美国产综合一区| 亚洲精品在线免费观看视频| 国产欧美综合在线观看第十页| 国产精品久久久久一区二区三区| 亚洲日本乱码在线观看| 日韩一区欧美二区| 激情六月婷婷综合| 99久久精品免费看国产| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 亚洲欧美自拍偷拍| 亚洲精品伦理在线| 午夜不卡av免费| 国产精品一色哟哟哟| 色综合天天综合| 欧美va亚洲va香蕉在线| 综合激情网...| 久久精品国产精品亚洲红杏| 99久精品国产| 欧美哺乳videos| 一区二区三区四区在线免费观看| 日本怡春院一区二区| 不卡一区在线观看| 精品欧美黑人一区二区三区| 亚洲免费在线电影| 国产一区在线看| 欧美精选午夜久久久乱码6080| 国产婷婷一区二区| 视频一区欧美日韩| 色婷婷av一区二区三区大白胸 | 亚洲香蕉伊在人在线观| 国产精品一区二区黑丝| 欧美巨大另类极品videosbest| 国产精品天美传媒| 美女视频黄久久| 欧美日韩精品专区| 亚洲男人都懂的| 国v精品久久久网| 欧美精品一区二区久久婷婷| 亚洲香蕉伊在人在线观| 91片黄在线观看| 国产精品麻豆欧美日韩ww| 青青草视频一区| 欧美日韩一区三区| 亚洲精品ww久久久久久p站| 成人亚洲一区二区一| 久久婷婷久久一区二区三区| 日本亚洲三级在线| 欧美日韩一区视频| 夜夜揉揉日日人人青青一国产精品| 国产成人h网站| 久久久久久久久97黄色工厂| 久久精品久久99精品久久| 337p亚洲精品色噜噜| 亚洲国产婷婷综合在线精品| 日韩一级精品视频在线观看| 日韩欧美国产一二三区| 亚洲综合色在线| 不卡高清视频专区| 中文子幕无线码一区tr | 一级做a爱片久久| 91美女片黄在线观看| 亚洲天天做日日做天天谢日日欢| 国产成人啪免费观看软件|