登录
首页 » 嵌入式芯片 » 绝对原创,开源一STM32项目,CAN,UART,Input检测 原创相对高效性能与代码重用平衡思路(缓冲队列加软中断),可直接做工程模板

绝对原创,开源一STM32项目,CAN,UART,Input检测 原创相对高效性能与代码重用平衡思路(缓冲队列加软中断),可直接做工程模板

于 2022-03-21 发布 文件大小:1.27 MB
0 344
下载积分: 2 下载次数: 2

代码说明:

1、CAN收发队列   使用内存FIFO缓冲CAN帧,适合大数据量通信;并使用内部软中断处理CAN数据,相当于事件响应,综合应该比查询方式节省不少时间,也应该比OS调度省点时间。Can.C:底层处理,Communi.C:与应用层高相关。 应用层处理流程用函数指针表的方式调用减少代码量及阅读整齐;实现CAN各种错误记录机制。已初步测试,该机制可用。   CAN处理流程:     接收:CAN1_RX0_IRQHandler_Name (void), CAN1_RX1_IRQHandler(void)           接收中断,CAN_QueueWriteQuick()将当前的有效报文压入内存FIFO,压入的数据为整个CAN邮箱数据,所以后续的处理函数可以分辨出完整的数据。 void CAN1_RX0_IRQHandler_Name (void) // CAN1_RX0_IRQHandler_Name { /* FIFO从空状态开始,在接收到第一个有效的报文后,FIFO状态变为挂号_1(pending_1), 硬件相应地把CAN_RFR寄存器的FMP[1:0]设置为’01’(二进制01b)。 软件可以读取FIFO输出邮箱来读出邮箱中的报文,然后通过对CAN_RFR寄存器的RFOM位 设置’1’来释放邮箱,这样FIFO又变为空状态了。如果在释放邮箱的同时, 又收到了一个有效的报文,那么FIFO仍然保留在挂号_1状态,软件可以读取FIFO 输出邮箱来读出新收到的报文。 如果应用程序不释放邮箱,在接收到下一个有效的报文后,FIFO状态变为 挂号_2(pending_2),硬件相应地把FMP[1:0]设置为’10’(二进制10b)。 重复上面的过程,第三个有效的报文把FIFO变为挂号_3状态(FMP[1:0]=11b)。 此时,软件必须对RFOM位设置1来释放邮箱,以便FIFO

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • keil测量实例
    keil measure example
    2022-01-24 09:01:46下载
    积分:1
  • send word to computer words are I love you
    send word to computer words are I love you
    2022-02-04 02:16:28下载
    积分:1
  • S3C444B0X the ARM7 processor on the pulse measurement instrument procedures, wit...
    在ARM7处理器S3C444B0X上的脉搏测量仪程序 ,带LCD显示和触摸屏-S3C444B0X the ARM7 processor on the pulse measurement instrument procedures, with LCD display and touch screen
    2022-06-30 10:33:33下载
    积分:1
  • CAN协议LPC2129
    这个程序是用来使用LPC2129的CAN模块发送接收消息。在这里,博世公布的几个版本的CAN规范和最新的CAN2.0刊登在1991年该规范有两个部分; A部分是用于与11位标识符的标准格式,而部分B是用于与29位标识符的扩展格式。使用11位标识符的CAN器件通常被称为CAN2.0A和使用29位标识符通常被称为CAN2.0B一个CAN设备。这些标准是免费提供的博世连同其他规格和白皮书
    2022-01-28 11:11:48下载
    积分:1
  • seed 的dsp程序s eed 的dsp程序seed 的dsp程序
    seed 的dsp程序s eed 的dsp程序seed 的dsp程序-dsp procedures seed of s eed of the dsp program dsp procedures seed
    2022-03-18 02:18:54下载
    积分:1
  • 热敏打印机开发例程NuMicro(TM) NUC505 80mm Thermal Printer Software Package V1.0
    This solution is an 80mm thermal printer printer that employs IPI 800932 print heads and an automatic paper cutter.  This printer has a wide range of applications and can be used to print various receipts and invoices for POS systems,  cashiers, and ATM.This solution utilizes the NUC505 series and is capable of reaching a printing speed of 150mm per  second. It supports multiple transmission methods, including Bluetooth, serial ports, network ports, USB printer class,  and so on, and supports Ethernet data communication and data transmission. This solution is also furnished with  out-of-paper detection and overheating protection circuits.  This file includes the PC software and source code of 80mm Thermal Printer. File Path: PC software: SW_NUC505_80mm_Thermal_Printer_V1.0PC Software
    2022-09-10 20:05:04下载
    积分:1
  • LPC2148的lcd1602驱动程序
    基于lpc2148的lcd1602驱动程序,附带了一段led小程序
    2022-05-07 01:29:10下载
    积分:1
  • ZLG LPC 2100 new easyARM2100 CD
    ZLG LPC 2100 新easyARM2100光盘-ZLG LPC 2100 new easyARM2100 CD-ROM
    2022-03-13 15:43:54下载
    积分:1
  • Philips LPC series ARM7 ucos demo program permanent exploration of electronic
    飞利浦 LPC系列ARM7 ucos演示程序 基于永探电子开发板-Philips LPC series ARM7 ucos demo program permanent exploration of electronic-based development board
    2022-01-28 14:43:01下载
    积分:1
  • IAR MSP430F149 12位AD程序
    IAR MSP430F149 12位AD程序-IAR MSP430F149 12 AD procedures
    2022-08-11 03:46:07下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载