• 大小: 305KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: 其他
  • 标签: CANOpen  源代码  

资源简介

MicoCANOpen很好的学习源代码,包括了CANOpen实现的源代码

资源截图

代码片段和文件信息

/**************************************************************************
MODULE:    MCO
CONTAINS:  MicroCANopen implementation
COPYRIGHT: embedded Systems Academy Inc. 2002-2007.
           All rights reserved. www.microcanopen.com
           This software was written in accordance to the guidelines at
           www.esacademy.com/software/softwarestyleguide.pdf
DISCLAIM:  Read and understand our disclaimer before using this code!
           www.esacademy.com/disclaim.htm
LICENSE:   THIS IS THE EDUCATIONAL VERSION OF MICROCANOPEN
           See file license_educational.txt or
           www.microcanopen.com/license_educational.txt
           A commercial MicroCANopen license is available at
           www.CANopenStore.com
VERSION:   3.30 ESA 30-JAN-07
           $LastChangedDate: 2007-01-30 10:38:13 -0800 (Tue 30 Jan 2007) $
           $LastChangedRevision: 232 $
***************************************************************************/ 

#include “mco.h“
#include “mcohw.h“
#include 

#if USE_MICROLSS == 1
#include “mlss.h“
#endif

/**************************************************************************
GLOBAL VARIABLES
***************************************************************************/ 

// this structure holds all node specific configuration
MCO_CONFIG MEM_FAR gMCOConfig;

#if NR_OF_TPDOS > 0
// this structure holds all the TPDO configuration data for up to 4 TPDOs
TPDO_CONFIG MEM_FAR gTPDOConfig[NR_OF_TPDOS];
#endif

// this is the next TPDO to be checked in MCO_ProcessStack
UNSIGNED8 MEM_FAR gTPDONr = NR_OF_TPDOS;

#if NR_OF_RPDOS > 0
// this structure holds all the RPDO configuration data for up to 4 RPDOs
RPDO_CONFIG MEM_FAR gRPDOConfig[NR_OF_RPDOS];
#endif

// this structure holds the current receive message
CAN_MSG MEM_FAR gRxCAN;

// this structure holds the CAN message for SDO responses or aborts
CAN_MSG MEM_FAR gTxSDO;

// process image from user_xxxx.c
extern UNSIGNED8 MEM_NEAR gProcImg[];

// table with SDO Responses for read requests to OD - defined in user_xxx.c
extern UNSIGNED8 MEM_CONST SDOResponseTable[];


/**************************************************************************
LOCAL FUNCTIONS
***************************************************************************/

// SDO Abort Messages
#define SDO_ABORT_UNSUPPORTED     0x06010000UL
#define SDO_ABORT_NOT_EXISTS      0x06020000UL
#define SDO_ABORT_READONLY        0x06010002UL
#define SDO_ABORT_TYPEMISMATCH    0x06070010UL
#define SDO_ABORT_UNKNOWN_COMMAND 0x05040001UL
#define SDO_ABORT_UNKNOWNSUB      0x06090011UL

/**************************************************************************
DOES:    Search the SDO Response table for a specifc index and subindex.
RETURNS: 255 if not found otherwise the number of the record found
         (staring at zero)
**************************************************************************/
UNSIGNED8 MCO_Search_OD
  (
  UNSIG

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2007-02-02 09:45  Doc\
     文件        7645  2007-01-29 21:22  Doc\LPC2000BootloaderDemo.pdf
     文件       72392  2007-01-29 21:22  Doc\MicroCANopen Manual Edu.pdf
     文件       39198  2007-01-29 21:22  Doc\MicroLSS_Generic.pdf
     文件       10622  2007-01-29 21:22  Doc\UsingCANopenArchitectEDS.pdf
     文件        3567  2007-01-30 10:25  license_educational.txt
     目录           0  2007-02-02 09:45  MCO\
     文件       26127  2007-01-30 10:34  MCO\mco.c
     文件        9951  2007-01-30 10:34  MCO\mco.h
     文件        9630  2007-01-30 10:34  MCO\mcohw.h
     文件        3022  2007-01-30 20:01  MCO\mcohw_nvol_sim.c
     文件        3699  2007-01-30 10:25  MCO\mlss.h
     文件       13631  2007-01-30 10:25  MCO\mlssslv.c
     目录           0  2007-02-02 09:45  MCO_ExampleCC01\
     目录           0  2007-02-02 09:45  MCO_ExampleCC01\lst\
     文件        2676  2007-01-30 10:34  MCO_ExampleCC01\mainCC01.c
     文件       12155  2007-01-30 10:34  MCO_ExampleCC01\mcohwCC01.c
     文件        1902  2007-01-30 20:13  MCO_ExampleCC01\MCO_CC01.Opt
     文件        2857  2007-01-30 20:13  MCO_ExampleCC01\MCO_CC01.Uv2
     文件       22080  2007-01-29 21:22  MCO_ExampleCC01\mco_cc01_r.prj
     文件        3143  2007-01-30 10:34  MCO_ExampleCC01\nodecfg.h
     目录           0  2007-02-02 09:45  MCO_ExampleCC01\obj\
     文件       18189  2007-01-30 20:12  MCO_ExampleCC01\obj\MCO_CC01.hex
     文件        1939  2007-01-30 20:46  MCO_ExampleCC01\procimg.h
     文件        3974  2007-01-30 20:01  MCO_ExampleCC01\rCC01io.c
     文件        3055  2007-01-30 20:01  MCO_ExampleCC01\rCC01io.h
     文件        1909  2007-01-30 10:25  MCO_ExampleCC01\read_me.txt
     文件        4795  2007-01-30 20:46  MCO_ExampleCC01\user_CC01.c
     目录           0  2007-02-02 09:45  MCO_ExampleLPC2129\
     目录           0  2007-02-02 09:45  MCO_ExampleLPC2129\Flash\
     文件        3417  2006-08-22 23:24  MCO_ExampleLPC2129\Flash.ld
............此处省略63个文件信息

评论

共有 条评论