在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > STM32 CAN濾波器設(shè)置 Identifier filter

            STM32 CAN濾波器設(shè)置 Identifier filter

            作者: 時間:2016-11-13 來源:網(wǎng)絡(luò) 收藏
            stm32的屏蔽濾波功能對ID是有要求的,mpc2515你可以直接寫ID,但在STM32 這里ID必須進行移位處理.

            對照下表:

            本文引用地址:http://www.biyoush.com/article/201611/316410.htm

            Extended Id濾波器設(shè)置(已驗證,只接受Receive_ID節(jié)點的數(shù)據(jù)):

            /* CAN filter init */ //設(shè)置成只能接受主節(jié)點 Extended Id:01 的數(shù)據(jù) reference manual p557
            CAN_FilterInitStructure.CAN_FilterNumber=0;
            CAN_FilterInitStructure.CAN_FilterMode=CAN_FilterMode_IdMask;
            //CAN_FilterInitStructure.CAN_FilterMode=CAN_FilterMode_IdList;//###########################################
            CAN_FilterInitStructure.CAN_FilterScale=CAN_FilterScale_32bit;
            CAN_FilterInitStructure.CAN_FilterIdHigh=(((u32)Receive_ID<<3)&0xFFFF0000)>>16;
            CAN_FilterInitStructure.CAN_FilterIdLow=(((u32)Receive_ID<<3)|CAN_ID_EXT|CAN_RTR_DATA)&0xFFFF;
            CAN_FilterInitStructure.CAN_FilterMaskIdHigh=0xFFFF;
            CAN_FilterInitStructure.CAN_FilterMaskIdLow=0xFFFF; // 1 :must match” or 0: as “don’t care
            CAN_FilterInitStructure.CAN_FilterFIFOAssignment=0;
            CAN_FilterInitStructure.CAN_FilterActivation=ENABLE;
            CAN_FilterInit(&CAN_FilterInitStructure);

            Standard Id濾波器設(shè)置:

            CAN_FilterMaskId 位的含義是

            Mask
            Each bit of the register specifies whether the bit of the associated identifier register must
            match with the corresponding bit of the expected identifier or not.
            0: Don’t care, the bit is not used for the comparison
            1: Must match, the bit of the incoming identifier must have the same level has specified in
            the corresponding identifier register of the filter.

            我們這里全部設(shè)置成1 ,也就是只接受CAN_Filter中設(shè)置的節(jié)點的數(shù)據(jù)



            關(guān)鍵詞: STM32CAN濾波器設(shè)

            評論


            技術(shù)專區(qū)

            關(guān)閉