优化调试新增按键驱动
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
#include <stdint.h>
|
||||
#include "hal_gpio.h"
|
||||
#include "hal_uart.h"
|
||||
#include "hal_spi.h"
|
||||
|
||||
/**
|
||||
* @brief Board LED configuration structure
|
||||
@ -34,8 +35,17 @@ typedef struct {
|
||||
hal_gpio_mode_t mode;
|
||||
hal_gpio_speed_t speed;
|
||||
hal_gpio_pull_t pull;
|
||||
uint8_t active_high;
|
||||
} bsp_button_config_t;
|
||||
|
||||
/**
|
||||
* @brief Board buttons configuration structure
|
||||
*/
|
||||
typedef struct {
|
||||
uint8_t count;
|
||||
const bsp_button_config_t* buttons;
|
||||
} bsp_buttons_config_t;
|
||||
|
||||
/**
|
||||
* @brief UART instance identifier definitions
|
||||
*/
|
||||
@ -64,6 +74,27 @@ typedef struct {
|
||||
hal_gpio_pin_t rx_pin;
|
||||
} bsp_uart_config_t;
|
||||
|
||||
/**
|
||||
* @brief Board SPI configuration structure
|
||||
*/
|
||||
typedef struct {
|
||||
hal_spi_instance_t instance;
|
||||
hal_spi_mode_t mode;
|
||||
uint32_t baudrate;
|
||||
hal_spi_polarity_t polarity;
|
||||
hal_spi_phase_t phase;
|
||||
hal_spi_databits_t databits;
|
||||
} bsp_spi_config_t;
|
||||
|
||||
/**
|
||||
* @brief Board W25QXX configuration structure
|
||||
*/
|
||||
typedef struct {
|
||||
hal_gpio_port_t cs_port;
|
||||
hal_gpio_pin_t cs_pin;
|
||||
bsp_spi_config_t spi_config;
|
||||
} bsp_w25qxx_config_t;
|
||||
|
||||
/**
|
||||
* @brief Board peripheral initialization function type
|
||||
*/
|
||||
@ -75,13 +106,15 @@ typedef void (*bsp_periph_init_func_t)(const void* config);
|
||||
typedef struct {
|
||||
const char* name;
|
||||
bsp_led_config_t led;
|
||||
bsp_button_config_t button;
|
||||
bsp_buttons_config_t buttons;
|
||||
bsp_uart_config_t uart;
|
||||
bsp_w25qxx_config_t w25qxx;
|
||||
|
||||
/* Initialization function pointers */
|
||||
bsp_periph_init_func_t led_init;
|
||||
bsp_periph_init_func_t button_init;
|
||||
bsp_periph_init_func_t uart_init;
|
||||
bsp_periph_init_func_t w25qxx_init;
|
||||
|
||||
/* Additional board-specific configuration */
|
||||
uint32_t clock_speed;
|
||||
|
||||
Reference in New Issue
Block a user