优化实现串口驱动,SPI驱动 W25QXX还需要初始化验证修复

This commit is contained in:
冯佳
2026-01-23 09:59:43 +08:00
parent 51e8d79f78
commit b166bee1a9
69 changed files with 6253 additions and 1178 deletions

47
HAL/Inc/hal.h Normal file
View File

@ -0,0 +1,47 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : hal.h
* @brief : Hardware Abstraction Layer common header file
******************************************************************************
*/
/* USER CODE END Header */
#ifndef HAL_H
#define HAL_H
/* Define supported architectures */
#define HAL_ARCH_STM32F1 0
#define HAL_ARCH_STM32F4 1
#define HAL_ARCH_STM32F7 2
#define HAL_ARCH_STM32L4 3
/* Select target architecture */
#ifndef HAL_TARGET_ARCH
#define HAL_TARGET_ARCH HAL_ARCH_STM32F4
#endif
/* Include architecture specific headers */
#if HAL_TARGET_ARCH == HAL_ARCH_STM32F1
#include "arch/stm32f1/hal_stm32f1.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32F4
#include "arch/stm32f4/hal_stm32f4.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32F7
#include "arch/stm32f7/hal_stm32f7.h"
#elif HAL_TARGET_ARCH == HAL_ARCH_STM32L4
#include "arch/stm32l4/hal_stm32l4.h"
#else
#error "Unsupported HAL architecture: " #HAL_TARGET_ARCH
#endif
/* Architecture compatibility check */
#if HAL_TARGET_ARCH < HAL_ARCH_STM32F1 || HAL_TARGET_ARCH > HAL_ARCH_STM32L4
#error "Invalid HAL architecture selection"
#endif
/**
* @brief HAL module initialization
*/
void hal_init(void);
#endif /* HAL_H */