zhyinch
2020-05-16 0dfe35b40cdcea88d1f4727df66feb1b4d4cf467
Src/application/dw_app.h
@@ -21,6 +21,46 @@
#define GROUP_TAG_NUM 2
#define TAG_NUM_IN_SYS            25
#define DFT_RAND_DLY_TIM_MS         1
#define THRESHOLD_CHANGE_MAINBASE_DIST   50
#define MIN_ANCHOR_NUM 2
#define SYNC_SEQ_IDX             5
#define POLL                          0x01
#define RESPONSE                      0x02
#define FINAL                        0x03
#define SYNC                           0x04
#define NEAR_MSG                     0x05
#define NEAR_POLL                  0x06
#define NEAR_RESPONSE            0x07
#define NEAR_FINAL                  0x08
//General
#define GROUP_ID_IDX               0
#define ANCHOR_ID_IDX             1
#define TAG_ID_IDX                5
#define MESSAGE_TYPE_IDX          9
//Poll
#define ANC_TYPE_IDX                14
//respose
#define DIST_IDX                      10
#define ANCTIMEMS             14
#define ANCTIMEUS             16
#define TAGSLOTPOS                  7
//Final
#define FINAL_MSG_POLL_TX_TS_IDX 10
#define FINAL_MSG_RESP_RX_TS_IDX 14
#define FINAL_MSG_FINAL_TX_TS_IDX 18
#define FINAL_MSG_RESP_RX_NEARBASE_IDX  22
#define FINAL_MSG_TS_LEN 4
//SYNC
#define SYNC_SEQ_IDX             5
//NEAR MSG
#define NEARBASENUM_INDEX    10
#define NEARBASEID_INDEX       11
//NEAR POLL
#define BATTARY_IDX                  1
#define BUTTON_IDX                  2
#define SEQUENCE_IDX               3
#define DW_CTRL_GPIO               GPIOA
#define DW_ENABLE   HAL_GPIO_WritePin(DW_CTRL_GPIO, DW_CTRL_Pin, GPIO_PIN_RESET)
@@ -45,7 +85,7 @@
void Anchor_App(void);
void tag_sleep_configuraion(void);
extern int32_t g_Tagdist[TAG_NUM_IN_SYS];
extern uint8_t g_flag_Taggetdist[256];
extern void TagDistClear(void);
void Dw1000_App_Init(void);
#endif