Add clock frequency definitions

This commit is contained in:
fruchti 2020-12-26 11:45:20 +01:00
parent 4774d5fbe5
commit ab5b2c61e6
3 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,6 @@
#pragma once
#define CLOCK_APB1 36000000
#define CLOCK_APB2 72000000
#define CLOCK_SYSCLK 72000000
#define CLOCK_AHB 72000000

View file

@ -24,6 +24,10 @@ static void Clock_Init(void)
// Resulting clocks:
// SYSCLK, AHB, APB2 72 Mhz
// APB1, ADC 36 MHz
#if (CLOCK_SYSCLK != 72000000) || (CLOCK_AHB != 72000000) \
|| (CLOCK_APB1 != 36000000) || (CLOCK_APB2 != 72000000)
#error Clock initialisation does not match definitions in clock.h.
#endif
// Disable all interrupts
RCC->CIR = 0x00000000;

View file

@ -2,6 +2,7 @@
#include <stdbool.h>
#include "stm32f1xx.h"
#include "clock.h"
#include "pinning.h"
#include "buildid.h"
#include "debug.h"