2024-12-02 22:15:50 +08:00
|
|
|
#ifndef __MW_BLUETOOTH_H__
|
|
|
|
#define __MW_BLUETOOTH_H__
|
|
|
|
|
2024-12-03 21:55:42 +08:00
|
|
|
#include "stm32f10x.h"
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
hc06 = 0,
|
2024-12-03 22:49:37 +08:00
|
|
|
bluetooth_num
|
2024-12-03 21:55:42 +08:00
|
|
|
}bluetooth_type_enum;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2024-12-06 16:46:34 +08:00
|
|
|
void * usart_type;
|
|
|
|
void (*pf_init)(void);
|
|
|
|
void (*pf_deinit)(void);
|
|
|
|
// tx rx function
|
|
|
|
int8_t (*pf_tx_byte)(uint16_t tx_data);
|
|
|
|
uint16_t (*pf_rx_byte)(void);
|
|
|
|
}system_usart_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint32_t (*pf_get_systick_ms)(void);
|
|
|
|
}system_timetick_t;
|
2024-12-03 21:55:42 +08:00
|
|
|
|
2024-12-06 16:46:34 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
bluetooth_type_enum bluetooth_drv;
|
|
|
|
system_usart_t bluetooth_usart;
|
|
|
|
system_timetick_t get_systick_ms;
|
|
|
|
void (*pf_init)(void);
|
|
|
|
void (*pf_deinit)(void);
|
|
|
|
void (*pf_send_bytes)(uint8_t * tx_buf, uint16_t len);
|
|
|
|
void (*pf_recv_deal)(void);
|
2024-12-03 22:49:37 +08:00
|
|
|
}mw_bluetooth_t;
|
2024-12-03 21:55:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-02 22:15:50 +08:00
|
|
|
|
|
|
|
#endif
|