stm32f4xx_hal_msp.c 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * File Name : stm32f4xx_hal_msp.c
  5. * Description : This file provides code for the MSP Initialization
  6. * and de-Initialization codes.
  7. ******************************************************************************
  8. ** This notice applies to any and all portions of this file
  9. * that are not between comment pairs USER CODE BEGIN and
  10. * USER CODE END. Other portions of this file, whether
  11. * inserted by the user or by software development tools
  12. * are owned by their respective copyright owners.
  13. *
  14. * COPYRIGHT(c) 2018 STMicroelectronics
  15. *
  16. * Redistribution and use in source and binary forms, with or without modification,
  17. * are permitted provided that the following conditions are met:
  18. * 1. Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * 2. Redistributions in binary form must reproduce the above copyright notice,
  21. * this list of conditions and the following disclaimer in the documentation
  22. * and/or other materials provided with the distribution.
  23. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  24. * may be used to endorse or promote products derived from this software
  25. * without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  28. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  30. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  31. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  33. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  34. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  35. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. ******************************************************************************
  39. */
  40. /* USER CODE END Header */
  41. /* Includes ------------------------------------------------------------------*/
  42. #include "main.h"
  43. /* USER CODE BEGIN Includes */
  44. #include <drv_common.h>
  45. /* USER CODE END Includes */
  46. /* Private typedef -----------------------------------------------------------*/
  47. /* USER CODE BEGIN TD */
  48. /* USER CODE END TD */
  49. /* Private define ------------------------------------------------------------*/
  50. /* USER CODE BEGIN Define */
  51. /* USER CODE END Define */
  52. /* Private macro -------------------------------------------------------------*/
  53. /* USER CODE BEGIN Macro */
  54. /* USER CODE END Macro */
  55. /* Private variables ---------------------------------------------------------*/
  56. /* USER CODE BEGIN PV */
  57. /* USER CODE END PV */
  58. /* Private function prototypes -----------------------------------------------*/
  59. /* USER CODE BEGIN PFP */
  60. /* USER CODE END PFP */
  61. /* External functions --------------------------------------------------------*/
  62. /* USER CODE BEGIN ExternalFunctions */
  63. /* USER CODE END ExternalFunctions */
  64. /* USER CODE BEGIN 0 */
  65. /* USER CODE END 0 */
  66. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
  67. /**
  68. * Initializes the Global MSP.
  69. */
  70. void HAL_MspInit(void)
  71. {
  72. /* USER CODE BEGIN MspInit 0 */
  73. /* USER CODE END MspInit 0 */
  74. __HAL_RCC_SYSCFG_CLK_ENABLE();
  75. __HAL_RCC_PWR_CLK_ENABLE();
  76. /* System interrupt init*/
  77. /* USER CODE BEGIN MspInit 1 */
  78. /* USER CODE END MspInit 1 */
  79. }
  80. /**
  81. * @brief DAC MSP Initialization
  82. * This function configures the hardware resources used in this example
  83. * @param hdac: DAC handle pointer
  84. * @retval None
  85. */
  86. void HAL_DAC_MspInit(DAC_HandleTypeDef *hdac)
  87. {
  88. GPIO_InitTypeDef GPIO_InitStruct = {0};
  89. if (hdac->Instance==DAC)
  90. {
  91. /* USER CODE BEGIN DAC_MspInit 0 */
  92. /* USER CODE END DAC_MspInit 0 */
  93. /* Peripheral clock enable */
  94. __HAL_RCC_DAC_CLK_ENABLE();
  95. __HAL_RCC_GPIOA_CLK_ENABLE();
  96. /**DAC GPIO Configuration
  97. PA4 ------> DAC_OUT1
  98. PA5 ------> DAC_OUT2
  99. */
  100. GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5;
  101. GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
  102. GPIO_InitStruct.Pull = GPIO_NOPULL;
  103. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  104. /* USER CODE BEGIN DAC_MspInit 1 */
  105. /* USER CODE END DAC_MspInit 1 */
  106. }
  107. }
  108. /**
  109. * @brief DAC MSP De-Initialization
  110. * This function freeze the hardware resources used in this example
  111. * @param hdac: DAC handle pointer
  112. * @retval None
  113. */
  114. void HAL_DAC_MspDeInit(DAC_HandleTypeDef *hdac)
  115. {
  116. if (hdac->Instance==DAC)
  117. {
  118. /* USER CODE BEGIN DAC_MspDeInit 0 */
  119. /* USER CODE END DAC_MspDeInit 0 */
  120. /* Peripheral clock disable */
  121. __HAL_RCC_DAC_CLK_DISABLE();
  122. /**DAC GPIO Configuration
  123. PA4 ------> DAC_OUT1
  124. PA5 ------> DAC_OUT2
  125. */
  126. HAL_GPIO_DeInit(GPIOA, GPIO_PIN_4|GPIO_PIN_5);
  127. /* USER CODE BEGIN DAC_MspDeInit 1 */
  128. /* USER CODE END DAC_MspDeInit 1 */
  129. }
  130. }
  131. /**
  132. * @brief ETH MSP Initialization
  133. * This function configures the hardware resources used in this example
  134. * @param heth: ETH handle pointer
  135. * @retval None
  136. */
  137. void HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
  138. {
  139. GPIO_InitTypeDef GPIO_InitStruct = {0};
  140. if (heth->Instance==ETH)
  141. {
  142. /* USER CODE BEGIN ETH_MspInit 0 */
  143. /* USER CODE END ETH_MspInit 0 */
  144. /* Peripheral clock enable */
  145. __HAL_RCC_ETH_CLK_ENABLE();
  146. __HAL_RCC_GPIOC_CLK_ENABLE();
  147. __HAL_RCC_GPIOA_CLK_ENABLE();
  148. __HAL_RCC_GPIOG_CLK_ENABLE();
  149. /**ETH GPIO Configuration
  150. PC1 ------> ETH_MDC
  151. PA1 ------> ETH_REF_CLK
  152. PA2 ------> ETH_MDIO
  153. PA7 ------> ETH_CRS_DV
  154. PC4 ------> ETH_RXD0
  155. PC5 ------> ETH_RXD1
  156. PG11 ------> ETH_TX_EN
  157. PG13 ------> ETH_TXD0
  158. PG14 ------> ETH_TXD1
  159. */
  160. GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5;
  161. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  162. GPIO_InitStruct.Pull = GPIO_NOPULL;
  163. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  164. GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
  165. HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
  166. GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7;
  167. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  168. GPIO_InitStruct.Pull = GPIO_NOPULL;
  169. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  170. GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
  171. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  172. GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_13|GPIO_PIN_14;
  173. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  174. GPIO_InitStruct.Pull = GPIO_NOPULL;
  175. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  176. GPIO_InitStruct.Alternate = GPIO_AF11_ETH;
  177. HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
  178. /* USER CODE BEGIN ETH_MspInit 1 */
  179. /* USER CODE END ETH_MspInit 1 */
  180. }
  181. }
  182. /**
  183. * @brief ETH MSP De-Initialization
  184. * This function freeze the hardware resources used in this example
  185. * @param heth: ETH handle pointer
  186. * @retval None
  187. */
  188. void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth)
  189. {
  190. if (heth->Instance==ETH)
  191. {
  192. /* USER CODE BEGIN ETH_MspDeInit 0 */
  193. /* USER CODE END ETH_MspDeInit 0 */
  194. /* Peripheral clock disable */
  195. __HAL_RCC_ETH_CLK_DISABLE();
  196. /**ETH GPIO Configuration
  197. PC1 ------> ETH_MDC
  198. PA1 ------> ETH_REF_CLK
  199. PA2 ------> ETH_MDIO
  200. PA7 ------> ETH_CRS_DV
  201. PC4 ------> ETH_RXD0
  202. PC5 ------> ETH_RXD1
  203. PG11 ------> ETH_TX_EN
  204. PG13 ------> ETH_TXD0
  205. PG14 ------> ETH_TXD1
  206. */
  207. HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5);
  208. HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_7);
  209. HAL_GPIO_DeInit(GPIOG, GPIO_PIN_11|GPIO_PIN_13|GPIO_PIN_14);
  210. /* USER CODE BEGIN ETH_MspDeInit 1 */
  211. /* USER CODE END ETH_MspDeInit 1 */
  212. }
  213. }
  214. /**
  215. * @brief RTC MSP Initialization
  216. * This function configures the hardware resources used in this example
  217. * @param hrtc: RTC handle pointer
  218. * @retval None
  219. */
  220. void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc)
  221. {
  222. if (hrtc->Instance==RTC)
  223. {
  224. /* USER CODE BEGIN RTC_MspInit 0 */
  225. /* USER CODE END RTC_MspInit 0 */
  226. /* Peripheral clock enable */
  227. __HAL_RCC_RTC_ENABLE();
  228. /* USER CODE BEGIN RTC_MspInit 1 */
  229. /* USER CODE END RTC_MspInit 1 */
  230. }
  231. }
  232. /**
  233. * @brief RTC MSP De-Initialization
  234. * This function freeze the hardware resources used in this example
  235. * @param hrtc: RTC handle pointer
  236. * @retval None
  237. */
  238. void HAL_RTC_MspDeInit(RTC_HandleTypeDef *hrtc)
  239. {
  240. if (hrtc->Instance==RTC)
  241. {
  242. /* USER CODE BEGIN RTC_MspDeInit 0 */
  243. /* USER CODE END RTC_MspDeInit 0 */
  244. /* Peripheral clock disable */
  245. __HAL_RCC_RTC_DISABLE();
  246. /* USER CODE BEGIN RTC_MspDeInit 1 */
  247. /* USER CODE END RTC_MspDeInit 1 */
  248. }
  249. }
  250. /**
  251. * @brief SD MSP Initialization
  252. * This function configures the hardware resources used in this example
  253. * @param hsd: SD handle pointer
  254. * @retval None
  255. */
  256. void HAL_SD_MspInit(SD_HandleTypeDef *hsd)
  257. {
  258. GPIO_InitTypeDef GPIO_InitStruct = {0};
  259. if (hsd->Instance==SDIO)
  260. {
  261. /* USER CODE BEGIN SDIO_MspInit 0 */
  262. /* USER CODE END SDIO_MspInit 0 */
  263. /* Peripheral clock enable */
  264. __HAL_RCC_SDIO_CLK_ENABLE();
  265. __HAL_RCC_GPIOC_CLK_ENABLE();
  266. __HAL_RCC_GPIOD_CLK_ENABLE();
  267. /**SDIO GPIO Configuration
  268. PC8 ------> SDIO_D0
  269. PC9 ------> SDIO_D1
  270. PC10 ------> SDIO_D2
  271. PC11 ------> SDIO_D3
  272. PC12 ------> SDIO_CK
  273. PD2 ------> SDIO_CMD
  274. */
  275. GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
  276. |GPIO_PIN_12;
  277. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  278. GPIO_InitStruct.Pull = GPIO_NOPULL;
  279. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  280. GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
  281. HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
  282. GPIO_InitStruct.Pin = GPIO_PIN_2;
  283. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  284. GPIO_InitStruct.Pull = GPIO_NOPULL;
  285. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  286. GPIO_InitStruct.Alternate = GPIO_AF12_SDIO;
  287. HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
  288. /* USER CODE BEGIN SDIO_MspInit 1 */
  289. /* USER CODE END SDIO_MspInit 1 */
  290. }
  291. }
  292. /**
  293. * @brief SD MSP De-Initialization
  294. * This function freeze the hardware resources used in this example
  295. * @param hsd: SD handle pointer
  296. * @retval None
  297. */
  298. void HAL_SD_MspDeInit(SD_HandleTypeDef *hsd)
  299. {
  300. if (hsd->Instance==SDIO)
  301. {
  302. /* USER CODE BEGIN SDIO_MspDeInit 0 */
  303. /* USER CODE END SDIO_MspDeInit 0 */
  304. /* Peripheral clock disable */
  305. __HAL_RCC_SDIO_CLK_DISABLE();
  306. /**SDIO GPIO Configuration
  307. PC8 ------> SDIO_D0
  308. PC9 ------> SDIO_D1
  309. PC10 ------> SDIO_D2
  310. PC11 ------> SDIO_D3
  311. PC12 ------> SDIO_CK
  312. PD2 ------> SDIO_CMD
  313. */
  314. HAL_GPIO_DeInit(GPIOC, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
  315. |GPIO_PIN_12);
  316. HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
  317. /* USER CODE BEGIN SDIO_MspDeInit 1 */
  318. /* USER CODE END SDIO_MspDeInit 1 */
  319. }
  320. }
  321. /**
  322. * @brief SPI MSP Initialization
  323. * This function configures the hardware resources used in this example
  324. * @param hspi: SPI handle pointer
  325. * @retval None
  326. */
  327. void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi)
  328. {
  329. GPIO_InitTypeDef GPIO_InitStruct = {0};
  330. if (hspi->Instance==SPI1)
  331. {
  332. /* USER CODE BEGIN SPI1_MspInit 0 */
  333. /* USER CODE END SPI1_MspInit 0 */
  334. /* Peripheral clock enable */
  335. __HAL_RCC_SPI1_CLK_ENABLE();
  336. __HAL_RCC_GPIOB_CLK_ENABLE();
  337. /**SPI1 GPIO Configuration
  338. PB3 ------> SPI1_SCK
  339. PB4 ------> SPI1_MISO
  340. PB5 ------> SPI1_MOSI
  341. */
  342. GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5;
  343. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  344. GPIO_InitStruct.Pull = GPIO_NOPULL;
  345. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  346. GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
  347. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  348. /* SPI1 interrupt Init */
  349. HAL_NVIC_SetPriority(SPI1_IRQn, 0, 0);
  350. HAL_NVIC_EnableIRQ(SPI1_IRQn);
  351. /* USER CODE BEGIN SPI1_MspInit 1 */
  352. /* USER CODE END SPI1_MspInit 1 */
  353. }
  354. else if (hspi->Instance==SPI2)
  355. {
  356. /* USER CODE BEGIN SPI2_MspInit 0 */
  357. /* USER CODE END SPI2_MspInit 0 */
  358. /* Peripheral clock enable */
  359. __HAL_RCC_SPI2_CLK_ENABLE();
  360. __HAL_RCC_GPIOC_CLK_ENABLE();
  361. __HAL_RCC_GPIOB_CLK_ENABLE();
  362. /**SPI2 GPIO Configuration
  363. PC2 ------> SPI2_MISO
  364. PC3 ------> SPI2_MOSI
  365. PB13 ------> SPI2_SCK
  366. */
  367. GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3;
  368. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  369. GPIO_InitStruct.Pull = GPIO_NOPULL;
  370. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  371. GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
  372. HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
  373. GPIO_InitStruct.Pin = GPIO_PIN_13;
  374. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  375. GPIO_InitStruct.Pull = GPIO_NOPULL;
  376. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  377. GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
  378. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  379. /* USER CODE BEGIN SPI2_MspInit 1 */
  380. /* USER CODE END SPI2_MspInit 1 */
  381. }
  382. }
  383. /**
  384. * @brief SPI MSP De-Initialization
  385. * This function freeze the hardware resources used in this example
  386. * @param hspi: SPI handle pointer
  387. * @retval None
  388. */
  389. void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
  390. {
  391. if (hspi->Instance==SPI1)
  392. {
  393. /* USER CODE BEGIN SPI1_MspDeInit 0 */
  394. /* USER CODE END SPI1_MspDeInit 0 */
  395. /* Peripheral clock disable */
  396. __HAL_RCC_SPI1_CLK_DISABLE();
  397. /**SPI1 GPIO Configuration
  398. PB3 ------> SPI1_SCK
  399. PB4 ------> SPI1_MISO
  400. PB5 ------> SPI1_MOSI
  401. */
  402. HAL_GPIO_DeInit(GPIOB, GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5);
  403. /* SPI1 interrupt DeInit */
  404. HAL_NVIC_DisableIRQ(SPI1_IRQn);
  405. /* USER CODE BEGIN SPI1_MspDeInit 1 */
  406. /* USER CODE END SPI1_MspDeInit 1 */
  407. }
  408. else if (hspi->Instance==SPI2)
  409. {
  410. /* USER CODE BEGIN SPI2_MspDeInit 0 */
  411. /* USER CODE END SPI2_MspDeInit 0 */
  412. /* Peripheral clock disable */
  413. __HAL_RCC_SPI2_CLK_DISABLE();
  414. /**SPI2 GPIO Configuration
  415. PC2 ------> SPI2_MISO
  416. PC3 ------> SPI2_MOSI
  417. PB13 ------> SPI2_SCK
  418. */
  419. HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2|GPIO_PIN_3);
  420. HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13);
  421. /* USER CODE BEGIN SPI2_MspDeInit 1 */
  422. /* USER CODE END SPI2_MspDeInit 1 */
  423. }
  424. }
  425. /**
  426. * @brief TIM_Base MSP Initialization
  427. * This function configures the hardware resources used in this example
  428. * @param htim_base: TIM_Base handle pointer
  429. * @retval None
  430. */
  431. void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim_base)
  432. {
  433. if (htim_base->Instance==TIM2)
  434. {
  435. /* USER CODE BEGIN TIM2_MspInit 0 */
  436. /* USER CODE END TIM2_MspInit 0 */
  437. /* Peripheral clock enable */
  438. __HAL_RCC_TIM2_CLK_ENABLE();
  439. /* USER CODE BEGIN TIM2_MspInit 1 */
  440. /* USER CODE END TIM2_MspInit 1 */
  441. }
  442. else if (htim_base->Instance==TIM11)
  443. {
  444. /* USER CODE BEGIN TIM11_MspInit 0 */
  445. /* USER CODE END TIM11_MspInit 0 */
  446. /* Peripheral clock enable */
  447. __HAL_RCC_TIM11_CLK_ENABLE();
  448. /* USER CODE BEGIN TIM11_MspInit 1 */
  449. /* USER CODE END TIM11_MspInit 1 */
  450. }
  451. else if (htim_base->Instance==TIM13)
  452. {
  453. /* USER CODE BEGIN TIM13_MspInit 0 */
  454. /* USER CODE END TIM13_MspInit 0 */
  455. /* Peripheral clock enable */
  456. __HAL_RCC_TIM13_CLK_ENABLE();
  457. /* USER CODE BEGIN TIM13_MspInit 1 */
  458. /* USER CODE END TIM13_MspInit 1 */
  459. }
  460. else if (htim_base->Instance==TIM14)
  461. {
  462. /* USER CODE BEGIN TIM14_MspInit 0 */
  463. /* USER CODE END TIM14_MspInit 0 */
  464. /* Peripheral clock enable */
  465. __HAL_RCC_TIM14_CLK_ENABLE();
  466. /* USER CODE BEGIN TIM14_MspInit 1 */
  467. /* USER CODE END TIM14_MspInit 1 */
  468. }
  469. }
  470. /**
  471. * @brief TIM_Encoder MSP Initialization
  472. * This function configures the hardware resources used in this example
  473. * @param htim_encoder: TIM_Encoder handle pointer
  474. * @retval None
  475. */
  476. void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim_encoder)
  477. {
  478. GPIO_InitTypeDef GPIO_InitStruct = {0};
  479. if (htim_encoder->Instance==TIM4)
  480. {
  481. /* USER CODE BEGIN TIM4_MspInit 0 */
  482. /* USER CODE END TIM4_MspInit 0 */
  483. /* Peripheral clock enable */
  484. __HAL_RCC_TIM4_CLK_ENABLE();
  485. __HAL_RCC_GPIOB_CLK_ENABLE();
  486. /**TIM4 GPIO Configuration
  487. PB6 ------> TIM4_CH1
  488. PB7 ------> TIM4_CH2
  489. */
  490. GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
  491. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  492. GPIO_InitStruct.Pull = GPIO_NOPULL;
  493. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  494. GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
  495. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  496. /* USER CODE BEGIN TIM4_MspInit 1 */
  497. /* USER CODE END TIM4_MspInit 1 */
  498. }
  499. }
  500. void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim)
  501. {
  502. GPIO_InitTypeDef GPIO_InitStruct = {0};
  503. if (htim->Instance==TIM2)
  504. {
  505. /* USER CODE BEGIN TIM2_MspPostInit 0 */
  506. /* USER CODE END TIM2_MspPostInit 0 */
  507. __HAL_RCC_GPIOA_CLK_ENABLE();
  508. /**TIM2 GPIO Configuration
  509. PA3 ------> TIM2_CH4
  510. */
  511. GPIO_InitStruct.Pin = GPIO_PIN_3;
  512. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  513. GPIO_InitStruct.Pull = GPIO_NOPULL;
  514. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  515. GPIO_InitStruct.Alternate = GPIO_AF1_TIM2;
  516. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  517. /* USER CODE BEGIN TIM2_MspPostInit 1 */
  518. /* USER CODE END TIM2_MspPostInit 1 */
  519. }
  520. }
  521. /**
  522. * @brief TIM_Base MSP De-Initialization
  523. * This function freeze the hardware resources used in this example
  524. * @param htim_base: TIM_Base handle pointer
  525. * @retval None
  526. */
  527. void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim_base)
  528. {
  529. if (htim_base->Instance==TIM2)
  530. {
  531. /* USER CODE BEGIN TIM2_MspDeInit 0 */
  532. /* USER CODE END TIM2_MspDeInit 0 */
  533. /* Peripheral clock disable */
  534. __HAL_RCC_TIM2_CLK_DISABLE();
  535. /* USER CODE BEGIN TIM2_MspDeInit 1 */
  536. /* USER CODE END TIM2_MspDeInit 1 */
  537. }
  538. else if (htim_base->Instance==TIM11)
  539. {
  540. /* USER CODE BEGIN TIM11_MspDeInit 0 */
  541. /* USER CODE END TIM11_MspDeInit 0 */
  542. /* Peripheral clock disable */
  543. __HAL_RCC_TIM11_CLK_DISABLE();
  544. /* USER CODE BEGIN TIM11_MspDeInit 1 */
  545. /* USER CODE END TIM11_MspDeInit 1 */
  546. }
  547. else if (htim_base->Instance==TIM13)
  548. {
  549. /* USER CODE BEGIN TIM13_MspDeInit 0 */
  550. /* USER CODE END TIM13_MspDeInit 0 */
  551. /* Peripheral clock disable */
  552. __HAL_RCC_TIM13_CLK_DISABLE();
  553. /* USER CODE BEGIN TIM13_MspDeInit 1 */
  554. /* USER CODE END TIM13_MspDeInit 1 */
  555. }
  556. else if (htim_base->Instance==TIM14)
  557. {
  558. /* USER CODE BEGIN TIM14_MspDeInit 0 */
  559. /* USER CODE END TIM14_MspDeInit 0 */
  560. /* Peripheral clock disable */
  561. __HAL_RCC_TIM14_CLK_DISABLE();
  562. /* USER CODE BEGIN TIM14_MspDeInit 1 */
  563. /* USER CODE END TIM14_MspDeInit 1 */
  564. }
  565. }
  566. /**
  567. * @brief TIM_Encoder MSP De-Initialization
  568. * This function freeze the hardware resources used in this example
  569. * @param htim_encoder: TIM_Encoder handle pointer
  570. * @retval None
  571. */
  572. void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim_encoder)
  573. {
  574. if (htim_encoder->Instance==TIM4)
  575. {
  576. /* USER CODE BEGIN TIM4_MspDeInit 0 */
  577. /* USER CODE END TIM4_MspDeInit 0 */
  578. /* Peripheral clock disable */
  579. __HAL_RCC_TIM4_CLK_DISABLE();
  580. /**TIM4 GPIO Configuration
  581. PB6 ------> TIM4_CH1
  582. PB7 ------> TIM4_CH2
  583. */
  584. HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
  585. /* USER CODE BEGIN TIM4_MspDeInit 1 */
  586. /* USER CODE END TIM4_MspDeInit 1 */
  587. }
  588. }
  589. /**
  590. * @brief UART MSP Initialization
  591. * This function configures the hardware resources used in this example
  592. * @param huart: UART handle pointer
  593. * @retval None
  594. */
  595. void HAL_UART_MspInit(UART_HandleTypeDef *huart)
  596. {
  597. GPIO_InitTypeDef GPIO_InitStruct = {0};
  598. if (huart->Instance==USART1)
  599. {
  600. /* USER CODE BEGIN USART1_MspInit 0 */
  601. /* USER CODE END USART1_MspInit 0 */
  602. /* Peripheral clock enable */
  603. __HAL_RCC_USART1_CLK_ENABLE();
  604. __HAL_RCC_GPIOA_CLK_ENABLE();
  605. /**USART1 GPIO Configuration
  606. PA9 ------> USART1_TX
  607. PA10 ------> USART1_RX
  608. */
  609. GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10;
  610. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  611. GPIO_InitStruct.Pull = GPIO_PULLUP;
  612. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  613. GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
  614. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  615. /* USART1 interrupt Init */
  616. HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
  617. HAL_NVIC_EnableIRQ(USART1_IRQn);
  618. /* USER CODE BEGIN USART1_MspInit 1 */
  619. /* USER CODE END USART1_MspInit 1 */
  620. }
  621. else if (huart->Instance==USART3)
  622. {
  623. /* USER CODE BEGIN USART3_MspInit 0 */
  624. /* USER CODE END USART3_MspInit 0 */
  625. /* Peripheral clock enable */
  626. __HAL_RCC_USART3_CLK_ENABLE();
  627. __HAL_RCC_GPIOB_CLK_ENABLE();
  628. /**USART3 GPIO Configuration
  629. PB10 ------> USART3_TX
  630. PB11 ------> USART3_RX
  631. */
  632. GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11;
  633. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  634. GPIO_InitStruct.Pull = GPIO_PULLUP;
  635. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  636. GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
  637. HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  638. /* USER CODE BEGIN USART3_MspInit 1 */
  639. /* USER CODE END USART3_MspInit 1 */
  640. }
  641. }
  642. /**
  643. * @brief UART MSP De-Initialization
  644. * This function freeze the hardware resources used in this example
  645. * @param huart: UART handle pointer
  646. * @retval None
  647. */
  648. void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
  649. {
  650. if (huart->Instance==USART1)
  651. {
  652. /* USER CODE BEGIN USART1_MspDeInit 0 */
  653. /* USER CODE END USART1_MspDeInit 0 */
  654. /* Peripheral clock disable */
  655. __HAL_RCC_USART1_CLK_DISABLE();
  656. /**USART1 GPIO Configuration
  657. PA9 ------> USART1_TX
  658. PA10 ------> USART1_RX
  659. */
  660. HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
  661. /* USART1 interrupt DeInit */
  662. HAL_NVIC_DisableIRQ(USART1_IRQn);
  663. /* USER CODE BEGIN USART1_MspDeInit 1 */
  664. /* USER CODE END USART1_MspDeInit 1 */
  665. }
  666. else if (huart->Instance==USART3)
  667. {
  668. /* USER CODE BEGIN USART3_MspDeInit 0 */
  669. /* USER CODE END USART3_MspDeInit 0 */
  670. /* Peripheral clock disable */
  671. __HAL_RCC_USART3_CLK_DISABLE();
  672. /**USART3 GPIO Configuration
  673. PB10 ------> USART3_TX
  674. PB11 ------> USART3_RX
  675. */
  676. HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11);
  677. /* USER CODE BEGIN USART3_MspDeInit 1 */
  678. /* USER CODE END USART3_MspDeInit 1 */
  679. }
  680. }
  681. /**
  682. * @brief PCD MSP Initialization
  683. * This function configures the hardware resources used in this example
  684. * @param hpcd: PCD handle pointer
  685. * @retval None
  686. */
  687. void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd)
  688. {
  689. GPIO_InitTypeDef GPIO_InitStruct = {0};
  690. if (hpcd->Instance==USB_OTG_FS)
  691. {
  692. /* USER CODE BEGIN USB_OTG_FS_MspInit 0 */
  693. /* USER CODE END USB_OTG_FS_MspInit 0 */
  694. __HAL_RCC_GPIOA_CLK_ENABLE();
  695. /**USB_OTG_FS GPIO Configuration
  696. PA11 ------> USB_OTG_FS_DM
  697. PA12 ------> USB_OTG_FS_DP
  698. */
  699. GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12;
  700. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  701. GPIO_InitStruct.Pull = GPIO_NOPULL;
  702. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  703. GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
  704. HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
  705. /* Peripheral clock enable */
  706. __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
  707. /* USB_OTG_FS interrupt Init */
  708. HAL_NVIC_SetPriority(OTG_FS_IRQn, 0, 0);
  709. HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
  710. /* USER CODE BEGIN USB_OTG_FS_MspInit 1 */
  711. /* USER CODE END USB_OTG_FS_MspInit 1 */
  712. }
  713. }
  714. /**
  715. * @brief PCD MSP De-Initialization
  716. * This function freeze the hardware resources used in this example
  717. * @param hpcd: PCD handle pointer
  718. * @retval None
  719. */
  720. void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd)
  721. {
  722. if (hpcd->Instance==USB_OTG_FS)
  723. {
  724. /* USER CODE BEGIN USB_OTG_FS_MspDeInit 0 */
  725. /* USER CODE END USB_OTG_FS_MspDeInit 0 */
  726. /* Peripheral clock disable */
  727. __HAL_RCC_USB_OTG_FS_CLK_DISABLE();
  728. /**USB_OTG_FS GPIO Configuration
  729. PA11 ------> USB_OTG_FS_DM
  730. PA12 ------> USB_OTG_FS_DP
  731. */
  732. HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12);
  733. /* USB_OTG_FS interrupt DeInit */
  734. HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
  735. /* USER CODE BEGIN USB_OTG_FS_MspDeInit 1 */
  736. /* USER CODE END USB_OTG_FS_MspDeInit 1 */
  737. }
  738. }
  739. static uint32_t FSMC_Initialized = 0;
  740. static void HAL_FSMC_MspInit(void)
  741. {
  742. /* USER CODE BEGIN FSMC_MspInit 0 */
  743. /* USER CODE END FSMC_MspInit 0 */
  744. GPIO_InitTypeDef GPIO_InitStruct = {0};
  745. if (FSMC_Initialized)
  746. {
  747. return;
  748. }
  749. FSMC_Initialized = 1;
  750. /* Peripheral clock enable */
  751. __HAL_RCC_FSMC_CLK_ENABLE();
  752. /** FSMC GPIO Configuration
  753. PF0 ------> FSMC_A0
  754. PF1 ------> FSMC_A1
  755. PF2 ------> FSMC_A2
  756. PF3 ------> FSMC_A3
  757. PF4 ------> FSMC_A4
  758. PF5 ------> FSMC_A5
  759. PF12 ------> FSMC_A6
  760. PF13 ------> FSMC_A7
  761. PF14 ------> FSMC_A8
  762. PF15 ------> FSMC_A9
  763. PG0 ------> FSMC_A10
  764. PG1 ------> FSMC_A11
  765. PE7 ------> FSMC_D4
  766. PE8 ------> FSMC_D5
  767. PE9 ------> FSMC_D6
  768. PE10 ------> FSMC_D7
  769. PE11 ------> FSMC_D8
  770. PE12 ------> FSMC_D9
  771. PE13 ------> FSMC_D10
  772. PE14 ------> FSMC_D11
  773. PE15 ------> FSMC_D12
  774. PD8 ------> FSMC_D13
  775. PD9 ------> FSMC_D14
  776. PD10 ------> FSMC_D15
  777. PD11 ------> FSMC_A16
  778. PD12 ------> FSMC_A17
  779. PD13 ------> FSMC_A18
  780. PD14 ------> FSMC_D0
  781. PD15 ------> FSMC_D1
  782. PG2 ------> FSMC_A12
  783. PG3 ------> FSMC_A13
  784. PG4 ------> FSMC_A14
  785. PG5 ------> FSMC_A15
  786. PD0 ------> FSMC_D2
  787. PD1 ------> FSMC_D3
  788. PD4 ------> FSMC_NOE
  789. PD5 ------> FSMC_NWE
  790. PG10 ------> FSMC_NE3
  791. PG12 ------> FSMC_NE4
  792. PE0 ------> FSMC_NBL0
  793. PE1 ------> FSMC_NBL1
  794. */
  795. GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
  796. |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_13
  797. |GPIO_PIN_14|GPIO_PIN_15;
  798. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  799. GPIO_InitStruct.Pull = GPIO_NOPULL;
  800. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  801. GPIO_InitStruct.Alternate = GPIO_AF12_FSMC;
  802. HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
  803. GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
  804. |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_10|GPIO_PIN_12;
  805. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  806. GPIO_InitStruct.Pull = GPIO_NOPULL;
  807. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  808. GPIO_InitStruct.Alternate = GPIO_AF12_FSMC;
  809. HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
  810. GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
  811. |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14
  812. |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1;
  813. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  814. GPIO_InitStruct.Pull = GPIO_NOPULL;
  815. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  816. GPIO_InitStruct.Alternate = GPIO_AF12_FSMC;
  817. HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
  818. GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
  819. |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
  820. |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5;
  821. GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
  822. GPIO_InitStruct.Pull = GPIO_NOPULL;
  823. GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
  824. GPIO_InitStruct.Alternate = GPIO_AF12_FSMC;
  825. HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
  826. /* USER CODE BEGIN FSMC_MspInit 1 */
  827. /* USER CODE END FSMC_MspInit 1 */
  828. }
  829. void HAL_SRAM_MspInit(SRAM_HandleTypeDef *hsram)
  830. {
  831. /* USER CODE BEGIN SRAM_MspInit 0 */
  832. /* USER CODE END SRAM_MspInit 0 */
  833. HAL_FSMC_MspInit();
  834. /* USER CODE BEGIN SRAM_MspInit 1 */
  835. /* USER CODE END SRAM_MspInit 1 */
  836. }
  837. static uint32_t FSMC_DeInitialized = 0;
  838. static void HAL_FSMC_MspDeInit(void)
  839. {
  840. /* USER CODE BEGIN FSMC_MspDeInit 0 */
  841. /* USER CODE END FSMC_MspDeInit 0 */
  842. if (FSMC_DeInitialized)
  843. {
  844. return;
  845. }
  846. FSMC_DeInitialized = 1;
  847. /* Peripheral clock enable */
  848. __HAL_RCC_FSMC_CLK_DISABLE();
  849. /** FSMC GPIO Configuration
  850. PF0 ------> FSMC_A0
  851. PF1 ------> FSMC_A1
  852. PF2 ------> FSMC_A2
  853. PF3 ------> FSMC_A3
  854. PF4 ------> FSMC_A4
  855. PF5 ------> FSMC_A5
  856. PF12 ------> FSMC_A6
  857. PF13 ------> FSMC_A7
  858. PF14 ------> FSMC_A8
  859. PF15 ------> FSMC_A9
  860. PG0 ------> FSMC_A10
  861. PG1 ------> FSMC_A11
  862. PE7 ------> FSMC_D4
  863. PE8 ------> FSMC_D5
  864. PE9 ------> FSMC_D6
  865. PE10 ------> FSMC_D7
  866. PE11 ------> FSMC_D8
  867. PE12 ------> FSMC_D9
  868. PE13 ------> FSMC_D10
  869. PE14 ------> FSMC_D11
  870. PE15 ------> FSMC_D12
  871. PD8 ------> FSMC_D13
  872. PD9 ------> FSMC_D14
  873. PD10 ------> FSMC_D15
  874. PD11 ------> FSMC_A16
  875. PD12 ------> FSMC_A17
  876. PD13 ------> FSMC_A18
  877. PD14 ------> FSMC_D0
  878. PD15 ------> FSMC_D1
  879. PG2 ------> FSMC_A12
  880. PG3 ------> FSMC_A13
  881. PG4 ------> FSMC_A14
  882. PG5 ------> FSMC_A15
  883. PD0 ------> FSMC_D2
  884. PD1 ------> FSMC_D3
  885. PD4 ------> FSMC_NOE
  886. PD5 ------> FSMC_NWE
  887. PG10 ------> FSMC_NE3
  888. PG12 ------> FSMC_NE4
  889. PE0 ------> FSMC_NBL0
  890. PE1 ------> FSMC_NBL1
  891. */
  892. HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
  893. |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_12|GPIO_PIN_13
  894. |GPIO_PIN_14|GPIO_PIN_15);
  895. HAL_GPIO_DeInit(GPIOG, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
  896. |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_10|GPIO_PIN_12);
  897. HAL_GPIO_DeInit(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
  898. |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14
  899. |GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1);
  900. HAL_GPIO_DeInit(GPIOD, GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
  901. |GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15
  902. |GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_5);
  903. /* USER CODE BEGIN FSMC_MspDeInit 1 */
  904. /* USER CODE END FSMC_MspDeInit 1 */
  905. }
  906. void HAL_SRAM_MspDeInit(SRAM_HandleTypeDef *hsram)
  907. {
  908. /* USER CODE BEGIN SRAM_MspDeInit 0 */
  909. /* USER CODE END SRAM_MspDeInit 0 */
  910. HAL_FSMC_MspDeInit();
  911. /* USER CODE BEGIN SRAM_MspDeInit 1 */
  912. /* USER CODE END SRAM_MspDeInit 1 */
  913. }
  914. /* USER CODE BEGIN 1 */
  915. /* USER CODE END 1 */
  916. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/