在论坛例程“V7-028_串行SPI Flash读写例程”基础上做了修改,修改部分如下#define SPIx SPI3
#define SPIx_CLK_ENABLE() __HAL_RCC_SPI3_CLK_ENABLE()
#define DMAx_CLK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE()
#define SPIx_FORCE_RESET() __HAL_RCC_SPI3_FORCE_RESET()
#define SPIx_RELEASE_RESET() __HAL_RCC_SPI3_RELEASE_RESET()
#define SPIx_SCK_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define SPIx_SCK_GPIO GPIOB
#define SPIx_SCK_PIN GPIO_PIN_3
#define SPIx_SCK_AF GPIO_AF6_SPI3
#define SPIx_MISO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define SPIx_MISO_GPIO GPIOB
#define SPIx_MISO_PIN GPIO_PIN_4
#define SPIx_MISO_AF GPIO_AF6_SPI3
#define SPIx_MOSI_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
#define SPIx_MOSI_GPIO GPIOB
#define SPIx_MOSI_PIN GPIO_PIN_2
#define SPIx_MOSI_AF GPIO_AF7_SPI3复制代码
但是读取到的数据一直为0... |