DWM1000 Blink结构 -- 帧过滤第一节
生活随笔
收集整理的這篇文章主要介紹了
DWM1000 Blink结构 -- 帧过滤第一节
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
DWM1000 幀結(jié)構(gòu)分析主要學(xué)習(xí)DWM1000 幀過濾功能,希望在目前DS-TWR定位系統(tǒng)中增加中斷和幀過濾功能,幀過濾功能可以有效減少系統(tǒng)中的各個(gè)模塊同時(shí)收發(fā)數(shù)據(jù)時(shí)的干擾問題,從而極大的提供系統(tǒng)穩(wěn)定性以及刷新頻率。幀過濾以及中斷是近期學(xué)習(xí)的重點(diǎn),學(xué)習(xí)基于官方代碼為準(zhǔn),部分摘錄官方代碼進(jìn)行說明解釋。
?
1 Blink 數(shù)據(jù)格式
1.1 Blink 數(shù)據(jù)結(jié)構(gòu)格式定義
1.2 Blink數(shù)據(jù)結(jié)構(gòu)代碼定義
typedef struct {uint8 frameCtrl; // frame control bytes 00uint8 seqNum; // sequence_number 01uint8 tagID[BLINK_FRAME_SOURCE_ADDRESS]; // 02-09 64 bit addressuint8 fcs[2] ; // 10-11 CRC } iso_IEEE_EUI64_blink_msg ;Blink 數(shù)據(jù)供12byte,用戶需要填寫的10byte,CRC是硬件自動附加在數(shù)據(jù)上的,無需用戶處理,只需要留空即可。Blink 數(shù)據(jù)中使用的地址為IEEE 64位長地址。
1.3 EVK1000 TAG發(fā)送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 代碼
//主循環(huán)禁止幀過濾dwt_enableframefilter(DWT_FF_NOTYPE_EN); //disable frame filtering inst->frameFilteringEnabled = 0 ;//接收回調(diào)函數(shù) switch(rxd->fctrl[0]) {//blink type framecase 0xC5:if(rxd->datalength == 12){rxd_event = DWT_SIG_RX_BLINK;}elserxd_event = SIG_RX_UNKNOWN;break;
?
?Blink 是自定義數(shù)據(jù)結(jié)構(gòu),非標(biāo)準(zhǔn)IEEE 802.15.4 MAC 數(shù)據(jù)格式,在接收這樣的數(shù)據(jù)結(jié)構(gòu)時(shí)需要 禁止幀過濾功能。
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?標(biāo)準(zhǔn)IEEE 802.15.4 MAC 數(shù)據(jù)
2.1 標(biāo)準(zhǔn)IEEE 802.15.4 MAC 數(shù)據(jù)格式定義
1.6?標(biāo)準(zhǔn)IEEE 802.15.4 MAC 數(shù)據(jù)代碼定義
typedef struct {uint8 frameCtrl[2]; // frame control bytes 00-01uint8 seqNum; // sequence_number 02uint8 panID[2]; // PAN ID 03-04uint8 destAddr[ADDR_BYTE_SIZE_S]; // 05-06uint8 sourceAddr[ADDR_BYTE_SIZE_S]; // 07-08uint8 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 層數(shù)據(jù)結(jié)構(gòu)請參閱:https://www.cnblogs.com/tuzhuke/p/10274730.html
?
轉(zhuǎn)載于:https://www.cnblogs.com/tuzhuke/p/10261192.html
總結(jié)
以上是生活随笔為你收集整理的DWM1000 Blink结构 -- 帧过滤第一节的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C语言 队列的实现(链表实现)
- 下一篇: MATLAB小波分析工具箱的使用