diff --git a/User/bsp/bsp_api.c b/User/bsp/bsp_api.c new file mode 100644 index 0000000..e799acf --- /dev/null +++ b/User/bsp/bsp_api.c @@ -0,0 +1,33 @@ + +#include "bsp_api.h" + +/* USER INCLUDE BEGIN */ + +/* USER INCLUDE END */ + +/* USER DEFINE BEGIN */ + +/* USER DEFINE END */ + +/* USER STRUCT BEGIN */ + +/* USER STRUCT END */ + +/* USER FUNCTION BEGIN */ + +/* USER FUNCTION END */ + +/* bsp层外设API实体 */ +const struct Bsp_s Bsp = { + .gpio = { + .WritePin = BSP_GPIO_WritePin, + }, + .timer_t = { + .Init = NULL, + }, + .spi = { + .Init = NULL, + }, +}; + + diff --git a/User/bsp/bsp_api.h b/User/bsp/bsp_api.h new file mode 100644 index 0000000..3ae4516 --- /dev/null +++ b/User/bsp/bsp_api.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include "bsp/gpio.h" +#include "bsp/time.h" +#include "bsp/spi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + + +/* USER INCLUDE BEGIN */ + +/* USER INCLUDE END */ + +/* USER DEFINE BEGIN */ + +/* USER DEFINE END */ +/* bsp层外设API结构体 */ +struct Bsp_s { + struct { + + int8_t ( *WritePin )( BSP_GPIO_t gpio, bool value ); + }gpio; + + struct { + void ( *Init )( ); + }timer_t; + + struct { + void ( *Init )( ); + }spi; +}; + +extern const struct Bsp_s Bsp; + +/* USER FUNCTION BEGIN */ + +/* USER FUNCTION END */ + +#ifdef __cplusplus +} +#endif \ No newline at end of file