File tree 1 file changed +21
-0
lines changed
libraries/SPI/src/utility
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)
60
60
UNUSED (spi_inst );
61
61
/* SPIx source CLK is PCKL1 */
62
62
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
+ }
63
84
#elif defined(STM32MP1xx )
64
85
/* Get source clock depending on SPI instance */
65
86
if (spi_inst != NP ) {
You can’t perform that action at this time.
0 commit comments