• DWM1000 Blink结构 -- 帧过滤第一节


    DWM1000 帧结构分析主要学习DWM1000 帧过滤功能,希望在目前DS-TWR定位系统中增加中断和帧过滤功能,帧过滤功能可以有效减少系统中的各个模块同时收发数据时的干扰问题,从而极大的提供系统稳定性以及刷新频率。帧过滤以及中断是近期学习的重点,学习基于官方代码为准,部分摘录官方代码进行说明解释。

    1 Blink 数据格式

    1.1 Blink 数据结构格式定义

    1.2 Blink数据结构代码定义

    typedef struct
    {
        uint8 frameCtrl;                                 //  frame control bytes 00
        uint8 seqNum;                                   //  sequence_number 01
        uint8 tagID[BLINK_FRAME_SOURCE_ADDRESS];        //  02-09 64 bit address
        uint8 fcs[2] ;                                  //  10-11 CRC
    } iso_IEEE_EUI64_blink_msg ;

    Blink 数据供12byte,用户需要填写的10byte,CRC是硬件自动附加在数据上的,无需用户处理,只需要留空即可。Blink 数据中使用的地址为IEEE 64位长地址。

    1.3 EVK1000 TAG发送blink 代码

    memcpy(inst->blinkmsg.tagID, inst->eui64, ADDR_BYTE_SIZE_L);
    //blink frames with IEEE EUI-64 tag ID
    inst->blinkmsg.frameCtrl = 0xC5 ;
    inst->blinkmsg.seqNum = inst->frameSN++;
    
    dwt_writetxdata(flength, (uint8 *)  (&inst->blinkmsg), 0) ; // write the frame data
    dwt_writetxfctrl(flength, 0, 1);

    上述代码摘录拼凑而成

    1.4 EVK1000 ANTHOR接收blink 代码

    //主循环禁止帧过滤
    dwt_enableframefilter(DWT_FF_NOTYPE_EN); //disable frame filtering inst->frameFilteringEnabled = 0 ; //接收回调函数 switch(rxd->fctrl[0]) { //blink type frame case 0xC5: if(rxd->datalength == 12) { rxd_event = DWT_SIG_RX_BLINK; } else rxd_event = SIG_RX_UNKNOWN; break;

     Blink 是自定义数据结构,非标准IEEE 802.15.4 MAC 数据格式,在接收这样的数据结构时需要 禁止帧过滤功能

    Frame filtering is a feature of the DW1000 IC that can parse the received data of a frame that complies with the MAC encoding defined in the IEEE 802.15.4–2011 standard, identifying the frame type and its
    destination address fields, match these against the IC’s own address information, and only accept frames that pass the filtering rules.
    

      

    2 标准IEEE 802.15.4 MAC 数据

    2.1 标准IEEE 802.15.4 MAC 数据格式定义

    1.6 标准IEEE 802.15.4 MAC 数据代码定义

    typedef struct
    {
        uint8 frameCtrl[2];                             //  frame control bytes 00-01
        uint8 seqNum;                                   //  sequence_number 02
        uint8 panID[2];                                 //  PAN ID 03-04
        uint8 destAddr[ADDR_BYTE_SIZE_S];                 //  05-06
        uint8 sourceAddr[ADDR_BYTE_SIZE_S];               //  07-08
        uint8 messageData[MAX_USER_PAYLOAD_STRING_SS] ; //  09-124 (application data and any user payload)
        uint8 fcs[2] ;                                  //  125-126  we allow space for the CRC as it is logically part of the message. However ScenSor TX calculates and adds these bytes.
    } srd_msg_dsss ;

    更多MAC 层数据结构请参阅:https://www.cnblogs.com/tuzhuke/p/10274730.html

  • 相关阅读:
    #ASP.NET Core 1.0 Key Features
    #asp.net core mvc 的视图注入
    # asp.net core 1.0 项目结构
    dotnet core 初试两个小问题解决
    1044 火星数字(20 分)
    1043 输出PATest(20 分)
    1042 字符统计(20 分)
    1041 考试座位号(15 分)
    1040 有几个PAT(25 分)
    1039 到底买不买(20 分)
  • 原文地址:https://www.cnblogs.com/tuzhuke/p/10261192.html
Copyright © 2020-2023  润新知