写了蓝牙模块的头文件

This commit is contained in:
xqq27 2024-12-06 16:46:34 +08:00
parent e0e7bc229d
commit 3cd5cf9ebd
5 changed files with 43 additions and 49 deletions

View File

@ -6,18 +6,33 @@
typedef enum
{
hc06 = 0,
bluetooth_num
}bluetooth_type_enum;
typedef struct
{
bluetooth_type_enum bluetooth_drv;
void (*init)(void);
void (*deinit)(void);
int8_t (*send_bytes)(uint16_t bytes, uint8_t * txbuf);
int8_t (*recv_bytes)(uint16_t bytes, uint8_t * rxbuf);
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;
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);
}mw_bluetooth_t;

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2024 xqq27
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -704,10 +704,10 @@ Removing Unused input sections from the image.
Removing stm32f10x_wwdg.o(i.WWDG_SetPrescaler), (24 bytes).
Removing stm32f10x_wwdg.o(i.WWDG_SetWindowValue), (40 bytes).
Removing mw_bluetooth.o(i.mw_bluetooth_drv_init), (2 bytes).
Removing mw_bluetooth.o(.bss), (20 bytes).
Removing mw_bluetooth.o(.bss), (44 bytes).
Removing hc06.o(i.hc06_init), (2 bytes).
469 unused section(s) (total 18884 bytes) removed from the image.
469 unused section(s) (total 18908 bytes) removed from the image.
==============================================================================
@ -1240,25 +1240,25 @@ Image component sizes
Code (inc. data) RO Data RW Data ZI Data Debug Object Name
244 18 0 8 0 10185 app_led.o
102 0 0 0 0 23461 bsp_timer.o
6 0 0 0 0 9136 bsp_usart.o
244 18 0 8 0 10253 app_led.o
102 0 0 0 0 23521 bsp_timer.o
6 0 0 0 0 9164 bsp_usart.o
0 0 0 0 0 32 core_cm3.o
94 6 0 0 0 974 interrupt_handler.o
32 0 0 0 0 211474 main.o
132 22 0 0 0 1911 misc.o
184 38 0 0 16 3199 mw_led.o
40 10 0 2 50 1224 mw_printf.o
28 10 0 4 0 1529 mw_soft_timer.o
64 26 236 0 1536 972 startup_stm32f10x_md.o
286 0 0 0 0 3500 stm32f10x_gpio.o
64 12 0 0 0 1346 stm32f10x_rcc.o
246 42 0 0 0 4234 stm32f10x_tim.o
124 0 0 0 0 10154 stm32f10x_usart.o
328 28 0 0 0 2529 system_stm32f10x.o
94 6 0 0 0 1006 interrupt_handler.o
32 0 0 0 0 211514 main.o
132 22 0 0 0 1951 misc.o
184 38 0 0 16 3295 mw_led.o
40 10 0 2 50 1260 mw_printf.o
28 10 0 4 0 1593 mw_soft_timer.o
64 26 236 0 1536 984 startup_stm32f10x_md.o
286 0 0 0 0 3560 stm32f10x_gpio.o
64 12 0 0 0 1378 stm32f10x_rcc.o
246 42 0 0 0 4326 stm32f10x_tim.o
124 0 0 0 0 10234 stm32f10x_usart.o
328 28 0 0 0 2585 system_stm32f10x.o
----------------------------------------------------------------------
1980 212 268 16 1604 285860 Object Totals
1980 212 268 16 1604 286656 Object Totals
0 0 32 0 0 0 (incl. Generated)
6 0 0 2 2 0 (incl. Padding)
@ -1306,8 +1306,8 @@ Image component sizes
Code (inc. data) RO Data RW Data ZI Data Debug
2248 224 268 16 1704 284620 Grand Totals
2248 224 268 16 1704 284620 ELF Image Totals
2248 224 268 16 1704 285416 Grand Totals
2248 224 268 16 1704 285416 ELF Image Totals
2248 224 268 16 0 0 ROM Totals
==============================================================================

View File

@ -17,8 +17,8 @@
<TargetCommonOption>
<Device>STM32F103C8</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F1xx_DFP.1.0.5</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<PackID>Keil.STM32F1xx_DFP.2.4.1</PackID>
<PackURL>https://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x5000) IROM(0x08000000,0x10000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>