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

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

?? conn3.c

?? microchip公司的DeviceNet協議桟源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************************
 *
 * Microchip DeviceNet Stack (Bit-Strobed Messaging Connection Object Source)
 *
 *****************************************************************************
 * FileName:        conn3.c
 * Dependencies:    
 * Processor:       PIC18F with CAN
 * Compiler:       	C18 02.20.00 or higher
 * Linker:          MPLINK 03.40.00 or higher
 * Company:         Microchip Technology Incorporated
 *
 * Software License Agreement
 *
 * The software supplied herewith by Microchip Technology Incorporated
 * (the "Company") is intended and supplied to you, the Company's
 * customer, for use solely and exclusively with products manufactured
 * by the Company. 
 *
 * The software is owned by the Company and/or its supplier, and is 
 * protected under applicable copyright laws. All rights are reserved. 
 * Any use in violation of the foregoing restrictions may subject the 
 * user to criminal sanctions under applicable laws, as well as to 
 * civil liability for the breach of the terms and conditions of this 
 * license.
 *
 * THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, 
 * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 
 * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 
 * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 
 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 *
 *
 * This file contains Bit-Strobe messaging support for the Connection Object 
 * described in Section 5-4 and Chapter 7 of Volume 1 of the DeviceNet 
 * specification. Additional support is in the UsrConn.c file.
 * 
 *
 *
 * Author               Date        Comment
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Ross Fosler			04/28/03	...	
 * 
 *****************************************************************************/

#include	"dnet.def"			// Global definitions file

#include 	"typedefs.h"

#if SUPPORT_BIT_STROBED

#include	"conn.h"			// Connection prototypes and symbols

#include	"services.h"		// Service codes
#include	"errors.h"			// Error codes
#include	"class.h"			// Class codes

#include	"route.h"			// Global symbols defined by the router
#include	"dnet.h"			// DeviceNet prototypes and symbols
#include	"CAN.h"



#pragma	udata
/*********************************************************************
 * Connection related variables
 ********************************************************************/
CONN_STROBE 	uConn3;



/*********************************************************************
 * Function:        unsigned char _Conn3Create(void)
 *
 * PreCondition:    The CAN (or other) driver must be prepared to 
 *					accept some filter settings.
 *
 * Input:       	none	
 *                  
 * Output:      	unsigned char handle to the connection	
 *
 * Side Effects:    none
 *
 * Overview:        This function creates a connection 
 *					in the predefined set and returns a 
 *					handle to the connection. The connection is 
 *					placed into a 'configuring' state. 
 *					
 *					This function will call out to the users code
 *					for additional resource allocation. If the 
 *					user returns NULL then the allocation will not
 *					occur.
 *
 * Note:            This function is not called directly by 
 *					application code.
 ********************************************************************/
unsigned char _Conn3Create()
{
	if (UsrConnCreateEvent(3))
	{
		//Initialize the connection attributes
		uConn3.attrib.state = _STATE_CONFIGURING;
		uConn3.attrib.transportClass.byte = 0x83;
		uConn3.attrib.produced_cid.bytes.LSB = (uDNet.MACID >> 3) | (0xE << 3);
		uConn3.attrib.produced_cid.bytes.MSB = uDNet.MACID << 5;
		uConn3.attrib.consumed_cid.bytes.LSB = uDNet.AllocInfo.MasterMACID | 0x80; 
		uConn3.attrib.consumed_cid.bytes.MSB = 0x00;
		uConn3.attrib.expected_packet_rate.word = 0;
		
		_existentFlags.bits.strobe = 1;
		
		// Setup the pointer and other info for the receiving side
		uConn3.rx.lenMax = uConn3.attrib.consumed_con_size.bytes.LSB;
						
		// Setup the pointer and other info for the transmitting side
		uConn3.tx.lenMax = uConn3.attrib.produced_con_size.bytes.LSB;
						
		//Issue a request to start receiving the CID
		CANSetFilter(uConn3.attrib.consumed_cid.word);
		return (3);
	}
	else return (0);
}


/*********************************************************************
 * Function:        unsigned char _Conn3Close()
 *
 * PreCondition:    The connection should have already been open.
 *
 * Input:       	none
 *                  
 * Output:      	unsigned char instance that closed
 *
 * Side Effects:    none
 *
 * Overview:        Closes the specified connection. Users code is 
 *					notified to release any used resources.
 *
 * Note:            none
 ********************************************************************/
unsigned char _Conn3Close()
{	
	// Transition to the non-existent state
	uConn3.attrib.state = _STATE_NON_EXISTENT;
	
	_establishFlags.bits.strobe = 0;
	_existentFlags.bits.strobe = 0;
	
	// Issue a request to the driver to stop receiving the message
	CANClrFilter(uConn3.attrib.consumed_cid.word);
	
	UsrConnCloseEvent(3);

	return(1);
}



