欢迎来到天天文库
浏览记录
ID:14629218
大小:41.00 KB
页数:13页
时间:2018-07-29
《zigbee接收数据流程图》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Zigbee接收数据流程图Zigbee协议利用一个13192的接收中断处理接收事件voidinterruptIRQIsr(void)>>>>>>>>>>>>>>>>>>>>>>>对13192的中断处理事件if((u16StatusContent&RX_IRQ_MASK)!=0)//接收中断事件{RTXENDeAssert();/*ForcestheMC13192toidle.*/if(((u16StatusContent&CRC_VALID_MASK)==0)&&((gsPhyOptions.Bits.u1PromiscuousMode==FALSE))){/*IfaninvalidCRC,r
2、estartreceiver.*//*ReadtheMC13192trxregister.Timertriggeroff.*/u16StatusContent=(SPIDrvRead(MODE_ADDR)&0xFF7F);/*Updatethetrxregister*/SPIDrvWrite(MODE_ADDR,u16StatusContent);RTXENAssert();/*ForcestheMC13192toenterthereceivemode.*/return;}else{/*Readreceivedpacketlengthregisterandmaskofflengthbits*/
3、u8DataLength=(UINT8)(SPIDrvRead(RX_PKT_LEN)&0x7F);if(u8DataLength<5)/*Rx_pkt_lengthisbadwhen<5becauseofCRCandbytecodes.*/{/*ReadtheMC13192trxregister.Timertriggeroff.*/u16StatusContent=(SPIDrvRead(MODE_ADDR)&0xFF7F);/*Updatethetrxregister.*/SPIDrvWrite(MODE_ADDR,u16StatusContent);/*ForcestheMC13192t
4、oenterthereceivemode.*/RTXENAssert();return;}/*TesttheByteCodes*/u16Temp=SPIDrvRead2(RX_PKT);/*Getthecodebytes*/if((u16Temp!=0xFF7E)&&((gsPhyOptions.Bits.u1PromiscuousMode==FALSE))){/*ReadtheMC13192trxregister.Timertriggeroff.*/u16StatusContent=(SPIDrvRead(MODE_ADDR)&0xFF7F);/*Updatethetrxregister.*
5、/SPIDrvWrite(MODE_ADDR,u16StatusContent);/*ForcestheMC13192toenterthereceivemode.*/RTXENAssert();return;}/*Avalidpackethasbeenreceived.*///一个有效的数据包被读取gu8RTxMode=IDLE_MODE;/*Setthertx_statetoidle*/SPIDrvWrite(T1_HI_ADDR,0x8000);/**DisablesTC1andclearsthe*IRQ.*/SPIDrvWrite(T1_LO_ADDR,0x0000);psDrvRxPa
6、cket->u8DataLength=u8DataLength;psDrvRxPacket->u8Status=SUCCESS;PDDataIndication();/*NotifyPHYthatthereisdataavailable.*/SOF>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>PDDataIndication()函数原型voidPDDataIndication(){/*ReadtheDataonlyifitisagoodpacke
7、t.*/if(psDrvRxPacket->u8Status==SUCCESS){RAMDrvReadRx(psDrvRxPacket);/**ReaddatafromMC13192,*checkstatus*/SOF>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>RAMDrvReadR
此文档下载收益归作者所有