//源文件main.c
#include "main.h"
int main(void){
RCC_GetClocksFreqValue(&ClocksFreq);
Perip_GetClocksFreqValue(&PeripheralFreq);
}
void Perip_GetClocksFreqValue(Struct_Freq * PeripheralFreq){ //自定义函数实现
PeripheralFreq->TIM1FREQ = TIM_GetPrescaler(TIM1);
PeripheralFreq->TIM2FREQ = TIM_GetPrescaler(TIM2);
PeripheralFreq->TIM3FREQ = TIM_GetPrescaler(TIM3);
PeripheralFreq->TIM4FREQ = TIM_GetPrescaler(TIM4);
PeripheralFreq->TIM5FREQ = TIM_GetPrescaler(TIM5);
PeripheralFreq->TIM6FREQ = TIM_GetPrescaler(TIM6);
PeripheralFreq->TIM7FREQ = TIM_GetPrescaler(TIM7);
PeripheralFreq->TIM8FREQ = TIM_GetPrescaler(TIM8);
}
|