43 lines
748 B
C
Raw Normal View History

#ifndef __MW_BLUETOOTH_H__
#define __MW_BLUETOOTH_H__
#include "stm32f10x.h"
typedef enum
{
hc06 = 0,
2024-12-03 22:49:37 +08:00
bluetooth_num
}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-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;
#endif