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

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

于 2022-03-21 发布 文件大小:1.27 MB
0 294
下载积分: 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 个回复

  • FREESCALE 16位单MC9S12DG128的串口驱动程序,环行缓冲区大小可设置,支持半双工RS485通信,可调用用户事件...
    FREESCALE 16位单片机片MC9S12DG128的串口驱动程序,环行缓冲区大小可设置,支持半双工RS485通信,可调用用户事件-SCM MC9S12DG128 Serial Driver, Ring buffer size can be set up to support half-duplex RS485 communications, users can call the incident
    2022-03-25 02:13:29下载
    积分:1
  • arm做的MP3播放器,自己公司开发的MP3播放器的源码.
    arm做的MP3播放器,自己公司开发的MP3播放器的源码.-arm to do the MP3 player, the company developed its own MP3 player source.
    2022-02-07 10:40:32下载
    积分:1
  • LPC2148 USB音频设备的例子
    LPC2148 USB Audio Device Example This USB example project implements an USB Audio Device that connects via the USB interface to the PC. It may be used on the following devices: LPC2141 LPC2142 LPC2144 LPC2146 LPC2148 An USB Audio Device (HID) does not require any special USB driver, since the USB Audio support is already built into Windows 2000 and Windows XP. Therefore USB Audio devices can be directly connected to the computer. This example project is designed to work with Keil MCB2140 Evaluation Board. Refer to Running USBAudio for information on how to operate this example project.-LPC2148 USB Audio Device Example This USB example project implements an USB Audio Device that connects via the USB interface to the PC. It may be used on the following devices: LPC2141 LPC2142 LPC2144 LPC2146 LPC2148 An USB Audio Device (HID) does not require any special USB driver, since the USB Audio support is already built into Windows 2000 and Windows XP. Therefore USB Aud
    2022-01-26 01:19:28下载
    积分:1
  • MSP430 dot matrix LCD driver graphics 12864
    MSP430驱动12864-3图形点阵液晶-MSP430 dot matrix LCD driver graphics 12864-3
    2022-01-26 05:48:56下载
    积分:1
  • LPC23xx系列Keil例程
    lpc23xx/24xx — — keil 常见 — — 公司 — — lpc23xx.h 定义文件的 LPC23xx 的所有寄存器 LPC24xx 寄存器定义也是包括在内的。 — — irq.h 中断相关的定义和 API 原型 — — type.h 类型定义 — — target.h 目标具体定义为 Keil 的 MCB2300 主板 — — timer.h 定义和头文件的定时器模块 — — src — —
    2022-05-30 03:39:00下载
    积分:1
  • Read and write MMC simulation, using the Philips chip lpc2132
    MMC读写仿真,使用飞利浦芯片lpc2132-Read and write MMC simulation, using the Philips chip lpc2132
    2022-01-30 11:05:44下载
    积分:1
  • Huazhong University of Science and Technology College of Optoelectronic Science...
    华中科技大学光电子科学与工程学院本科光纤通信课程教学课件(双语教学)-Huazhong University of Science and Technology College of Optoelectronic Science and Engineering Undergraduate Teaching optical fiber communications software (bilingual education)
    2022-04-10 23:01:56下载
    积分:1
  • LPC1788 UART
    该示例是 USB 到串口 (UART0) 为 LPC1788。 本示例描述如何在 LPC177x_8x 上使用 UART 接口。
    2023-08-14 16:15:03下载
    积分:1
  • 5323454rq qwerqwr qwer
    weafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwrrqrqwqwrqwrwweafsdfasdas q fsdfasdfsdfasdq qeqwer qwerqwrq rqrqwrqwrqrqwqrqwrqwrqwrqwrqwrqwr
    2022-01-30 13:58:56下载
    积分:1
  • 这是在可以应用实例LPC2100 ARM处理器。运行时环境…
    这是关于LPC2100 ARM处理器在CAN中应用的实例.运行环境是KEIL ARM.-This is on the LPC2100 ARM processor in the CAN application examples. Runtime Environment is KEIL ARM.
    2022-01-26 01:20:57下载
    积分:1
  • 696516资源总数
  • 106405会员总数
  • 10今日下载