/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* Private defines -----------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
#define TAG_NUM 3
#pragma pack (1)

typedef struct
{
		uint8_t  head[2];          // 0-1
		uint8_t  tagNum;		       // 定位基站的数量信息
		uint16_t dis[TAG_NUM];     // 存放的距离信息
}package_t;
#pragma pack () 

// DW1000_RTSn ---> PA0
#define DW_RESET_Pin       GPIO_PIN_0
#define DW_RESET_GPIO_Port GPIOA
// DW1000_IRQn ---> PB5
#define DW_IRQn_Pin        GPIO_PIN_5
#define DW_IRQn_GPIO_Port  GPIOB
#define DW_IRQn_EXTI_IRQn  EXTI9_5_IRQn
// DW1000_NSS ---> PA4
#define DW_NSS_Pin         GPIO_PIN_4
#define DW_NSS_GPIO_Port   GPIOA

// 把UWB的测距包信息拷贝到缓存中并发送
void UsbSendPackageReport(package_t* pack, uint8_t* report);
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);


#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
