generated from Template/H563ZI-HAL-CMake-Template
新增BLE接收,DMA空闲中断
This commit is contained in:
17
fun/HCBle.h
17
fun/HCBle.h
@@ -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
|
||||
Reference in New Issue
Block a user