{"id":119557,"date":"2026-10-29T22:57:36","date_gmt":"2026-10-29T14:57:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/119557.html"},"modified":"2026-10-29T22:57:36","modified_gmt":"2026-10-29T14:57:36","slug":"spi%e9%80%9a%e4%bf%a1%e5%a4%96%e8%ae%be%e4%b8%8ew25q64-%ef%bc%88%e7%a1%ac%e4%bb%b6spi%ef%bc%89%ef%bc%88stm32%e6%a0%87%e5%87%86%e5%ba%93%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/119557.html","title":{"rendered":"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09"},"content":{"rendered":"<p>\u5728\u524d\u4e00\u7ae0\u8282\u4e2d&#xff0c;\u6211\u4eec\u6df1\u5165\u63a2\u8ba8\u4e86SPI\u901a\u4fe1\u534f\u8bae\u7684\u57fa\u672c\u539f\u7406&#xff0c;\u5e76\u901a\u8fc7\u8f6f\u4ef6\u6a21\u62df\u7684\u65b9\u5f0f\u5b9e\u73b0\u4e86\u4e0eW25Q64 Flash\u5b58\u50a8\u5668\u7684\u4ea4\u4e92\u3002\u8fd9\u4e00\u8fc7\u7a0b\u867d\u7136\u6709\u52a9\u4e8e\u7406\u89e3SPI\u65f6\u5e8f\u7684\u5e95\u5c42\u903b\u8f91&#xff0c;\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u5b58\u5728\u5360\u7528CPU\u8d44\u6e90\u591a\u3001\u901a\u4fe1\u901f\u7387\u53d7\u9650\u7b49\u95ee\u9898\u3002\u968f\u7740\u7cfb\u7edf\u5bf9\u6570\u636e\u4f20\u8f93\u6548\u7387\u548c\u5b9e\u65f6\u6027\u8981\u6c42\u7684\u63d0\u5347&#xff0c;\u5355\u7eaf\u4f9d\u8d56GPIO\u4f4d\u64cd\u4f5c\u6765\u6a21\u62dfSPI\u5df2\u96be\u4ee5\u6ee1\u8db3\u9ad8\u6027\u80fd\u9700\u6c42\u3002<\/p>\n<p>\u672c\u7ae0\u5c06\u8f6c\u5411STM32\u5185\u7f6e\u7684\u786c\u4ef6SPI\u5916\u8bbe&#xff0c;\u5168\u9762\u89e3\u6790\u5982\u4f55\u5229\u7528\u5176\u4e13\u7528\u786c\u4ef6\u6a21\u5757\u5b9e\u73b0\u4e0eW25Q64\u7684\u9ad8\u6548\u901a\u4fe1\u3002\u76f8\u6bd4\u8f6f\u4ef6SPI&#xff0c;\u786c\u4ef6SPI\u4e0d\u4ec5\u663e\u8457\u964d\u4f4e\u4e3b\u63a7\u5904\u7406\u5668\u7684\u8d1f\u62c5&#xff0c;\u8fd8\u80fd\u652f\u6301\u66f4\u9ad8\u7684\u901a\u4fe1\u901f\u7387&#xff0c;\u786e\u4fdd\u6570\u636e\u7a33\u5b9a\u53ef\u9760\u5730\u4f20\u8f93\u3002\u901a\u8fc7\u914d\u7f6eSTM32\u7684SPI\u5916\u8bbe\u5bc4\u5b58\u5668\u3001\u8bbe\u7f6e\u5de5\u4f5c\u6a21\u5f0f&#xff08;\u5982\u4e3b\/\u4ece\u6a21\u5f0f\u3001\u65f6\u949f\u6781\u6027\u4e0e\u76f8\u4f4d&#xff09;\u3001\u5408\u7406\u7ba1\u7406\u7247\u9009\u4fe1\u53f7\u4ee5\u53ca\u7ed3\u5408\u4e2d\u65ad\u6216DMA\u673a\u5236&#xff0c;\u53ef\u4ee5\u6784\u5efa\u51fa\u66f4\u52a0\u9ad8\u6548\u3001\u7a33\u5b9a\u7684Flash\u8bfb\u5199\u7cfb\u7edf\u3002<\/p>\n<p>\u672c\u8282\u5185\u5bb9\u5c06\u4ee5\u6807\u51c6\u5e93\u4e3a\u57fa\u7840&#xff0c;\u8be6\u7ec6\u5c55\u793a\u786c\u4ef6SPI\u5916\u8bbe\u7684\u521d\u59cb\u5316\u6d41\u7a0b\u3001\u5173\u952e\u5bc4\u5b58\u5668\u914d\u7f6e\u65b9\u6cd5\u53ca\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u6ce8\u610f\u4e8b\u9879&#xff0c;\u5e2e\u52a9\u8bfb\u8005\u5b8c\u6210\u4ece\u201c\u624b\u52a8\u6a21\u62df\u201d\u5230\u201c\u786c\u4ef6\u9a71\u52a8\u201d\u7684\u601d\u7ef4\u8dc3\u8fc1&#xff0c;\u4e3a\u540e\u7eed\u590d\u6742\u5916\u8bbe\u96c6\u6210\u4e0e\u7cfb\u7edf\u4f18\u5316\u6253\u4e0b\u575a\u5b9e\u57fa\u7840\u3002<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u6709\u6536\u83b7\u53ef\u4ee5\u4e3a\u6211\u7684\u6587\u7ae0\u70b9\u70b9\u5c0f\u8d5e&#xff0c;\u8fd9\u5c06\u6fc0\u52b1\u6211\u521b\u4f5c\u66f4\u597d\u7684\u5185\u5bb9&#xff01;\u8c22\u8c22&#xff01;<\/p>\n<h3 style=\"background-color:transparent\">\u00a0\u4e00\u3001SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0<\/h3>\n<\/p>\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.1 SPI\u5916\u8bbe\u7b80\u4ecb<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">STM32\u5185\u90e8\u96c6\u6210\u4e86\u786c\u4ef6SPI\u6536\u53d1\u7535\u8def&#xff0c;\u53ef\u4ee5\u7531\u786c\u4ef6\u81ea\u52a8\u6267\u884c\u65f6\u949f\u751f\u6210\u3001\u6570\u636e\u6536\u53d1\u7b49\u529f\u80fd&#xff0c;\u51cf\u8f7bCPU\u7684\u8d1f\u62c5<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u53ef\u914d\u7f6e8\u4f4d\/16\u4f4d\u6570\u636e\u5e27\u3001\u9ad8\u4f4d\u5148\u884c\/\u4f4e\u4f4d\u5148\u884c<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u65f6\u949f\u9891\u7387&#xff1a; fPCLK \/ (2, 4, 8, 16, 32, 64, 128, 256)<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u652f\u6301\u591a\u4e3b\u673a\u6a21\u578b\u3001\u4e3b\u6216\u4ece\u64cd\u4f5c<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u53ef\u7cbe\u7b80\u4e3a\u534a\u53cc\u5de5\/\u5355\u5de5\u901a\u4fe1<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u652f\u6301DMA<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u517c\u5bb9I2S\u534f\u8bae<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">STM32F103C8T6 \u786c\u4ef6SPI\u8d44\u6e90&#xff1a;SPI1\u3001SPI2<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.2 SPI\u6846\u56fe<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145732-6ae35edcb376e.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.3 SPI\u57fa\u672c\u7ed3\u6784<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145732-6ae35edcd2d09.png\" \/><\/p>\n<h4 style=\"margin-left:0.0001pt;text-align:justify\"><\/h4>\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.4 \u4e3b\u6a21\u5f0f\u5168\u53cc\u5de5\u8fde\u7eed\u4f20\u8f93<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35edd1c90b.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.5 \u975e\u8fde\u7eed\u4f20\u8f93<\/h4>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35edd4ead3.png\" \/><\/p>\n<\/p>\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.6 \u8f6f\u4ef6\/\u786c\u4ef6\u6ce2\u5f62\u5bf9\u6bd4<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u8f6f\u4ef6&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35edd78d2e.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35edd933dc.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u786c\u4ef6&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35eddad2ff.png\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35eddc8fe5.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h4 style=\"margin-left:0.0001pt;text-align:justify\">1.7 \u5b9e\u4f8b\u4e00 11.2.1 \u786c\u4ef6SPI\u8bfb\u5199W25Q64<\/h4>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u53ef\u80fd\u7528\u5230\u7684\u5e93\u51fd\u6570:<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u6062\u590d\u7f3a\u7701\u914d\u7f6e\u3001<\/span><span style=\"color:#ff0000\">\u521d\u59cb\u5316<\/span><span style=\"color:#00b050\">\u3001\u7ed3\u6784\u4f53\u53d8\u91cf\u521d\u59cb\u5316<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_DeInit(SPI_TypeDef* SPIx);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_Init(SPI_TypeDef* SPIx, SPI_InitTypeDef* SPI_InitStruct);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_StructInit(SPI_InitTypeDef* SPI_InitStruct);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">\/\/SPI_Cmd\u5916\u8bbe\u4f7f\u80fd<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/SPI_I2S_ITConfig\u4e2d\u65ad\u4f7f\u80fd\u3001SPI_I2S_DMACmd DMA\u4f7f\u80fd<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/SPI_I2S_SendData \u53d1\u9001\u6570\u636e&#xff08;\u5199DR\u6570\u636e\u5bc4\u5b58\u5668&#xff09;\u3001uint16_t SPI_I2S_ReceiveData \u8bfb\u53d6\u6570\u636e&#xff08;\u8bfbDR\u6570\u636e\u5bc4\u5b58\u5668&#xff09;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\/\/\u83b7\u53d6\u6807\u5fd7\u4f4d\u548c\u6e05\u9664\u6807\u5fd7\u4f4d<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#00b050\">\u4e3b\u8981\u7528SPI_I2S_GetFlagStatus\u6765\u83b7\u53d6TXE\u548cRXNE\u6807\u5fd7\u4f4d\u7684\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT);<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<h5 style=\"margin-left:0.0001pt;text-align:justify\"><span style=\"color:#ff0000\">SPI\u521d\u59cb\u5316\u7684\u6d41\u7a0b<\/span><\/h5>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e00\u6b65&#xff0c;\u5f00\u542f\u65f6\u949f&#xff0c;\u5f00\u542fSPI\u548cGPIO\u7684\u65f6\u949f&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e8c\u6b65&#xff0c;\u521d\u59cb\u5316GPIO\u53e3&#xff0c;\u5176\u4e2dSCK\u548cMOSI&#xff0c;\u662f\u7531\u786c\u4ef6\u5916\u8bbe\u63a7\u5236\u7684\u8f93\u51fa\u4fe1\u53f7&#xff0c;\u6240\u4ee5\u914d\u7f6e\u4e3a\u590d\u7528\u63a8\u633d\u8f93\u51fa\u3002MISO&#xff0c;\u662f\u786c\u4ef6\u5916\u8bbe\u7684\u8f93\u5165\u4fe1\u53f7&#xff0c;\u53ef\u4ee5\u914d\u7f6e\u4e3a\u4e0a\u62c9\u8f93\u5165\u3002SS\u5f15\u811a&#xff0c;SS\u662f\u8f6f\u4ef6\u63a7\u5236\u7684\u8f93\u51fa\u4fe1\u53f7&#xff0c;\u6240\u4ee5\u914d\u7f6e\u4e3a\u901a\u7528\u63a8\u633d\u8f93\u51fa&#xff0c;\u8fd9\u5c31\u662fGPIO\u53e3\u7684\u521d\u59cb\u5316\u914d\u7f6e&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u4e09\u6b65&#xff0c;\u914d\u7f6eSPI\u5916\u8bbe&#xff0c;\u8fd9\u4e00\u5757&#xff0c;\u4f7f\u7528\u4e00\u4e2a\u7ed3\u6784\u4f53\u9009\u53c2\u6570\u5373\u53ef&#xff0c;\u8c03\u7528\u4e00\u4e0bSPI_Init,\u8fd9\u91cc\u9762\u7684\u5404\u79cd\u53c2\u6570&#xff0c;\u6bd4\u5982&#xff0c;8\u4f4d\/16\u4f4d\u6570\u636e\u5e27\u3001\u9ad8\u4f4d\u5148\u884c\/\u4f4e\u4f4d\u5148\u884c&#xff0c;SPI\u6a21\u5f0f\u51e0\u3001\u4e3b\u673a\u8fd8\u662f\u4ece\u673a\u7b49\u7b49&#xff1b;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u7b2c\u56db\u6b65&#xff0c;\u5f00\u5173\u63a7\u5236&#xff0c;\u8c03\u7528SPl_Cmd,\u7ed9SPl\u4f7f\u80fd\u5373\u53ef\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u4ea4\u6362\u4e00\u4e2a\u5b57\u8282&#xff08;\u6a21\u5f0f0&#xff09;\u7684\u7ed3\u6784\u6846\u56fe<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">CPOL&#061;0&#xff1a;\u7a7a\u95f2\u72b6\u6001\u65f6&#xff0c;SCK\u4e3a\u4f4e\u7535\u5e73<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">CPHA&#061;0&#xff1a;SCK\u7b2c\u4e00\u4e2a\u8fb9\u6cbf\u79fb\u5165\u6570\u636e&#xff0c;\u7b2c\u4e8c\u4e2a\u8fb9\u6cbf\u79fb\u51fa\u6570\u636e<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145733-6ae35edde4580.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u975e\u8fde\u7eed\u4f20\u8f93\u7684\u7ed3\u6784\u6846\u56fe<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145734-6ae35ede22341.png\" \/><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">\u91cd\u8981\u7684\u6807\u5fd7\u4f4d\u5728stm32\u6570\u636e\u624b\u518c\u91cc\u7684\u63cf\u8ff0&#xff1a;<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">\u53d1\u9001\u7f13\u51b2\u5668\u7a7a\u95f2\u6807\u5fd7(TXE) <\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u6b64\u6807\u5fd7\u4e3a\u20191\u2019\u65f6\u8868\u660e\u53d1\u9001\u7f13\u51b2\u5668\u4e3a\u7a7a&#xff0c;\u53ef\u4ee5\u5199\u4e0b\u4e00\u4e2a\u5f85\u53d1\u9001\u7684\u6570\u636e\u8fdb\u5165\u7f13\u51b2\u5668\u4e2d\u3002\u5f53\u5199\u5165SPI_DR \u65f6&#xff0c;TXE\u6807\u5fd7\u88ab\u6e05\u9664\u3002 <\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">\u63a5\u6536\u7f13\u51b2\u5668\u975e\u7a7a<\/span><span style=\"color:#ff0000\">(RXNE) <\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u6b64\u6807\u5fd7\u4e3a\u20191\u2019\u65f6\u8868\u660e\u5728\u63a5\u6536\u7f13\u51b2\u5668\u4e2d\u5305\u542b\u6709\u6548\u7684\u63a5\u6536\u6570\u636e\u3002\u8bfbSPI\u6570\u636e\u5bc4\u5b58\u5668\u53ef\u4ee5\u6e05\u9664\u6b64\u6807\u5fd7\u3002<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\u6839\u636e\u4ee5\u4e0a\u63cf\u8ff0&#xff0c;\u5728\u4f7f\u7528\u786c\u4ef6SPI\u7684SPI_I2S_SendData\u548cSPI_I2S_ReceiveData\u51fd\u6570\u65f6&#xff0c;\u6b64\u65f6\u786c\u4ef6\u4f1a<span style=\"color:#ff0000\">\u81ea\u52a8\u5e2e\u6211\u4eec\u628a\u4e4b\u524d\u7f6e\u4e00TXE\/<\/span><span style=\"color:#ff0000\">RXNE<\/span><span style=\"color:#ff0000\">\u6807\u5fd7\u4f4d\u81ea\u52a8\u6e05\u96f6&#xff0c;<\/span>\u4e0d\u9700\u8981\u6211\u4eec\u5728\u8f6f\u4ef6\u7a0b\u5e8f\u4e2d\u624b\u52a8\u6e05\u9664\u6807\u5fd7\u4f4d<\/p>\n<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">MySPI<\/span><span style=\"color:#ff0000\">.c<\/span><span style=\"color:#ff0000\">\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n\/\u5f15\u811a\u914d\u7f6e\u5c42\/<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;SPI\u5199SS\u5f15\u811a\u7535\u5e73<br \/>\n\u53c2    \u6570&#xff1a;BitValue \u534f\u8bae\u5c42\u4f20\u5165\u7684\u5f53\u524d\u9700\u8981\u5199\u5165SS\u7684\u7535\u5e73&#xff0c;\u8303\u56f40~1<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\u6ce8\u610f\u4e8b\u9879&#xff1a;\u6b64\u51fd\u6570\u9700\u8981\u7528\u6237\u5b9e\u73b0\u5185\u5bb9&#xff0c;\u5f53BitValue\u4e3a0\u65f6&#xff0c;\u9700\u8981\u7f6eSS\u4e3a\u4f4e\u7535\u5e73&#xff0c;\u5f53BitValue\u4e3a1\u65f6&#xff0c;\u9700\u8981\u7f6eSS\u4e3a\u9ad8\u7535\u5e73<br \/>\n*\/<br \/>\nvoid MySPI_W_SS(uint8_t BitValue)<br \/>\n{<br \/>\nGPIO_WriteBit(GPIOA,GPIO_Pin_4,(BitAction)BitValue);\/\/\u6839\u636eBitValue&#xff0c;\u8bbe\u7f6eSS\u5f15\u811a\u7684\u7535\u5e73<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;SPI\u521d\u59cb\u5316<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\u6ce8\u610f\u4e8b\u9879&#xff1a;\u6b64\u51fd\u6570\u9700\u8981\u7528\u6237\u5b9e\u73b0\u5185\u5bb9&#xff0c;\u5b9e\u73b0SS\u3001SCK\u3001MOSI\u548cMISO\u5f15\u811a\u7684\u521d\u59cb\u5316<br \/>\n*\/<br \/>\nvoid MySPI_Init(void)<br \/>\n{<br \/>\n\/\u5f00\u542f\u65f6\u949f\/<br \/>\nRCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);\/\/\u5f00\u542fGPIOA\u7684\u65f6\u949f<br \/>\nRCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1,ENABLE);\/\/\u5f00\u542fSPI1\u7684\u65f6\u949f<br \/>\n\/GPIO\u521d\u59cb\u5316\/<br \/>\nGPIO_InitTypeDef GPIO_InitStructure;<br \/>\nGPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_Out_PP;<br \/>\nGPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_4;<br \/>\nGPIO_InitStructure.GPIO_Speed &#061; GPIO_Speed_50MHz;<br \/>\nGPIO_Init(GPIOA,&amp;GPIO_InitStructure);\/\/\u5c06PA4\u5f15\u811a\u521d\u59cb\u5316\u4e3a\u63a8\u633d\u8f93\u51fa<br \/>\nGPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_AF_PP;<br \/>\nGPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_5 | GPIO_Pin_7;<br \/>\nGPIO_InitStructure.GPIO_Speed &#061; GPIO_Speed_50MHz;<br \/>\nGPIO_Init(GPIOA,&amp;GPIO_InitStructure);\/\/\u5c06PA5\u548cPA7\u5f15\u811a\u521d\u59cb\u5316\u4e3a\u590d\u7528\u63a8\u633d\u8f93\u51fa<br \/>\nGPIO_InitStructure.GPIO_Mode &#061; GPIO_Mode_IPU;<br \/>\nGPIO_InitStructure.GPIO_Pin &#061; GPIO_Pin_6;<br \/>\nGPIO_InitStructure.GPIO_Speed &#061; GPIO_Speed_50MHz;<br \/>\nGPIO_Init(GPIOA,&amp;GPIO_InitStructure);\/\/\u5c06PA6\u5f15\u811a\u521d\u59cb\u5316\u4e3a\u4e0a\u62c9\u8f93\u5165<br \/>\n\/SPI\u521d\u59cb\u5316\/<br \/>\nSPI_InitTypeDef SPI_InitStructure;\/\/\u5b9a\u4e49\u7ed3\u6784\u4f53\u53d8\u91cf<br \/>\nSPI_InitStructure.SPI_Mode &#061; SPI_Mode_Master;\/\/\u6a21\u5f0f&#xff0c;\u9009\u62e9\u4e3aSPI\u4e3b\u6a21\u5f0f<br \/>\nSPI_InitStructure.SPI_Direction &#061; SPI_Direction_2Lines_FullDuplex;\/\/\u65b9\u5411&#xff0c;\u9009\u62e92\u7ebf\u5168\u53cc\u5de5<br \/>\nSPI_InitStructure.SPI_DataSize &#061; SPI_DataSize_8b;\/\/\u6570\u636e\u5bbd\u5ea6&#xff0c;\u9009\u62e9\u4e3a8\u4f4d<br \/>\nSPI_InitStructure.SPI_FirstBit &#061; SPI_FirstBit_MSB;\/\/\u5148\u884c\u4f4d&#xff0c;\u9009\u62e9\u9ad8\u4f4d\u5148\u884c<br \/>\nSPI_InitStructure.SPI_BaudRatePrescaler &#061; SPI_BaudRatePrescaler_128;\/\/\u6ce2\u7279\u7387\u5206\u9891&#xff0c;\u9009\u62e9128\u5206\u9891<br \/>\nSPI_InitStructure.SPI_CPOL &#061; SPI_CPOL_Low;\/\/SPI\u6781\u6027&#xff0c;\u9009\u62e9\u4f4e\u6781\u6027<br \/>\nSPI_InitStructure.SPI_CPHA &#061; SPI_CPHA_1Edge;\/\/SPI\u76f8\u4f4d&#xff0c;\u9009\u62e9\u7b2c\u4e00\u4e2a\u65f6\u949f\u8fb9\u6cbf\u91c7\u6837&#xff0c;\u6781\u6027\u548c\u76f8\u4f4d\u51b3\u5b9a\u9009\u62e9SPI\u6a21\u5f0f0<br \/>\nSPI_InitStructure.SPI_NSS  &#061; SPI_NSS_Soft;\/\/NSS&#xff0c;\u9009\u62e9\u7531\u8f6f\u4ef6\u63a7\u5236<br \/>\nSPI_InitStructure.SPI_CRCPolynomial &#061; 7;  \/\/CRC\u591a\u9879\u5f0f&#xff0c;\u6682\u65f6\u7528\u4e0d\u5230&#xff0c;\u7ed9\u9ed8\u8ba4\u503c7<br \/>\nSPI_Init(SPI1,&amp;SPI_InitStructure);        \/\/\u5c06\u7ed3\u6784\u4f53\u53d8\u91cf\u4ea4\u7ed9SPI_Init&#xff0c;\u914d\u7f6eSPI1<br \/>\n\/SPI\u4f7f\u80fd\/<br \/>\nSPI_Cmd(SPI1,ENABLE);\/\/\u4f7f\u80fdSPI1&#xff0c;\u5f00\u59cb\u8fd0\u884c<br \/>\n\/\u8bbe\u7f6e\u9ed8\u8ba4\u7535\u5e73\/<br \/>\nMySPI_W_SS(1);                \/\/SS\u9ed8\u8ba4\u9ad8\u7535\u5e73<br \/>\n}<br \/>\n\/\u534f\u8bae\u5c42\/<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;SPI\u8d77\u59cb<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid MySPI_Start(void)<br \/>\n{<br \/>\nMySPI_W_SS(0);\/\/\u62c9\u4f4eSS&#xff0c;\u5f00\u59cb\u65f6\u5e8f<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;SPI\u7ec8\u6b62<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid MySPI_Stop(void)<br \/>\n{<br \/>\nMySPI_W_SS(1);\/\/\u62c9\u9ad8SS&#xff0c;\u7ec8\u6b62\u65f6\u5e8f<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;SPI\u4ea4\u6362\u4f20\u8f93\u4e00\u4e2a\u5b57\u8282&#xff0c;\u4f7f\u7528SPI\u6a21\u5f0f0<br \/>\n\u53c2    \u6570&#xff1a;ByteSend \u8981\u53d1\u9001\u7684\u4e00\u4e2a\u5b57\u8282<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u63a5\u6536\u7684\u4e00\u4e2a\u5b57\u8282<br \/>\n*\/<br \/>\nuint8_t MySPI_SwapByte(uint8_t ByteSend)<br \/>\n{<br \/>\nwhile ( SPI_I2S_GetFlagStatus(SPI1,SPI_I2S_FLAG_TXE) !&#061; SET );\/\/\u7b49\u5f85\u53d1\u9001\u6570\u636e\u5bc4\u5b58\u5668\u7a7a<br \/>\nSPI_I2S_SendData(SPI1,ByteSend);\/\/\u5199\u5165\u6570\u636e\u5230\u53d1\u9001\u6570\u636e\u5bc4\u5b58\u5668&#xff0c;\u5f00\u59cb\u4ea7\u751f\u65f6\u5e8f<br \/>\nwhile ( SPI_I2S_GetFlagStatus(SPI1,SPI_I2S_FLAG_RXNE) !&#061; SET );\/\/\u7b49\u5f85\u63a5\u6536\u6570\u636e\u5bc4\u5b58\u5668\u975e\u7a7a<br \/>\nreturn SPI_I2S_ReceiveData(SPI1);\/\/\u8bfb\u53d6\u63a5\u6536\u5230\u7684\u6570\u636e\u5e76\u8fd4\u56de<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">W25Q64_Ins.h<\/span><span style=\"color:#7030a0\">\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#ifndef __W25Q64_INS_H<br \/>\n#define __W25Q64_INS_H<br \/>\n#define W25Q64_WRITE_ENABLE0x06<br \/>\n#define W25Q64_WRITE_DISABLE0x04<br \/>\n#define W25Q64_READ_STATUS_REGISTER_1    0x05<br \/>\n#define W25Q64_READ_STATUS_REGISTER_2    0x35<br \/>\n#define W25Q64_WRITE_STATUS_REGISTER    0x01<br \/>\n#define W25Q64_PAGE_PROGRAM0x02<br \/>\n#define W25Q64_QUAD_PAGE_PROGRAM0x32<br \/>\n#define W25Q64_BLOCK_ERASE_64KB0xD8<br \/>\n#define W25Q64_BLOCK_ERASE_32KB0x52<br \/>\n#define W25Q64_SECTOR_ERASE_4KB0x20<br \/>\n#define W25Q64_CHIP_ERASE0xC7<br \/>\n#define W25Q64_ERASE_SUSPEND0x75<br \/>\n#define W25Q64_ERASE_RESUME0x7A<br \/>\n#define W25Q64_POWER_DOWN0xB9<br \/>\n#define W25Q64_HIGH_PERFORMANCE_MODE    0xA3<br \/>\n#define W25Q64_CONTINUOUS_READ_MODE_RESET        0xFF<br \/>\n#define W25Q64_RELEASE_POWER_DOWN_OR_HPM        0xAB<br \/>\n#define W25Q64_MANUFACTURER0x90<br \/>\n#define W25Q64_READ_UNIQUE0x4B<br \/>\n#define W25Q64_JEDEC_ID0x9F<br \/>\n#define W25Q64_READ_DATA0x03<br \/>\n#define W25Q64_FAST_READ0x0B<br \/>\n#define W25Q64_FAST_READ_DUAL_OUTPUT    0x3B<br \/>\n#define W25Q64_FAST_READ_DUAL_IO0xBB<br \/>\n#define W25Q64_FAST_READ_QUAD_OUTPUT    0x6B<br \/>\n#define W25Q64_FAST_READ_QUAD_IO0xEB<br \/>\n#define W25Q64_OCTAL_WORD_READ_QUAD_IO        0xE3<br \/>\n#define W25Q64_DUMMY_BYTE0xFF<br \/>\n#endif<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#7030a0\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">W25Q64.<\/span><span style=\"color:#ff0000\">c<\/span><span style=\"color:#ff0000\">\u2193<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n#include &#034;MySPI.h&#034;<br \/>\n#include &#034;W25Q64_Ins.h&#034;<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u521d\u59cb\u5316<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_Init(void)<br \/>\n{<br \/>\nMySPI_Init();\/\/\u5148\u521d\u59cb\u5316\u5e95\u5c42\u7684SPI<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u8bfb\u53d6ID\u53f7<br \/>\n\u53c2    \u6570&#xff1a;MID \u5de5\u5382ID&#xff0c;\u4f7f\u7528\u8f93\u51fa\u53c2\u6570\u7684\u5f62\u5f0f\u8fd4\u56de<br \/>\n\u53c2    \u6570&#xff1a;DID \u8bbe\u5907ID&#xff0c;\u4f7f\u7528\u8f93\u51fa\u53c2\u6570\u7684\u5f62\u5f0f\u8fd4\u56de<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_ReadID(uint8_t *MID,uint16_t *DID)<br \/>\n{<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_JEDEC_ID);\/\/\u4ea4\u6362\u53d1\u9001\u8bfb\u53d6ID\u7684\u6307\u4ee4<br \/>\n*MID &#061; MySPI_SwapByte(W25Q64_DUMMY_BYTE);\/\/\u4ea4\u6362\u63a5\u6536MID&#xff0c;\u901a\u8fc7\u8f93\u51fa\u53c2\u6570\u8fd4\u56de<br \/>\n*DID &#061; MySPI_SwapByte(W25Q64_DUMMY_BYTE);\/\/\u4ea4\u6362\u63a5\u6536DID\u9ad88\u4f4d<br \/>\n*DID &lt;&lt;&#061; 8;\/\/\u9ad88\u4f4d\u79fb\u5230\u9ad8\u4f4d<br \/>\n*DID |&#061; MySPI_SwapByte(W25Q64_DUMMY_BYTE);\/\/\u6216\u4e0a\u4ea4\u6362\u63a5\u6536DID\u7684\u4f4e8\u4f4d&#xff0c;\u901a\u8fc7\u8f93\u51fa\u53c2\u6570\u8fd4\u56de<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u5199\u4f7f\u80fd<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_WriteEnable(void)<br \/>\n{<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_WRITE_ENABLE);\/\/\u4ea4\u6362\u53d1\u9001\u5199\u4f7f\u80fd\u7684\u6307\u4ee4<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u7b49\u5f85\u5fd9<br \/>\n\u53c2    \u6570&#xff1a;\u65e0<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_WaitBusy(void)<br \/>\n{<br \/>\nuint32_t Timeout;<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_READ_STATUS_REGISTER_1);\/\/\u4ea4\u6362\u53d1\u9001\u8bfb\u72b6\u6001\u5bc4\u5b58\u56681\u7684\u6307\u4ee4<br \/>\nTimeout &#061; 100000;\/\/\u7ed9\u5b9a\u8d85\u65f6\u8ba1\u6570\u65f6\u95f4<br \/>\nwhile ( (MySPI_SwapByte(W25Q64_DUMMY_BYTE) &amp; 0x01) &#061;&#061; 0x01 )\/\/\u5faa\u73af\u7b49\u5f85\u5fd9\u6807\u5fd7\u4f4d<br \/>\n{<br \/>\nTimeout &#8211;;\/\/\u7b49\u5f85\u65f6&#xff0c;\u8ba1\u6570\u503c\u81ea\u51cf<br \/>\nif(Timeout &#061;&#061; 0)\/\/\u81ea\u51cf\u52300\u540e&#xff0c;\u7b49\u5f85\u8d85\u65f6<br \/>\n{<br \/>\n\/\u8d85\u65f6\u7684\u9519\u8bef\u5904\u7406\u4ee3\u7801&#xff0c;\u53ef\u4ee5\u6dfb\u52a0\u5230\u6b64\u5904\/<br \/>\nbreak;\/\/\u8df3\u51fa\u7b49\u5f85&#xff0c;\u4e0d\u7b49\u4e86<br \/>\n}<br \/>\n}<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u9875\u7f16\u7a0b<br \/>\n\u53c2    \u6570&#xff1a;Address \u9875\u7f16\u7a0b\u7684\u8d77\u59cb\u5730\u5740&#xff0c;\u8303\u56f4&#xff1a;0x000000~0x7FFFFF<br \/>\n\u53c2    \u6570&#xff1a;DataArray\u7528\u4e8e\u5199\u5165\u6570\u636e\u7684\u6570\u7ec4<br \/>\n\u53c2    \u6570&#xff1a;Count \u8981\u5199\u5165\u6570\u636e\u7684\u6570\u91cf&#xff0c;\u8303\u56f4&#xff1a;0~256<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n\u6ce8\u610f\u4e8b\u9879&#xff1a;\u5199\u5165\u7684\u5730\u5740\u8303\u56f4\u4e0d\u80fd\u8de8\u9875<br \/>\n*\/<br \/>\nvoid W25Q64_PageProgram(uint32_t Address,uint8_t *DataArray,uint16_t Count)<br \/>\n{<br \/>\nW25Q64_WriteEnable();\/\/\u5199\u4f7f\u80fd<br \/>\nuint16_t i;<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_PAGE_PROGRAM);\/\/\u4ea4\u6362\u53d1\u9001\u9875\u7f16\u7a0b\u7684\u6307\u4ee4<br \/>\nMySPI_SwapByte(Address &gt;&gt; 16);      \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574023~16\u4f4d<br \/>\nMySPI_SwapByte(Address &gt;&gt; 8);       \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574015~8\u4f4d<br \/>\nMySPI_SwapByte(Address);\/\/\u4ea4\u6362\u53d1\u9001\u5730\u57407~0\u4f4d<br \/>\nfor(i&#061;0;i&lt;Count;i&#043;&#043;)                \/\/\u5faa\u73afCount\u6b21<br \/>\n{<br \/>\nMySPI_SwapByte(DataArray[i]);\/\/\u4f9d\u6b21\u5728\u8d77\u59cb\u5730\u5740\u540e\u5199\u5165\u6570\u636e<br \/>\n}<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\nW25Q64_WaitBusy();\/\/\u7b49\u5f85\u5fd9<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u6247\u533a\u64e6\u9664&#xff08;4KB&#xff09;<br \/>\n\u53c2    \u6570&#xff1a;Address \u6307\u5b9a\u6247\u533a\u7684\u5730\u5740&#xff0c;\u8303\u56f4&#xff1a;0x000000~0x7FFFFF<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_SectorErase(uint32_t Address)<br \/>\n{<br \/>\nW25Q64_WriteEnable();\/\/\u5199\u4f7f\u80fd<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_SECTOR_ERASE_4KB);\/\/\u4ea4\u6362\u53d1\u9001\u6247\u533a\u64e6\u9664\u7684\u6307\u4ee4<br \/>\nMySPI_SwapByte(Address &gt;&gt; 16);          \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574023~16\u4f4d<br \/>\nMySPI_SwapByte(Address &gt;&gt; 8);           \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574015~8\u4f4d<br \/>\nMySPI_SwapByte(Address);                \/\/\u4ea4\u6362\u53d1\u9001\u5730\u57407~0\u4f4d<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\nW25Q64_WaitBusy();\/\/\u7b49\u5f85\u5fd9<br \/>\n}<br \/>\n\/**<br \/>\n\u51fd    \u6570&#xff1a;W25Q64\u8bfb\u53d6\u6570\u636e<br \/>\n\u53c2    \u6570&#xff1a;Address \u8bfb\u53d6\u6570\u636e\u7684\u8d77\u59cb\u5730\u5740&#xff0c;\u8303\u56f4&#xff1a;0x000000~0x7FFFFF<br \/>\n\u53c2    \u6570&#xff1a;DataArray \u7528\u4e8e\u63a5\u6536\u8bfb\u53d6\u6570\u636e\u7684\u6570\u7ec4&#xff0c;\u901a\u8fc7\u8f93\u51fa\u53c2\u6570\u8fd4\u56de<br \/>\n\u53c2    \u6570&#xff1a;Count \u8981\u8bfb\u53d6\u6570\u636e\u7684\u6570\u91cf&#xff0c;\u8303\u56f4&#xff1a;0~0x800000<br \/>\n\u8fd4 \u56de \u503c&#xff1a;\u65e0<br \/>\n*\/<br \/>\nvoid W25Q64_ReadData(uint32_t Address,uint8_t *DataArray,uint32_t Count)<br \/>\n{<br \/>\nuint32_t i;<br \/>\nMySPI_Start();\/\/SPI\u8d77\u59cb<br \/>\nMySPI_SwapByte(W25Q64_READ_DATA);\/\/\u4ea4\u6362\u53d1\u9001\u8bfb\u53d6\u6570\u636e\u7684\u6307\u4ee4<br \/>\nMySPI_SwapByte(Address &gt;&gt; 16);   \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574023~16\u4f4d<br \/>\nMySPI_SwapByte(Address &gt;&gt; 8);    \/\/\u4ea4\u6362\u53d1\u9001\u5730\u574015~8\u4f4d<br \/>\nMySPI_SwapByte(Address);         \/\/\u4ea4\u6362\u53d1\u9001\u5730\u57407~0\u4f4d<br \/>\nfor(i&#061;0;i&lt;Count;i&#043;&#043;)             \/\/\u5faa\u73afCount\u6b21<br \/>\n{<br \/>\nDataArray[i] &#061; MySPI_SwapByte(W25Q64_DUMMY_BYTE);\/\/\u4f9d\u6b21\u5728\u8d77\u59cb\u5730\u5740\u540e\u8bfb\u53d6\u6570\u636e<br \/>\n}<br \/>\nMySPI_Stop();\/\/SPI\u7ec8\u6b62<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\"><span style=\"color:#ff0000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">\n<p style=\"margin-left:.0001pt;text-align:justify\">main.c\u2193<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>#include &#034;stm32f10x.h&#034;                  \/\/ Device header<br \/>\n#include &#034;Delay.h&#034;<br \/>\n#include &#034;OLED.h&#034;<br \/>\n#include &#034;W25Q64.h&#034;<br \/>\nuint8_t MID;\/\/\u5b9a\u4e49\u7528\u4e8e\u5b58\u653eMID\u53f7\u7684\u53d8\u91cf<br \/>\nuint16_t DID;\/\/\u5b9a\u4e49\u7528\u4e8e\u5b58\u653eDID\u53f7\u7684\u53d8\u91cf<br \/>\nuint8_t ArrayWrite[] &#061; {0xFF,0xFE,0xFD,0xFC};\/\/\u5b9a\u4e49\u8981\u5199\u5165\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4<br \/>\nuint8_t ArrayRead[4] &#061; {0x00,0x00,0x00,0x00};\/\/\u5b9a\u4e49\u8981\u8bfb\u53d6\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4<br \/>\nint main(void)<br \/>\n{<br \/>\n\/\u6a21\u5757\u521d\u59cb\u5316\/<br \/>\nOLED_Init();\/\/OLED\u521d\u59cb\u5316<br \/>\nW25Q64_Init();\/\/W25Q64\u521d\u59cb\u5316<br \/>\n\/*\u663e\u793a\u9759\u6001\u5b57\u7b26\u4e32*\/<br \/>\nOLED_ShowString(1,1,&#034;MID:   DID:   &#034;);<br \/>\nOLED_ShowString(2,1,&#034;W:&#034;);<br \/>\nOLED_ShowString(3,1,&#034;R:&#034;);<\/p>\n<p>\/*\u663e\u793aID\u53f7*\/<br \/>\nW25Q64_ReadID(&amp;amp;MID,&amp;amp;DID);\/\/\u83b7\u53d6W25Q64\u7684ID\u53f7<br \/>\nOLED_ShowHexNum(1,5,MID,2);\/\/\u663e\u793aMID<br \/>\nOLED_ShowHexNum(1,12,DID,4);\/\/\u663e\u793aDID<\/p>\n<p>\/*W25Q64\u529f\u80fd\u51fd\u6570\u6d4b\u8bd5*\/<br \/>\nW25Q64_SectorErase(0x000000);\/\/\u6247\u533a\u64e6\u9664<br \/>\nW25Q64_PageProgram(0x000000,ArrayWrite,4);\/\/\u5c06\u5199\u5165\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4\u5199\u5165\u5230W25Q64\u4e2d<\/p>\n<p>W25Q64_ReadData(0x000000,ArrayRead,4);\/\/\u8bfb\u53d6\u521a\u5199\u5165\u7684\u6d4b\u8bd5\u6570\u636e\u5230\u8bfb\u53d6\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4\u4e2d<\/p>\n<p>\/*\u663e\u793a\u6570\u636e*\/<br \/>\nOLED_ShowHexNum(2,3,ArrayWrite[0],2);\/\/\u663e\u793a\u5199\u5165\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4<br \/>\nOLED_ShowHexNum(2,6,ArrayWrite[1],2);\/\/<br \/>\nOLED_ShowHexNum(2,9,ArrayWrite[2],2);\/\/<br \/>\nOLED_ShowHexNum(2,12,ArrayWrite[3],2);\/\/<\/p>\n<p>OLED_ShowHexNum(3,3,ArrayRead[0],2);\/\/\u663e\u793a\u8bfb\u53d6\u6570\u636e\u7684\u6d4b\u8bd5\u6570\u7ec4<br \/>\nOLED_ShowHexNum(3,6,ArrayRead[1],2);\/\/<br \/>\nOLED_ShowHexNum(3,9,ArrayRead[2],2);\/\/<br \/>\nOLED_ShowHexNum(3,12,ArrayRead[3],2);\/\/<\/p>\n<p>while(1)<br \/>\n{<\/p>\n<p>}<br \/>\n}<\/p>\n<p style=\"margin-left:.0001pt;text-align:justify\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145734-6ae35ede4c54a.png\" \/><\/p>\n<\/p>\n<h3 style=\"background-color:transparent\">\u4e8c\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p>\u672c\u6587\u56f4\u7ed5 STM32 \u7684\u786c\u4ef6 SPI \u5916\u8bbe\u4e0e W25Q64 Flash \u82af\u7247\u5c55\u5f00&#xff0c;\u4ece\u5916\u8bbe\u539f\u7406\u5230\u4ee3\u7801\u843d\u5730\u5b8c\u6574\u8d70\u4e86\u4e00\u904d\u6d41\u7a0b&#xff0c;\u6838\u5fc3\u5185\u5bb9\u53ef\u4ee5\u5f52\u7eb3\u4e3a\u4ee5\u4e0b\u51e0\u70b9&#xff1a;<\/p>\n<ul>\n<li>SPI \u5916\u8bbe\u7279\u6027&#xff1a;STM32 \u5185\u90e8\u96c6\u6210\u786c\u4ef6 SPI \u6536\u53d1\u7535\u8def&#xff0c;\u53ef\u81ea\u52a8\u5b8c\u6210\u65f6\u949f\u751f\u6210\u4e0e\u6570\u636e\u6536\u53d1&#xff0c;\u652f\u6301 8 \u4f4d\/16 \u4f4d\u6570\u636e\u5e27\u3001\u9ad8\u4f4d\/\u4f4e\u4f4d\u5148\u884c\u3001\u591a\u79cd\u65f6\u949f\u5206\u9891\u3001\u591a\u4e3b\u673a\u6a21\u578b\u3001\u534a\u53cc\u5de5\/\u5355\u5de5\u7cbe\u7b80\u3001DMA \u4f20\u8f93\u4ee5\u53ca I2S \u534f\u8bae\u517c\u5bb9&#xff1b;STM32F103C8T6 \u4e0a\u53ef\u7528\u8d44\u6e90\u4e3a SPI1 \u548c SPI2\u3002<\/li>\n<li>\u65f6\u5e8f\u4e0e\u6a21\u5f0f&#xff1a;SPI \u901a\u4fe1\u7684\u5173\u952e\u5728\u4e8e CPOL \u4e0e CPHA \u7684\u7ec4\u5408&#xff0c;\u4e8c\u8005\u5171\u540c\u51b3\u5b9a\u91c7\u6837\u8fb9\u6cbf\u3002\u6a21\u5f0f 0&#xff08;CPOL&#061;0\u3001CPHA&#061;0&#xff09;\u4e0b&#xff0c;\u7a7a\u95f2\u65f6 SCK \u4e3a\u4f4e\u7535\u5e73&#xff0c;\u7b2c\u4e00\u4e2a\u8fb9\u6cbf\u79fb\u5165\u6570\u636e\u3001\u7b2c\u4e8c\u4e2a\u8fb9\u6cbf\u79fb\u51fa\u6570\u636e&#xff0c;\u662f\u6700\u5e38\u7528\u7684\u914d\u7f6e\u3002<\/li>\n<li>\u8fde\u7eed\u4f20\u8f93\u4e0e\u975e\u8fde\u7eed\u4f20\u8f93&#xff1a;\u8fde\u7eed\u4f20\u8f93\u4f9d\u9760 TXE \u4e0e RXNE \u6807\u5fd7\u4f4d\u914d\u5408&#xff0c;\u5728\u53d1\u9001\u7f13\u51b2\u5668\u7a7a\u65f6\u5199\u5165\u4e0b\u4e00\u4e2a\u6570\u636e\u3001\u63a5\u6536\u7f13\u51b2\u5668\u975e\u7a7a\u65f6\u8bfb\u51fa\u6570\u636e&#xff0c;\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u6d41\u7684\u65e0\u7f1d\u8854\u63a5&#xff1b;\u975e\u8fde\u7eed\u4f20\u8f93\u5219\u5728\u6bcf\u4e2a\u5b57\u8282\u4e4b\u95f4\u7b49\u5f85\u6807\u5fd7\u4f4d&#xff0c;\u5b9e\u73b0\u7b80\u5355\u4f46\u6548\u7387\u7565\u4f4e\u3002<\/li>\n<li>\u8f6f\u786c\u4ef6\u6ce2\u5f62\u5bf9\u6bd4&#xff1a;\u8f6f\u4ef6\u6a21\u62df SPI \u65f6\u5e8f\u7075\u6d3b\u4f46\u5360\u7528 CPU \u4e14\u901f\u7387\u53d7\u9650&#xff0c;\u786c\u4ef6 SPI \u7531\u5916\u8bbe\u81ea\u52a8\u4ea7\u751f\u65f6\u949f\u4e0e\u79fb\u4f4d\u64cd\u4f5c&#xff0c;\u6ce2\u5f62\u66f4\u89c4\u6574\u3001\u901f\u7387\u66f4\u9ad8&#xff0c;\u9002\u5408\u5bf9\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u6709\u8981\u6c42\u7684\u573a\u666f\u3002<\/li>\n<li>\u521d\u59cb\u5316\u6d41\u7a0b&#xff1a;\u5f00\u542f SPI \u4e0e GPIO \u65f6\u949f \u2192 \u914d\u7f6e GPIO&#xff08;SCK\u3001MOSI \u590d\u7528\u63a8\u633d\u8f93\u51fa&#xff0c;MISO \u4e0a\u62c9\u8f93\u5165&#xff0c;SS \u901a\u7528\u63a8\u633d\u8f93\u51fa&#xff09;\u2192 \u901a\u8fc7\u7ed3\u6784\u4f53\u914d\u7f6e SPI \u53c2\u6570\u5e76\u8c03\u7528 SPI_Init \u2192 \u8c03\u7528 SPI_Cmd \u4f7f\u80fd\u5916\u8bbe\u3002<\/li>\n<li>W25Q64 \u8bfb\u5199\u5b9e\u8df5&#xff1a;\u901a\u8fc7 MySPI_SwapByte \u5b8c\u6210\u5b57\u8282\u7ea7\u4ea4\u6362&#xff0c;\u5c01\u88c5\u51fa\u8bfb ID\u3001\u5199\u4f7f\u80fd\u3001\u7b49\u5f85\u5fd9\u3001\u9875\u7f16\u7a0b\u3001\u6247\u533a\u64e6\u9664\u548c\u8bfb\u6570\u636e\u7b49\u64cd\u4f5c&#xff0c;\u6700\u7ec8\u5728 main \u51fd\u6570\u4e2d\u5b8c\u6210\u64e6\u9664\u3001\u5199\u5165\u3001\u8bfb\u53d6\u5e76\u7528 OLED \u663e\u793a\u9a8c\u8bc1\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p>\u6574\u4f53\u6765\u770b&#xff0c;\u786c\u4ef6 SPI \u7684\u4ef7\u503c\u5728\u4e8e\u628a\u65f6\u5e8f\u7ec6\u8282\u4ea4\u7ed9\u5916\u8bbe\u5904\u7406&#xff0c;\u8f6f\u4ef6\u5c42\u53ea\u9700\u5173\u6ce8\u6807\u5fd7\u4f4d\u5224\u65ad\u4e0e\u534f\u8bae\u6307\u4ee4\u7684\u6536\u53d1\u3002\u638c\u63e1\u8fd9\u5957\u201c\u5e95\u5c42\u5f15\u811a\u914d\u7f6e &#043; \u534f\u8bae\u5c42\u5b57\u8282\u4ea4\u6362 &#043; \u5668\u4ef6\u5c42\u6307\u4ee4\u5c01\u88c5\u201d\u7684\u5206\u5c42\u601d\u8def\u540e&#xff0c;\u518d\u8fc1\u79fb\u5230\u5176\u4ed6 SPI \u5668\u4ef6&#xff08;\u5982\u4f20\u611f\u5668\u3001\u663e\u793a\u5c4f\u3001SD \u5361\u7b49&#xff09;\u65f6&#xff0c;\u53ea\u9700\u66ff\u6362\u5668\u4ef6\u5c42\u7684\u6307\u4ee4\u4e0e\u6d41\u7a0b&#xff0c;\u5e95\u5c42\u4ee3\u7801\u57fa\u672c\u53ef\u4ee5\u590d\u7528\u3002<\/p>\n<p>\u5982\u679c\u540e\u7eed\u9700\u8981\u8fdb\u4e00\u6b65\u63d0\u5347\u6027\u80fd&#xff0c;\u53ef\u4ee5\u8003\u8651\u5f15\u5165 DMA \u51cf\u5c11 CPU \u53c2\u4e0e&#xff0c;\u6216\u4f7f\u7528\u4e2d\u65ad\u65b9\u5f0f\u66ff\u4ee3\u8f6e\u8be2\u7b49\u5f85&#xff1b;\u5728\u6570\u636e\u91cf\u8f83\u5927\u3001\u5b9e\u65f6\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u573a\u666f\u4e2d&#xff0c;\u8fd9\u4e9b\u4f18\u5316\u4f1a\u5e26\u6765\u660e\u663e\u6536\u76ca\u3002<\/p>\n<\/p>\n<p>\u90fd\u770b\u5230\u8fd9\u4e86\u70b9\u70b9\u8d5e\u5427&#xff01;\u6c42\u6c42\u4e86&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u524d\u4e00\u7ae0\u8282\u4e2d&#xff0c;\u6211\u4eec\u6df1\u5165\u63a2\u8ba8\u4e86SPI\u901a\u4fe1\u534f\u8bae\u7684\u57fa\u672c\u539f\u7406&#xff0c;\u5e76\u901a\u8fc7\u8f6f\u4ef6\u6a21\u62df\u7684\u65b9\u5f0f\u5b9e\u73b0\u4e86\u4e0eW25Q64 Flash\u5b58\u50a8\u5668\u7684\u4ea4\u4e92\u3002\u8fd9\u4e00\u8fc7\u7a0b\u867d\u7136\u6709\u52a9\u4e8e\u7406\u89e3SPI\u65f6\u5e8f\u7684\u5e95\u5c42\u903b\u8f91&#xff0c;\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u5b58\u5728\u5360\u7528CPU\u8d44\u6e90\u591a\u3001\u901a\u4fe1\u901f\u7387\u53d7\u9650\u7b49\u95ee\u9898\u3002\u968f\u7740\u7cfb\u7edf\u5bf9\u6570\u636e\u4f20\u8f93\u6548\u7387\u548c\u5b9e\u65f6\u6027\u8981\u6c42\u7684\u63d0\u5347&#xff0c;\u5355\u7eaf\u4f9d\u8d56GPIO\u4f4d\u64cd\u4f5c\u6765\u6a21\u62dfSPI\u5df2\u96be\u4ee5\u6ee1\u8db3\u9ad8\u6027\u80fd\u9700\u6c42\u3002\u672c\u7ae0\u5c06\u8f6c\u5411STM32\u5185\u7f6e\u7684\u786c\u4ef6SPI\u5916\u8bbe&#xff0c;\u5168\u9762\u89e3\u6790\u5982\u4f55\u5229\u7528\u5176\u4e13\u7528\u786c\u4ef6\u6a21\u5757\u5b9e\u73b0\u4e0eW25Q64\u7684<\/p>\n","protected":false},"author":2,"featured_media":119546,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11820,217,270,371,269,305],"topic":[],"class_list":["post-119557","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-atomgit","tag-stm32","tag-270","tag-371","tag-269","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/119557.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u524d\u4e00\u7ae0\u8282\u4e2d&#xff0c;\u6211\u4eec\u6df1\u5165\u63a2\u8ba8\u4e86SPI\u901a\u4fe1\u534f\u8bae\u7684\u57fa\u672c\u539f\u7406&#xff0c;\u5e76\u901a\u8fc7\u8f6f\u4ef6\u6a21\u62df\u7684\u65b9\u5f0f\u5b9e\u73b0\u4e86\u4e0eW25Q64 Flash\u5b58\u50a8\u5668\u7684\u4ea4\u4e92\u3002\u8fd9\u4e00\u8fc7\u7a0b\u867d\u7136\u6709\u52a9\u4e8e\u7406\u89e3SPI\u65f6\u5e8f\u7684\u5e95\u5c42\u903b\u8f91&#xff0c;\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u5b58\u5728\u5360\u7528CPU\u8d44\u6e90\u591a\u3001\u901a\u4fe1\u901f\u7387\u53d7\u9650\u7b49\u95ee\u9898\u3002\u968f\u7740\u7cfb\u7edf\u5bf9\u6570\u636e\u4f20\u8f93\u6548\u7387\u548c\u5b9e\u65f6\u6027\u8981\u6c42\u7684\u63d0\u5347&#xff0c;\u5355\u7eaf\u4f9d\u8d56GPIO\u4f4d\u64cd\u4f5c\u6765\u6a21\u62dfSPI\u5df2\u96be\u4ee5\u6ee1\u8db3\u9ad8\u6027\u80fd\u9700\u6c42\u3002\u672c\u7ae0\u5c06\u8f6c\u5411STM32\u5185\u7f6e\u7684\u786c\u4ef6SPI\u5916\u8bbe&#xff0c;\u5168\u9762\u89e3\u6790\u5982\u4f55\u5229\u7528\u5176\u4e13\u7528\u786c\u4ef6\u6a21\u5757\u5b9e\u73b0\u4e0eW25Q64\u7684\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/119557.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-29T14:57:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145732-6ae35edcb376e.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/119557.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/119557.html\",\"name\":\"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-29T14:57:36+00:00\",\"dateModified\":\"2026-10-29T14:57:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/119557.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/119557.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/119557.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/119557.html","og_locale":"zh_CN","og_type":"article","og_title":"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u524d\u4e00\u7ae0\u8282\u4e2d&#xff0c;\u6211\u4eec\u6df1\u5165\u63a2\u8ba8\u4e86SPI\u901a\u4fe1\u534f\u8bae\u7684\u57fa\u672c\u539f\u7406&#xff0c;\u5e76\u901a\u8fc7\u8f6f\u4ef6\u6a21\u62df\u7684\u65b9\u5f0f\u5b9e\u73b0\u4e86\u4e0eW25Q64 Flash\u5b58\u50a8\u5668\u7684\u4ea4\u4e92\u3002\u8fd9\u4e00\u8fc7\u7a0b\u867d\u7136\u6709\u52a9\u4e8e\u7406\u89e3SPI\u65f6\u5e8f\u7684\u5e95\u5c42\u903b\u8f91&#xff0c;\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u5b58\u5728\u5360\u7528CPU\u8d44\u6e90\u591a\u3001\u901a\u4fe1\u901f\u7387\u53d7\u9650\u7b49\u95ee\u9898\u3002\u968f\u7740\u7cfb\u7edf\u5bf9\u6570\u636e\u4f20\u8f93\u6548\u7387\u548c\u5b9e\u65f6\u6027\u8981\u6c42\u7684\u63d0\u5347&#xff0c;\u5355\u7eaf\u4f9d\u8d56GPIO\u4f4d\u64cd\u4f5c\u6765\u6a21\u62dfSPI\u5df2\u96be\u4ee5\u6ee1\u8db3\u9ad8\u6027\u80fd\u9700\u6c42\u3002\u672c\u7ae0\u5c06\u8f6c\u5411STM32\u5185\u7f6e\u7684\u786c\u4ef6SPI\u5916\u8bbe&#xff0c;\u5168\u9762\u89e3\u6790\u5982\u4f55\u5229\u7528\u5176\u4e13\u7528\u786c\u4ef6\u6a21\u5757\u5b9e\u73b0\u4e0eW25Q64\u7684","og_url":"https:\/\/www.wsisp.com\/helps\/119557.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-29T14:57:36+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261029145732-6ae35edcb376e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/119557.html","url":"https:\/\/www.wsisp.com\/helps\/119557.html","name":"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-29T14:57:36+00:00","dateModified":"2026-10-29T14:57:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/119557.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/119557.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/119557.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SPI\u901a\u4fe1\u5916\u8bbe\u4e0eW25Q64 \uff08\u786c\u4ef6SPI\uff09\uff08STM32\u6807\u51c6\u5e93\u5b66\u4e60\u7b14\u8bb0\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/119557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=119557"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/119557\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/119546"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=119557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=119557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=119557"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=119557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}