CAN通讯的2个3级深度的FIFO使用

2019-08-14 01:05发布

 can  有2个3级深度的FIFO,    这2个 是同时再用么?   第一个FIFO满了   自动存储到第2个 FIFO ?
例程上  只读了第一个  FIFO 
  CAN_Receive(CAN1, CAN_FIFO0, &RxMessage);//读取数据 
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
14条回答
as2807479
2019-08-14 14:36
回复【3楼】正点原子:
---------------------------------
FIFO1 中断 服务函数是 void USB_LP_CAN1_RX0_IRQHandler(void)  还是 void CAN1_RX1_IRQHandler(void) ? 

//过滤器
  CAN_FilterInitStructure.CAN_FilterNumber         = 0;   //过滤器0
  CAN_FilterInitStructure.CAN_FilterMode           = CAN_FilterMode_IdMask; //标识符屏蔽位模式
   CAN_FilterInitStructure.CAN_FilterScale    = CAN_FilterScale_32bit; //过滤位宽为单个32位 
   CAN_FilterInitStructure.CAN_FilterIdHigh         = 0x0000;//32位ID
   CAN_FilterInitStructure.CAN_FilterIdLow          = 0x0000;
   CAN_FilterInitStructure.CAN_FilterMaskIdHigh     = 0x0000;//32位MASK
   CAN_FilterInitStructure.CAN_FilterMaskIdLow      = 0x0000;
   CAN_FilterInitStructure.CAN_FilterFIFOAssignment = CAN_Filter_FIFO0; //过滤器0关联到FIFO0
  CAN_FilterInitStructure.CAN_FilterActivation     = ENABLE;  //激活过滤器0

   CAN_FilterInit(&CAN_FilterInitStructure); //过滤器初始化

//过滤器

  CAN_FilterInitStructure.CAN_FilterNumber         = 1 ;   //过滤器1
  CAN_FilterInitStructure.CAN_FilterMode           = CAN_FilterMode_IdMask; //标识符屏蔽位模式
   CAN_FilterInitStructure.CAN_FilterScale    = CAN_FilterScale_32bit; //过滤位宽为单个32位 
   CAN_FilterInitStructure.CAN_FilterIdHigh         = 0x0000;//32位ID
   CAN_FilterInitStructure.CAN_FilterIdLow          = 0x0000;
   CAN_FilterInitStructure.CAN_FilterMaskIdHigh     = 0x0000;//32位MASK
   CAN_FilterInitStructure.CAN_FilterMaskIdLow      = 0x0000;
   CAN_FilterInitStructure.CAN_FilterFIFOAssignment = CAN_Filter_FIFO1; //过滤器1关联到FIFO1
  CAN_FilterInitStructure.CAN_FilterActivation     = ENABLE;  //激活过滤器1

   CAN_FilterInit(&CAN_FilterInitStructure); //过滤器初始化


过滤器1关联到FIFO1 后  中断服务函数中的    CAN_IT_FMP1  、 CAN_IT_FOV1 、CAN_IT_FF1 这三个中断  都进不去。
CAN_ITConfig(CAN1,CAN_IT_FMP0 | CAN_IT_FF0 | CAN_IT_FOV0,ENABLE);
CAN_ITConfig(CAN1,CAN_IT_FMP1 | CAN_IT_FF1 | CAN_IT_FOV1,ENABLE); //FIFO0消息挂号中断允许.

一周热门 更多>