📄 general.h
字号:
/***************************************************************************
general.h - description
-------------------
begin : Fri May 17 2002
copyright : (C) 2002 by Raphael Zulliger
email : zulli@hsr.ch
***************************************************************************/
/***************************************************************************
* *
* This library is Copyright (c) Raphael Zulliger <zulli@gmx.net>. *
* It is licensed under the GNU Library General Public License (LGPL). *
* *
***************************************************************************/
/** \file
* \brief Contains general functions for handling CANopen messages.
*
* The functions in this file helps the other functions to perform general
* can/canopen related things such as analysing all received can-messages
* and sending them to the correct function (nmt-processor, pdo-processor,
* ...
*/
#ifndef __general_h__
#define __general_h__
#include <def.h>
// Typedefs and datatypes used to store incomming can-messages. code was
// taken from arbracan (arbracan.sourceforge.net)
/** Union short. (taken from CanFestival)
*/
typedef union td_u_short {
struct { BYTE b0,b1; } b;
WORD w;
} SHORT;
/** incoming and outgoing messages are stored in this datatype. this datatype
* was taken from CanFestival
*/
typedef struct td_s_message {
/** CAN-id of the received/transmitted message
*/
SHORT cob_id;
/** sets rtr flag or not
*/
BYTE rtr;
/** defines count of valid data in the data-array
*/
BYTE len;
/** contains the data to send/receive. Datalength is up to 8 byte
*/
BYTE data[8];
} Message;
/** proccessRxCanMessages processes 5 messages from the queue. before the messages are
* processed by proccessRxCanMessages, they are stored in an receivebuffer
* (by interrupt). the size of this buffer can be specified here: maximum size: 256!
*/
#define RX_CAN_BUFFER_SIZE 5
/** this is the maximum of messages which will be processed by one call
* of Process_remoteRecv_PDO. this makes sure, the application has enough
* time to do its job.
*/
#define MAX_CAN_MESSAGE_ANALYSE 5
/** this function calles readRxBuffer( ), which reads all arrived can-message
* from the can-controller( if there's empty space to but the data in the
* buffer). then this function analyses every of the received CAN-message
* (up to MAX_CAN_MESSAGE_ANALYSE). analysing means: it checks wheter the
* message is a NMT, PDO, SDO, ... and sends the message to the correct
* function, which does the rest.
*/
void proccessRxCanMessages( void );
#endif // __general_h__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -