-
大小: 3.85MB文件类型: .zip金币: 2下载: 1 次发布日期: 2023-08-14
- 语言: 其他
- 标签: CanFestival CANOPEN CAN
资源简介
CanFestival 3.10 是 CanFestival 最新版本了,CANOPEN协议必看的内家,支持WINDOWS,LINUX,ARM,单片机等,可以去官网看细节介绍,谢谢~
代码片段和文件信息
/*
This file is part of CanFestival a library implementing CanOpen Stack.
Copyright (C): Edouard TISSERANT and Francis DUPIN
AT91 Port: Peter CHRISTEN
See COPYING file for copyrights details.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*/
//#define DEBUG_WAR_CONSOLE_ON
//#define DEBUG_ERR_CONSOLE_ON
#include “can_AT91.h“
#include “canfestival.h“
void can_irq_handler(void);
unsigned char canInit(unsigned int bitrate)
/******************************************************************************
Initialize the hardware to receive CAN messages and start the timer for the
CANopen stack.
INPUT
OUTPUT
******************************************************************************/
{
unsigned char i;
AT91S_CAN_MB *mb_ptr = AT91C_base_CAN_MB0;
// Enable CAN PIOs
AT91F_CAN_CfgPIO();
// Enable CAN Clock
AT91F_CAN_CfgPMC();
// Enable CAN Transceiver
AT91F_PIOA_CfgPMC();
// Init CAN Interrupt Source Level
AT91F_AIC_ConfigureIt(AT91C_base_AIC // CAN base address
AT91C_ID_CAN // CAN ID
AT91C_AIC_PRIOR_HIGHEST // Max priority
AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL // Level sensitive
can_irq_handler); // C Handler
AT91F_AIC_EnableIt(AT91C_base_AIC AT91C_ID_CAN);
if (bitrate <= 500)
{
// CANopen 10..500 kbit with 16 tq sample point is at 14 tq
// all values are added to 1 by hardware
// Resynchronisation jump width (SJW) = 1 tq
// Propagation Time Segment (PRS) = 5 tq
// Phase Segment 1 (PHS1) = 8 tq
// Phase Segment 2 (PHS2) = 2 tq
// Total = 16 tq
AT91F_CAN_CfgBaudrateReg(AT91C_base_CAN
(AT91C_MASTER_CLOCK/16/1000/bitrate - 1) << 16 | 0x0471);
}
else
return 0;
// Enable CAN and Wait for WakeUp Interrupt
// AT91F_CAN_EnableIt(AT91C_base_CAN AT91C_CAN_WAKEUP);
AT91F_CAN_CfgModeReg(AT91C_base_CAN AT91C_CAN_CANEN);
// Reset all mailsboxes (MBs) filters are zero (accept all) by clear all MB
// Set the lower MBs as rx buffer
for (i = 0; i < NB_RX_MB; i++ mb_ptr++)
// Configure receive MBs as receive buffer last as receive overwrite
AT91F_InitMailboxRegisters(mb_ptr
((i < (NB_RX_MB - 1)) ? AT91C_CAN_MOT_RX : AT91C_CAN_MOT_RXOVERWRITE)
| AT91C_CAN_PRIOR // Mailbox Mode Reg
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 173 2011-04-13 14:29 CanFestival-3-1041153c5fd2\.hg_archival.txt
文件 1299 2011-04-13 14:29 CanFestival-3-1041153c5fd2\.hgignore
文件 131 2011-04-13 14:29 CanFestival-3-1041153c5fd2\.hgtags
文件 123 2011-04-13 14:29 CanFestival-3-1041153c5fd2\AUTHORS
文件 24713 2011-04-13 14:29 CanFestival-3-1041153c5fd2\CHANGES
文件 382 2011-04-13 14:29 CanFestival-3-1041153c5fd2\CONTRIBUTORS
文件 1518 2011-04-13 14:29 CanFestival-3-1041153c5fd2\COPYING
文件 5608 2011-04-13 14:29 CanFestival-3-1041153c5fd2\CanFestival-3.vc8.sln
文件 6808 2011-04-13 14:29 CanFestival-3-1041153c5fd2\CanFestival-3.vc8.vcproj
文件 24381 2011-04-13 14:29 CanFestival-3-1041153c5fd2\LICENCE
文件 1587 2011-04-13 14:29 CanFestival-3-1041153c5fd2\Makefile.in
文件 28555 2011-04-13 14:29 CanFestival-3-1041153c5fd2\configure
文件 191 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\README.Debian
文件 178 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-devel.install
文件 120 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-examples.install
文件 79 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-objdictedit.install
文件 1107 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-objdictedit.postinst
文件 587 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-objdictedit.postrm
文件 41 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-peak.install
文件 905 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-peak.postinst
文件 1032 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-peak.postrm
文件 37 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-socket.install
文件 38 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-virtual.install
文件 905 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-virtual.postinst
文件 1032 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\canfestival-virtual.postrm
文件 206 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\changelog
文件 2 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\compat
文件 1325 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\control
文件 335 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\control-peak_linux
文件 1324 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\control-socket
文件 1027 2011-04-13 14:29 CanFestival-3-1041153c5fd2\debian\control-virtual
............此处省略388个文件信息
- 上一篇:锅炉动态特性及其数学模型.pdf
- 下一篇:geoda软件教程
相关资源
- 周立功PCI CAN卡LINUX驱动ubuntu16.04内核
- 基于S32K144的CANbootloader
- 基于ARM7处理器的CAN总线网络设计
- Can EC-MPS reduce gastrointestinal side effect
- 佳能时尚扫描仪CanoScan LiDE 500F
- CanoScan佳能4200f扫描仪驱动 v8.6.1.1a 官
- 佳能CanoScan 9000F扫描仪驱动 官方版
- 佳能canon lbp3000激光打印机驱动 for w
- STM32F103VCT6TR - High-density performance lin
- 基于MC68HC908GZ32的CAN-LIN网关设计
- 如何在CANVAS中使用D3.JS
- 基于CAN总线与ZigBee的瓦斯实时监测及
- Delphi XE10 Seattle移动开发指南完整版
- CiA-402-2-version-3.0.0
- ISO14229协议
- CAN和1939全套资料
- 亚信防毒墙Officescan卸载工具DelTrendR
- 新能源电动车快充2015年国标充电完整
- js canvas写的游戏 俄罗斯方块
- 基于CAN总线的智能照明系统的设计和
- 倍福通过NC方式控制第三方伺服步科配
- x-Scan3.3破解版
- ipscan-win32
- Canvas 坦克大战
- 手把手教你学 CAN 总线 来清民国 高清
- 佳能相机开发EDSDK_13.10.21_for_Windows.z
- zw_canny.zip
- 综合Canny法与小波变换的边缘检测方法
- SuperScan 3.0汉化纯净版
- linux下socket can 编程详解
评论
共有 条评论