#ifndef __HCBLE_H
#define __HCBLE_H

#include "headfile.h"
//#define DEBUG_EN   		1   //不定义时候 使用DMA 定义了使用 阻塞式
#define RX_DataSize		128
#define RING_BUFFER_SIZE	256	
#define UART_DMA_RX_BUF_SIZE  64


// HCBle 相关数据定义
typedef struct
{
	int LeftSpeed;
	int RightSpeed;
}MotorCommand;

typedef struct
{
	float lat;
	float lon;
	float angle;
}LocationData;

typedef struct
{
	uint8_t buffer[RING_BUFFER_SIZE];
	volatile uint16_t head; // 头指针
	volatile uint16_t tail; // 尾指针
}RingBuffer;




extern uint8_t  rx_data;  
extern RingBuffer ble_rx_ring; //初始化
extern uint8_t uart_dma_rx_buf[UART_DMA_RX_BUF_SIZE];
extern LocationData current_location;

extern uint8_t flag;

void HCBle_SendData(char *p,...);
void HCBle_InitDMAReception(void);
void HCBle_ExtractAndParseFrame(void);

void ble_rx_task_entry(ULONG thread_input);
void ble_tx_task_entry(ULONG thread_input);
#endif