/*********************************************************************
 * Function:        void _Conn3TimerEvent(void)
 *
 * PreCondition:    None
 *
 * Input:       	None	
 *                  
 * Output:      	None
 *
 * Side Effects:    None
 *
 * Overview:        Update timer and process any timer events. If the 
 *					timer overflows then the state of the connection
 *					is changed.
 *
 * Note:            None
 ********************************************************************/
void _Conn3TimerEvent(void)
{
	// Process the watchdog if the packet rate is other than 0
	if (uConn3.attrib.expected_packet_rate.word)
	{
		// Adjust the time
		uConn3.timer.word -= TICK_RESOLUTION;

		// If the wdt expires then change the state of the connection
		if (uConn3.timer.word == 0) 
		{
			uConn3.attrib.state = _STATE_TIMED_OUT;
			_establishFlags.bits.strobe = 0;
		}
	}	   
}	   





/*********************************************************************
 * Function:        void _Conn3RxEvent(void)
 *
 * PreCondition:    none
 *
 * Input:       	none
 *                  
 * Output:      	none
 *
 * Side Effects:    none
 *
 * Overview:        Process received data for this connection.
 *
 * Note:            This event occures when data has been received
 *					for this connection instance.
 ********************************************************************/
void _Conn3RxEvent(void)
{
	// Get the length of the message
	uConn3.rx.len = CANGetRxCnt();

 	// Copy the message to the connection buffer
 	CANGetRxDataTyp0(uConn3.rx.pMsg);
 	//*((_MSG_DATA *)(uConn3.rx.pMsg)) = *((_MSG_DATA *)CANGetRxDataPtr());
     
 	// Reset the connection wdt
 	uConn3.timer.word = uConn3.attrib.expected_packet_rate.word;	
		
 	// Indicate message has been received (located in conn.c)	
 	_rxFlag.bits.strobe = 1;
	
	// Notify the application
	UsrConnRxDataEvent(3);
	
  	// Release the hardware to continue receiving
   	CANRead();	
}




/*********************************************************************
 * Function:        void _Conn3TxOpenEvent(void)
 *
 * PreCondition:    A transmit request must have been made.
 *
 * Input:       	none	
 *                  
 * Output:      	none
 *
 * Side Effects:    none
 *
 * Overview:        Process open transmit que event
 *
 * Note:            This event occurs when the buffer is available 
 *					for this connection instance to transmit. A 
 *					transmit request must have been made to enter 
 *					this function.
 ********************************************************************/
void _Conn3TxOpenEvent(void)
{
 	// Copy the message to the hardware buffer
 	CANPutTxDataTyp0(uConn3.tx.pMsg);
	//*((_MSG_DATA *)CANGetTxDataPtr()) = *((_MSG_DATA *)(uConn3.tx.pMsg));

	// Set the produced CID
	CANPutTxCID(uConn3.attrib.produced_cid.word);

	// Set the length of the message
	CANPutTxCnt(uConn3.tx.len);

	// Request the hardware to queue the message to send
	CANSend(3);
	
	// Clear the transmit flag to open access to the write buffer
	// Notice the queue is cleared regardless of actually sending data
	_txFlag.bits.strobe = 0;		
}


/*********************************************************************
 * Function:        void _Conn3TxEvent(void)
 *
 * PreCondition:    Data must have been queued to transmit.
 *
 * Input:       	none	
 *                  
 * Output:      	none
 *
 * Side Effects:    none

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频一区在线观看| 9l国产精品久久久久麻豆| 亚洲视频资源在线| 国产精品久久久一本精品| 中文字幕欧美日本乱码一线二线| 国产清纯白嫩初高生在线观看91| 国产日本欧洲亚洲| 国产精品初高中害羞小美女文| 日本一区二区三区电影| 亚洲欧美日韩在线不卡| 亚洲精品综合在线| 亚洲电影视频在线| 毛片不卡一区二区| 国产一区二区日韩精品| 岛国精品一区二区| 在线影院国内精品| 91精品国产色综合久久ai换脸 | 国产精品456| 国产成人精品免费一区二区| 91亚洲精品一区二区乱码| 在线综合视频播放| 欧美欧美午夜aⅴ在线观看| 欧美精选一区二区| 精品国产乱码久久久久久闺蜜| 久久综合九色综合97_久久久| 国产精品无圣光一区二区| 亚洲精品免费在线| 美腿丝袜亚洲三区| 丰满岳乱妇一区二区三区| 91丨九色丨黑人外教| 精品视频免费在线| 久久久噜噜噜久久中文字幕色伊伊 | 色久综合一二码| 欧美一区二区三区爱爱| 国产精品美女久久久久高潮| 午夜精品在线视频一区| 国产精品资源在线观看| 国产成人亚洲精品青草天美| 麻豆成人在线观看| k8久久久一区二区三区| 3d成人h动漫网站入口| 日本一区二区久久| 日韩中文字幕区一区有砖一区| 国产xxx精品视频大全| 欧美性极品少妇| 国产网红主播福利一区二区| 调教+趴+乳夹+国产+精品| av电影天堂一区二区在线观看| 欧美精品日韩精品| 亚洲男人都懂的| 波多野结衣精品在线| 精品国产乱码91久久久久久网站| 一区二区三区在线视频免费观看| 国产一区美女在线| 欧美一区二区精品| 亚洲一区二区三区美女| 亚洲精品精品亚洲| 国产99久久精品| 精品成人免费观看| 日本免费在线视频不卡一不卡二| av亚洲精华国产精华精华| 久久久久久久久久久黄色| 天天影视涩香欲综合网| 99久久精品一区| 国产精品久久久久久亚洲毛片| 国产麻豆精品久久一二三| 欧美一区二区三区免费| 亚洲一二三四区不卡| 91国产精品成人| 亚洲一区影音先锋| www.亚洲色图| 国产精品欧美极品| 不卡欧美aaaaa| 国产日韩欧美a| 国产a精品视频| 国产精品网站一区| 成a人片国产精品| 三级影片在线观看欧美日韩一区二区| 日韩中文字幕一区二区三区| 欧美在线观看禁18| 亚洲综合在线免费观看| 91免费在线看| 亚洲免费观看高清完整版在线| 91女神在线视频| 伊人色综合久久天天人手人婷| 色综合久久久久久久久久久| 亚洲天天做日日做天天谢日日欢| 97se狠狠狠综合亚洲狠狠| 亚洲色大成网站www久久九九| 91美女蜜桃在线| 亚洲国产你懂的| 日韩一区二区在线观看| 国内精品国产成人国产三级粉色| 久久精品在线观看| 成人91在线观看| 亚洲精品日韩专区silk| 欧美乱妇15p| 狠狠狠色丁香婷婷综合久久五月| 久久午夜电影网| www.在线成人| 午夜精品福利一区二区蜜股av| 91精品国产麻豆国产自产在线| 国产尤物一区二区在线| 亚洲欧洲av一区二区三区久久| 欧美日韩成人综合天天影院 | 这里只有精品视频在线观看| 蜜桃久久精品一区二区| 国产色产综合产在线视频| 色一区在线观看| 黑人巨大精品欧美一区| 亚洲人亚洲人成电影网站色| 51午夜精品国产| 成人污视频在线观看| 三级欧美韩日大片在线看| 久久久久久久综合日本| 欧美人狂配大交3d怪物一区| 国产一区二区按摩在线观看| 一区二区三区四区视频精品免费| 欧美精品一区二区蜜臀亚洲| 色狠狠综合天天综合综合| 精品一区二区三区不卡 | 欧美日韩黄色影视| 懂色一区二区三区免费观看| 五月综合激情日本mⅴ| 亚洲欧洲一区二区在线播放| 欧美不卡视频一区| 91成人在线免费观看| 成人美女视频在线看| 美国欧美日韩国产在线播放| 亚洲电影中文字幕在线观看| 国产欧美一区二区在线| 91精品国产综合久久国产大片| 91碰在线视频| 成人久久久精品乱码一区二区三区| 秋霞午夜av一区二区三区| 尤物av一区二区| 最新欧美精品一区二区三区| 国产亚洲精品超碰| 精品91自产拍在线观看一区| 在线播放中文一区| 在线观看日韩电影| 在线免费亚洲电影| 97久久久精品综合88久久| 国产1区2区3区精品美女| 久久精品99久久久| 热久久免费视频| 免费一区二区视频| 日本aⅴ亚洲精品中文乱码| 日韩成人免费看| 日韩电影免费在线| 另类小说综合欧美亚洲| 日韩va欧美va亚洲va久久| 午夜久久久久久| 蜜臀a∨国产成人精品| 日日摸夜夜添夜夜添精品视频| 亚洲国产精品天堂| 丝袜亚洲另类欧美综合| 日韩高清中文字幕一区| 久久99国产精品麻豆| 国产在线播放一区三区四| 国产精品99久久久久久久女警 | 日韩av电影天堂| 久久精品久久综合| 国产一区二区三区免费看| 国产精品一区二区视频| 波多野结衣在线一区| 色综合中文字幕国产| 菠萝蜜视频在线观看一区| 在线观看亚洲精品| 在线播放日韩导航| 精品国产欧美一区二区| 欧美国产精品久久| 亚洲国产日韩a在线播放性色| 日韩专区中文字幕一区二区| 国产在线精品不卡| 91视频你懂的| 日韩欧美国产综合| 中文字幕一区不卡| 午夜免费欧美电影| 成人免费黄色大片| 欧美日韩二区三区| 日本一区二区三区在线不卡| 亚洲精品国产成人久久av盗摄 | 日韩欧美一卡二卡| 国产精品成人免费 | 久久午夜色播影院免费高清| 亚洲欧洲av在线| 久久97超碰色| 日本高清不卡视频| www国产亚洲精品久久麻豆| 国产精品免费aⅴ片在线观看| 亚洲aⅴ怡春院| 成人影视亚洲图片在线| 欧美高清激情brazzers| 国产日产欧美精品一区二区三区| 亚洲国产精品综合小说图片区| 福利一区二区在线| 日韩一级完整毛片| 一区二区三区在线观看网站| 国产一区二区三区在线观看免费视频|