下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、/can 滤波器标准帧表格数据类型定义,在.h 的 can 驱动头文件中添加typedefunion_cansff_unsigned longword; structunsigned int cansffid1 :11; unsigned int rsv_bit1 :1; unsigned int en_bit1:1; unsigned int num_bit1:3; unsigned int cansffid2 :11; unsigned int rsv_bit2:1; unsigned int en_bit2:1; unsigned int num_bit2:3;bits;ucansff,
2、*p_ucansff;/can 滤波器扩展帧表格数据类型定义typedefunion_caneff_unsigned long word;structunsigned int caneffid1 :29; unsigned int num_bit:3;bits;ucaneff,*p_ucaneff;/*在.c 的 can 驱动中添加*/ #define canafram_add(0xe0038000) /验收滤波器 ram 首地址/验收滤波器表格#defineregcansff_tab(i)(*(volatile p_ucansff)(canafram_add + i*4)#define re
3、gcansff_grp_tab(i)(*(volatile p_ucansff)(canafram_add+i*4) #defineregcaneff_tab(i)(*(volatile p_ucaneff)(canafram_add + i*4)#define regcaneff_grp_tab(i)(*(volatile p_ucaneff)(canafram_add + i*4)/*函数原型 : init_can_accfilter(void)*参数说明 : 无*返回值: 无*说 明: 验收滤波器初始化设置函数*/ void init_can_accfilter(void)unsigne
4、d char i=0;can_afmr |=1;/关闭验收滤波器can_afmr |= 11;/使能修改相关寄存器can_afmr &= (12); /禁止 fullcan 模式/*独立标准帧标识符 0x01 和 0x02*/regcansff_tab(i).bits.cansffid2= 0x01; regcansff_tab(i).bits.en_bit2= 0;regcansff_tab(i).bits.num_bit2= 0;/使用的 can 控制器号regcansff_tab(i).bits.cansffid1= 0x02; regcansff_tab(i).bits.en_bit1
5、= 0;regcansff_tab(i).bits.num_bit1= 0;/使用的 can 控制器号;i+;/* 组 标 准 帧 标 识 符 ,0x030x05*/ regcansff_grp_tab(i).bits.cansffid2= 0x03; regcansff_grp_tab(i).bits.en_bit2= 0;regcansff_grp_tab(i).bits.num_bit2= 0;/使用的 can 控制器号;regcansff_grp_tab(i).bits.cansffid1= 0x05; regcansff_grp_tab(i).bits.en_bit1= 0;regc
6、ansff_grp_tab(i).bits.num_bit1= 0;/使用的 can 控制器号;i+;/* 独 立 扩 展 帧 标 识 符 0x06 和 0x07*/ regcaneff_tab(i).bits.caneffid1= 0x06;regcaneff_tab(i).bits.num_bit= 0;/使用的 can 控制器号; i+;regcaneff_tab(i).bits.caneffid1= 0x07;regcaneff_tab(i).bits.num_bit= 0;/使用的 can 控制器号; i+;/* 组 扩 展 帧 标 识 符 0x080x10*/ regcaneff_
7、grp_tab(i).bits.caneffid1= 0x08;regcaneff_grp_tab(i).bits.num_bit= 0;/使用的 can 控制器号; i+;regcaneff_grp_tab(i).bits.caneffid1= 0x09;regcaneff_grp_tab(i).bits.num_bit= 0;/使用的 can 控制器号;/*各表格起始地址,由于低 2 位无效,故要左移 2 位,0x01 表示一个 32 位的储存单元*/*用户根据上面设置的定各个表格的起始地址,2 标准帧占一个 32 位,一个扩展帧占一个 32 位 */can_sff_sa=0x002; c
8、an_sff_grp_sa = 0x012; can_eff_sa=0x022; can_eff_grp_sa = 0x042; can_eot =0x062;can_afmr &= 1;/打开验收滤波器can_afmr &= (11);/禁止修改相关寄存器“”“”at the end, xiao bian gives you a passage. minand once said, people who learn to learn are very happy people. in every wonderful life, learning is an eternal theme. as
9、 a professional clerical and teaching position, i understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning can achieve better self. only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the mar
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 拖拉机电器装试工诚信道德评优考核试卷含答案
- 2026年春国开电大无线局域网组建作业练习2答案
- 化工检修钳工岗前技术综合考核试卷含答案
- 地毯后整工风险评估与管理竞赛考核试卷含答案
- 井矿盐制盐工创新思维水平考核试卷含答案
- 表面活性剂制造工技能综合实践能力考核试卷含答案
- 采购员岗位责任制水平考核试卷含答案
- 印前图文制作员QC管理强化考核试卷含答案
- 2026年教师招聘《小学语文教学论》专项训练试题及答案
- 2026年中学教师《数学教学》考试冲刺试卷及解析
- 2025-2026年银行从业资格考试金融风险管理专项训练题库
- 2026年全球及中国SerDes IP及相关互连芯片市场独立研究报告
- 红河州州属事业单位2026年考试调动工作人员(29人)笔试备考题库及答案详解
- (2026秋新版)统编版道德与法治六年级上册全册教案
- 电控配电用电缆桥架(JBT 10216-2025)
- 高三英语考前梳理记忆(超完整)
- 决策树课件(共66张)
- 人教版数学一年级上册第一单元分层作业设计
- 沈阳飞机工业(集团)有限公司7厂412#金属蜂窝制造项目环境影响报告
- 北川县吉娜羌寨修建性详细规划
- 道路运输企业两类人员安全考核题库题库(1020道)
评论
0/150
提交评论