Files
bf_original_balance_chassis/modules/bluetooth/HC05.h
2023-12-02 11:29:18 +08:00

24 lines
625 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef HC05_H
#define HC05_H
#include <stdint.h>
#include "main.h"
#include "usart.h"
#define HC05_DATASIZE 4 // HC05接收和发送数据大小,根据需要修改
// HC05通信数据结构体,后续根据需要添加和修改
typedef struct
{
uint8_t send_data[HC05_DATASIZE + 2]; // 发送数据,加上帧头和帧尾
uint8_t recv_data[HC05_DATASIZE]; // 接收数据
}HC05;
// HC05串口接收初始化
HC05 *HC05Init(UART_HandleTypeDef *hc05_usart_handle);
// HC05串口发送函数,一次最多发送HC05_DATASIZE个数据
void HC05_SendData( uint8_t *data, uint8_t data_num);
#endif