⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dnet.h

📁 关于devicenet的源代码。micorchip公司的
💻 H
📖 第 1 页 / 共 2 页
字号:
 *
 * Note:            None
 ********************************************************************/ 
#define mDNetSetBOI(boi)					(uDNet.BOI = boi)


/*********************************************************************
 * Function:        void DNetSetBusOffCount(USINT boCount)
 *			  
 * PreCondition:    
 *
 * Input:    		boCount       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, BusOffCount. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetBusOffCount(boCount)		(uDNet.BusOffCount = boCount)


/*********************************************************************
 * Function:        void DNetSetAllocChoice(USINT allocChoice)
 *			  
 * PreCondition:    
 *
 * Input:    		allocChoice       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, AllocInfo.AllocChoice. 
 *
 * Note:            None
 ********************************************************************/
#define	mDNetSetAllocChoice(allocChoice)	(uDNet.AllocInfo.AllocChoice.byte = allocChoice)


/*********************************************************************
 * Function:        void DNetSetMasterMACID(USINT masterMACID)
 *			  
 * PreCondition:    
 *
 * Input:    		masterMACID       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, AllocInfo.MasterMACID. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetMasterMACID(masterMACID)	(uDNet.AllocInfo.MasterMACID = masterMACID)


/*********************************************************************
 * Function:        void DNetSetMACSwChange(BOOL swCh)
 *			  
 * PreCondition:    
 *
 * Input:    		swCh       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, MACSwChange. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetMACSwChange(swCh)			(uDNet.MACSwChange = swCh)


/*********************************************************************
 * Function:        void DNetSetBaudSwChange(BOOL swCh)
 *			  
 * PreCondition:    
 *
 * Input:    		swCh       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, BaudSwChange. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetBaudSwChange(swCh)			(uDNet.BaudSwChange = swCh)


/*********************************************************************
 * Function:        void DNetSetMACSwValue(USINT swVal)
 *			  
 * PreCondition:    
 *
 * Input:    		swVal       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, MacSwValue. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetMACSwValue(swVal)			(uDNet.MACSwValue = swVal)


/*********************************************************************
 * Function:        void DNetSetBaudSwValue(USINT swVal)
 *			  
 * PreCondition:    
 *
 * Input:    		swVal       
 *                  
 * Output:     		none    
 *				
 * Side Effects:  	  
 *
 * Overview:        Writes to the DeviceNet object variable, BaudSwValue. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetSetBaudSwValue(swVal)			(uDNet.BaudSwValue = swVal)


/*********************************************************************
 * Function:        USINT DNetGetMACID(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		MACID    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BaudSwValue. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetMACID()						(uDNet.MACID)


/*********************************************************************
 * Function:        USINT DNetGetBaudRate(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		BaudRate    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BaudRate. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetBaudRate()					(uDNet.BaudRate)


/*********************************************************************
 * Function:        BOOL DNetGetBOI(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		BOI    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BOI. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetBOI()						(uDNet.BOI)


/*********************************************************************
 * Function:        USINT DNetGetBusOffCount(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		BusOffCount    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BusOffCount. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetBusOffCount()				(uDNet.BusOffCount)


/*********************************************************************
 * Function:        USINT DNetGetAllocChoice(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		AllocInfo.AllocChoice    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, AllocInfo.AllocChoice. 
 *
 * Note:            None
 ********************************************************************/
#define	mDNetGetAllocChoice()				(uDNet.AllocInfo.AllocChoice)


/*********************************************************************
 * Function:        USINT DNetGetMasterMACID(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		AllocInfo.MasterMACID    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, AllocInfo.MasterMACID. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetMasterMACID()				(uDNet.AllocInfo.MasterMACID)


/*********************************************************************
 * Function:        BOOL DNetGetMACSwChange(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		MACSwChange    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, MACSwChange. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetMACSwChange()				(uDNet.MACSwChange)


/*********************************************************************
 * Function:        BOOL DNetGetBaudSwChange(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		BaudSwChange    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BaudSwChange. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetBaudSwChange()				(uDNet.BaudSwChange)


/*********************************************************************
 * Function:        USINT DNetGetMACSwValue(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		MacSwValue    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, MacSwValue. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetMACSwValue()				(uDNet.MacSwValue)


/*********************************************************************
 * Function:        USINT DNetGetBaudSwValue(void)
 *			  
 * PreCondition:    
 *
 * Input:    		none       
 *                  
 * Output:     		BaudSwValue    
 *				
 * Side Effects:  	  
 *
 * Overview:        Reads from the DeviceNet object variable, BaudSwValue. 
 *
 * Note:            None
 ********************************************************************/
#define mDNetGetBaudSwValue()				(uDNet.BaudSwValue)





/*********************************************************************
 * Function:        unsigned char DNetInit(void)
 *
 * PreCondition:    The path (aService, aClassID, aInstanceID) must
 *					be loaded prior to using this function. If service
 *					indicates any type of IO then the buffer pointers
 *					must be initialized.
 *
 * Input:       	aHeader, aClassID, aInstanceID, aService
 *					*pOutBuf, *pInBuf, aOutBufDataLen, aInBufDataLen
 *					aOutBufLen, aInBufLen		
 *                  
 * Output:      	aHeader, aService	
 *					*pOutBuf, *pInBuf, aOutBufDataLen, aInBufDataLen
 *				
 *			
 *
 * Side Effects:    
 *
 * Overview:        Initialize the DeviceNet object.  
 *
 * Note:            None
 ********************************************************************/
#define mDNetInit(mac_ID, baud, boi, alloc_choice, master_mac_ID) 	{	\
					 uDNet.AllocInfo.MasterMACID = master_mac_ID;		\
					 uDNet.AllocInfo.AllocChoice = alloc_choice;		\
					 uDNet.BOI = boi;									\
					 uDNet.BaudRate = baud;								\
					 uDNet.MACID = mac_ID;}							

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -