下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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年文学鉴赏古代诗词现代文学综合测试题
- 2026年桂林师范单招测试题附答案
- 2026年医疗急救知识与技能考核题含急救药品使用
- 2026年中级审计考试专项突破试题
- 2026年旅游管理专业知识题库旅游从业者学习之用
- 2026年江西单招试题及答案1套
- 2026年网络工程师技术能力考核试题
- 2026年环境保护政策与措施知识题库
- 2026年文学创作技巧题库含小说写作与诗歌鉴赏
- 2026年软件测试工程师考试模拟题性能测试方向
- 话语体系构建的文化自信与叙事创新课题申报书
- 2026年春苏教版新教材小学科学二年级下册(全册)教学设计(附教材目录P97)
- 2026年基因测序技术临床应用报告及未来五至十年生物科技报告
- 服装销售年底总结
- 文物安全保护责任书范本
- 广东省惠州市某中学2025-2026学年七年级历史上学期期中考试题(含答案)
- 2025公文写作考试真题及答案
- 停电施工方案优化(3篇)
- DB64∕T 1279-2025 盐碱地综合改良技术规程
- 2025年度耳鼻喉科工作总结及2026年工作计划
- 2024年执业药师《药学专业知识(一)》试题及答案
评论
0/150
提交评论