| | |
| | | #define POLL_TX_TO_RESP_RX_DLY_UUS 150 |
| | | /* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the |
| | | * frame length of approximately 2.66 ms with above configuration. */ |
| | | #define RESP_RX_TO_FINAL_TX_DLY_UUS 4100 |
| | | #define RESP_RX_TO_FINAL_TX_DLY_UUS 5100 |
| | | /* Receive response timeout. See NOTE 5 below. */ |
| | | #define RESP_RX_TIMEOUT_UUS 14700 |
| | | |
| | | #define POLL_RX_TO_RESP_TX_DLY_UUS 3600 |
| | | /* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */ |
| | | #define RESP_TX_TO_FINAL_RX_DLY_UUS 500 |
| | | #define RESP_TX_TO_FINAL_RX_DLY_UUS 1500 |
| | | /* Receive final timeout. See NOTE 5 below. */ |
| | | #define FINAL_RX_TIMEOUT_UUS 4300 |
| | | |
| | |
| | | |
| | | /* Configure DW1000. See NOTE 6 below. */ |
| | | dwt_configure(&config);//é
ç½®DW1000 |
| | | |
| | | |
| | | |
| | | /* Apply default antenna delay value. See NOTE 1 below. */ |
| | | dwt_setrxantennadelay(RX_ANT_DLY); //è®¾ç½®æ¥æ¶å¤©çº¿å»¶è¿ |
| | | dwt_settxantennadelay(TX_ANT_DLY); //设置åå°å¤©çº¿å»¶è¿ |
| | |
| | | dwt_setrxaftertxdelay(POLL_TX_TO_RESP_RX_DLY_UUS); //设置åéåå¼å¯æ¥æ¶ï¼å¹¶è®¾å®å»¶è¿æ¶é´ |
| | | dwt_setrxtimeout(RESP_RX_TIMEOUT_UUS); //è®¾ç½®æ¥æ¶è¶
æ¶æ¶é´ |
| | | } |
| | | void Delayus(uint16_t time) |
| | | { |
| | | uint16_t i = 0; |
| | | while (time--) { |
| | | i = 10; |
| | | while (i--) |
| | | ; |
| | | |
| | | } |
| | | } |
| | | void Tag_App(void)//å鿍¡å¼(TAGæ ç¾) |
| | | { |
| | | uint32_t frame_len; |
| | | uint32_t final_tx_time; |
| | | |
| | | GPIO_ResetBits(SPIx_GPIO, SPIx_CS); |
| | | Delayus(2000); |
| | | GPIO_SetBits(SPIx_GPIO, SPIx_CS); |
| | | |
| | | /* Write frame data to DW1000 and prepare transmission. See NOTE 7 below. */ |
| | | tx_poll_msg[ALL_MSG_SN_IDX] = frame_seq_nb; |
| | |
| | | } |
| | | LED0_BLINK; |
| | | /* Execute a delay between ranging exchanges. */ |
| | | deca_sleep(RNG_DELAY_MS + random_delay_tim); //ä¼ç åºå®æ¶é´ |
| | | dwt_entersleep(); |
| | | |
| | | } |
| | | |
| | | void Anchor_App(void) |