File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
libraries/SPI/src/utility Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,27 @@ uint32_t spi_getClkFreqInst(SPI_TypeDef *spi_inst)
6060 UNUSED (spi_inst );
6161 /* SPIx source CLK is PCKL1 */
6262 spi_freq = HAL_RCC_GetPCLK1Freq ();
63+ #elif defined(STM32H7xx )
64+ /* Get source clock depending on SPI instance */
65+ if (spi_inst != NP ) {
66+ switch ((uint32_t )spi_inst ) {
67+ case (uint32_t )SPI1 :
68+ case (uint32_t )SPI2 :
69+ case (uint32_t )SPI3 :
70+ spi_freq = HAL_RCCEx_GetPeriphCLKFreq (RCC_PERIPHCLK_SPI123 );
71+ break ;
72+ case (uint32_t )SPI4 :
73+ case (uint32_t )SPI5 :
74+ spi_freq = HAL_RCC_GetPCLK2Freq ();
75+ break ;
76+ case (uint32_t )SPI6 :
77+ spi_freq = HAL_RCCEx_GetPeriphCLKFreq (RCC_PERIPHCLK_SPI6 );
78+ break ;
79+ default :
80+ core_debug ("CLK: SPI instance not set" );
81+ break ;
82+ }
83+ }
6384#elif defined(STM32MP1xx )
6485 /* Get source clock depending on SPI instance */
6586 if (spi_inst != NP ) {
You can’t perform that action at this time.
0 commit comments