看了一下关于SDO的配置就这点了 也对比了一下是一样的[C] 纯文本查看 复制代码 /**
* @defgroup CO_STACK_CONFIG_SDO SDO server/client
* Specified in standard CiA 301
* @{
*/
/**
* Configuration of @ref CO_SDOserver
*
* Possible flags, can be ORed:
* - CO_CONFIG_SDO_SRV_SEGMENTED - Enable SDO server segmented transfer.
* - CO_CONFIG_SDO_SRV_BLOCK - Enable SDO server block transfer. If set, then
* CO_CONFIG_SDO_SRV_SEGMENTED must also be set.
* - #CO_CONFIG_FLAG_CALLBACK_PRE - Enable custom callback after preprocessing
* received SDO CAN message.
* Callback is configured by CO_SDOserver_initCallbackPre().
* - #CO_CONFIG_FLAG_TIMERNEXT - Enable calculation of timerNext_us variable
* inside CO_SDOserver_process().
* - #CO_CONFIG_FLAG_OD_DYNAMIC - Enable dynamic configuration of additional SDO
* servers (Writing to object 0x1201+ re-configures the additional server).
*/
#ifdef CO_DOXYGEN
#define CO_CONFIG_SDO_SRV (CO_CONFIG_SDO_SRV_SEGMENTED | CO_CONFIG_GLOBAL_FLAG_CALLBACK_PRE | CO_CONFIG_GLOBAL_FLAG_TIMERNEXT | CO_CONFIG_GLOBAL_FLAG_OD_DYNAMIC)
#endif
#define CO_CONFIG_SDO_SRV_SEGMENTED 0x02
#define CO_CONFIG_SDO_SRV_BLOCK 0x04
/**
* Size of the internal data buffer for the SDO server.
*
* If size is less than size of some variables in Object Dictionary, then data
* will be transferred to internal buffer in several segments. Minimum size is
* 8 or 899 (127*7) for block transfer.
*/
#ifdef CO_DOXYGEN
#define CO_CONFIG_SDO_SRV_BUFFER_SIZE 32
#endif
/**
* Configuration of @ref CO_SDOclient
*
* Possible flags, can be ORed:
* - CO_CONFIG_SDO_CLI_ENABLE - Enable SDO client.
* - CO_CONFIG_SDO_CLI_SEGMENTED - Enable SDO client segmented transfer.
* - CO_CONFIG_SDO_CLI_BLOCK - Enable SDO client block transfer. If set, then
* CO_CONFIG_SDO_CLI_SEGMENTED, CO_CONFIG_FIFO_ALT_READ and
* CO_CONFIG_FIFO_CRC16_CCITT must also be set.
* - CO_CONFIG_SDO_CLI_LOCAL - Enable local transfer, if Node-ID of the SDO
* server is the same as node-ID of the SDO client. (SDO client is the same
* device as SDO server.) Transfer data directly without communication on CAN.
* - #CO_CONFIG_FLAG_CALLBACK_PRE - Enable custom callback after preprocessing
* received SDO CAN message.
* Callback is configured by CO_SDOclient_initCallbackPre().
* - #CO_CONFIG_FLAG_TIMERNEXT - Enable calculation of timerNext_us variable
* inside CO_SDOclientDownloadInitiate(), CO_SDOclientDownload(),
* CO_SDOclientUploadInitiate(), CO_SDOclientUpload().
* - #CO_CONFIG_FLAG_OD_DYNAMIC - Enable dynamic configuration of SDO clients
* (Writing to object 0x1280+ re-configures the client).
*/
#ifdef CO_DOXYGEN
#define CO_CONFIG_SDO_CLI (0)
#endif
#define CO_CONFIG_SDO_CLI_ENABLE 0x01
#define CO_CONFIG_SDO_CLI_SEGMENTED 0x02
#define CO_CONFIG_SDO_CLI_BLOCK 0x04
#define CO_CONFIG_SDO_CLI_LOCAL 0x08
/**
* Size of the internal data buffer for the SDO client.
*
* Circular buffer is used for SDO communication. It can be read or written
* between successive SDO calls. So size of the buffer can be lower than size of
* the actual size of data transferred. If only segmented transfer is used, then
* buffer size can be as low as 7 bytes, if data are read/written each cycle. If
* block transfer is used, buffer size should be set to at least 1000 bytes, so
* maximum blksize can be used (blksize is calculated from free buffer space).
* Default value for block transfer is 1000, otherwise 32.
*/
#ifdef CO_DOXYGEN
#define CO_CONFIG_SDO_CLI_BUFFER_SIZE 32
#endif |