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

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

?? conn3.c

?? microchip公司的DeviceNet協(xié)議桟源碼
?? 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一区二区三区免费野_久草精品视频
欧美日韩精品一区视频| 国产在线精品一区在线观看麻豆| 午夜av区久久| 久久国产福利国产秒拍| 国产一区二区三区黄视频| 99精品一区二区| 91精品国产综合久久精品麻豆| 欧美精品一区二区三区四区| 中文字幕日本不卡| 日本午夜精品一区二区三区电影| 极品瑜伽女神91| 91在线视频观看| 日韩欧美高清在线| 亚洲欧美日韩国产另类专区| 日本va欧美va瓶| 99国产精品一区| 久久一区二区三区国产精品| 一区二区三区欧美| 国产伦理精品不卡| 欧美影院一区二区三区| 久久婷婷久久一区二区三区| 亚洲午夜视频在线| 国产69精品久久久久777| 欧美日韩高清一区二区三区| 国产精品私人影院| 日韩高清不卡一区| 99久久精品国产麻豆演员表| 日韩欧美精品三级| 亚洲综合激情另类小说区| 国产米奇在线777精品观看| 欧美色视频在线| 1区2区3区精品视频| 经典三级一区二区| 欧美巨大另类极品videosbest | 成人黄色在线视频| 白白色 亚洲乱淫| 丁香六月综合激情| 日韩一区二区三区在线| 国产精品久久久久影院老司| 国产精品18久久久久久久网站| 精品国产凹凸成av人导航| 美女mm1313爽爽久久久蜜臀| 欧美一区中文字幕| 日本不卡高清视频| 91精品国产综合久久久久久| 日本女优在线视频一区二区| 日韩一区二区在线看片| 久久精品理论片| 精品成人a区在线观看| 美女视频黄 久久| 日韩免费在线观看| 激情六月婷婷综合| 2023国产精品自拍| 国产曰批免费观看久久久| 国产亚洲va综合人人澡精品| 粉嫩嫩av羞羞动漫久久久| 国产精品理论片在线观看| av电影在线观看一区| 亚洲图片你懂的| 欧美在线你懂的| 日本免费在线视频不卡一不卡二| 日韩免费福利电影在线观看| 国产美女在线精品| 国产精品欧美一区二区三区| 色综合一区二区| 婷婷六月综合亚洲| 久久综合99re88久久爱| 成人网男人的天堂| 一区二区三区日韩在线观看| 91精品国产色综合久久久蜜香臀| 精品午夜久久福利影院| www.亚洲免费av| 亚洲人一二三区| 欧美在线免费观看亚洲| 久久狠狠亚洲综合| 国产精品国产三级国产有无不卡| 91久久奴性调教| 日本欧美加勒比视频| 国产亚洲综合性久久久影院| 99视频精品在线| 天天色 色综合| 久久精品男人天堂av| 91麻豆精品视频| 美国十次了思思久久精品导航| 国产欧美日韩视频在线观看| 在线观看不卡视频| 韩国欧美一区二区| 怡红院av一区二区三区| 日韩午夜激情电影| 99久久精品国产麻豆演员表| 舔着乳尖日韩一区| 国产日韩欧美在线一区| 欧美三级资源在线| 国产不卡在线视频| 亚洲福中文字幕伊人影院| www国产成人免费观看视频 深夜成人网| 亚洲欧美在线视频观看| 97se亚洲国产综合在线| 蜜臀久久久99精品久久久久久| 国产精品理论片| 欧美一区二区播放| 色综合婷婷久久| 国产麻豆视频一区二区| 亚洲一区二区美女| 欧美国产国产综合| 欧美一区二区三区在线看 | 一区二区日韩av| 欧美精品一区二区三区一线天视频 | 日韩—二三区免费观看av| 国产精品拍天天在线| 日韩一区二区不卡| 在线亚洲高清视频| 大白屁股一区二区视频| 免费av网站大全久久| 亚洲精品免费在线| 日本一区二区不卡视频| 日韩一区二区三区视频在线观看 | 精品一区精品二区高清| 伊人色综合久久天天人手人婷| 久久精品欧美一区二区三区麻豆| 欧美一区二区三区小说| 91行情网站电视在线观看高清版| 久久99精品国产.久久久久久| 亚洲欧美激情视频在线观看一区二区三区| 91精品国产91久久久久久最新毛片 | 欧美在线免费观看亚洲| 国产精品91一区二区| 亚洲国产日韩av| 日本一区二区三级电影在线观看| 日韩精品一二三四| 精品999久久久| 欧美性猛片aaaaaaa做受| 精品一区二区免费视频| 亚洲国产欧美在线| 国产精品美女久久久久aⅴ| 欧美一卡2卡3卡4卡| 99精品久久免费看蜜臀剧情介绍| 久久99蜜桃精品| 亚洲国产日韩精品| 中文字幕在线观看不卡| 2020国产精品自拍| 欧美卡1卡2卡| 色噜噜久久综合| 成人看片黄a免费看在线| 看电影不卡的网站| 亚洲1区2区3区4区| 中文字幕中文字幕中文字幕亚洲无线| 欧美一区日韩一区| 欧洲精品中文字幕| 91福利在线导航| 在线免费不卡电影| 精品污污网站免费看| 欧美午夜在线观看| 欧美视频在线一区二区三区 | 欧美日韩亚洲综合一区二区三区| 日本韩国一区二区| 91激情在线视频| 欧美性色综合网| 欧美色老头old∨ideo| 欧美日韩精品一区二区天天拍小说| 欧美视频中文字幕| 91精品国产综合久久小美女| 91精品国产aⅴ一区二区| 日韩午夜中文字幕| 久久你懂得1024| 国产精品午夜春色av| 国产精品久久久久久久久图文区| 18欧美亚洲精品| 亚洲综合无码一区二区| 午夜久久福利影院| 另类中文字幕网| 国内精品在线播放| 成人小视频在线| 91久久奴性调教| 3d动漫精品啪啪1区2区免费 | 欧美亚洲综合一区| 精品国偷自产国产一区| 欧美日韩三级视频| 91精品国产福利| 久久日一线二线三线suv| 国产欧美一区二区精品性色| 国产免费成人在线视频| 亚洲色图视频网站| 午夜精品一区二区三区电影天堂| 蜜桃视频在线一区| 粉嫩av一区二区三区| 在线视频欧美精品| 欧美大片一区二区三区| 国产女人18毛片水真多成人如厕 | 日韩久久久久久| 国产人久久人人人人爽| 一区二区在线观看不卡| 日本成人在线看| 国产激情视频一区二区在线观看 | 91成人国产精品| 91精品国产全国免费观看| 国产亲近乱来精品视频| 一个色在线综合| 久久精品国内一区二区三区| 99精品国产视频|