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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM