新增BLE接收,DMA空闲中断

This commit is contained in:
2025-06-09 11:04:36 +08:00
parent a502e81566
commit d963a10872
30 changed files with 6529 additions and 4406 deletions

View File

@@ -2,6 +2,10 @@
#define __HCBLE_H
#include "headfile.h"
//#define DEBUG_EN 1 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> ʹ<><CAB9>DMA <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9> <20><><EFBFBD><EFBFBD>ʽ
#define RX_DataSize 128
#define RING_BUFFER_SIZE 256
#define UART_DMA_RX_BUF_SIZE 64
// HCBle <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6><EFBFBD>
typedef struct
@@ -17,11 +21,20 @@ typedef struct
float angle;
}LocationData;
typedef struct
{
uint8_t buffer[RING_BUFFER_SIZE];
volatile uint16_t head; // ͷָ<CDB7><D6B8>
volatile uint16_t tail; // βָ<CEB2><D6B8>
}RingBuffer;
#define DEBUG_EN 1
#define RX_DataSize 128
extern uint8_t rx_data;
extern RingBuffer ble_rx_ring; //<2F><>ʼ<EFBFBD><CABC>
extern uint8_t uart_dma_rx_buf[UART_DMA_RX_BUF_SIZE];
void HCBle_InitDMAReception(void);
void HCBle_ExtractAndParseFrame(void);
#endif