]> git.ayabusa.dev Git - numworks-zeta-os.git/commitdiff
added some thing for the clock (see TODO)(broken)
authorayabusa <lebgpub@gmail.com>
Fri, 19 Apr 2024 09:39:52 +0000 (11:39 +0200)
committerayabusa <lebgpub@gmail.com>
Fri, 19 Apr 2024 09:39:52 +0000 (11:39 +0200)
numworks_port/src/Laplace/clock.c

index 0ad641658e97e32c4fb3c18f30150aeecbafde79..7027ead53e04be60e01bad3e0794d998da07e9da 100644 (file)
@@ -24,6 +24,17 @@ void init_clock(){
     * SSCGEN = 1 */
     RCC->SSCGR = 0b10000000000000110010000011111010;
 
+    // clear PLL_M, PLL_N ,PLL_Q and PLLSRC in PLLCFGR
+    RCC->PLLCFGR &= ~(0b00001111010000000111111111111111);
+    // Set the specified value to PLLCFGR
+    /* PLL_M = 8 = 0b1000
+     * PLL_N = 384 = 0b110000000
+     * PLL_Q = 8 = 0b1000
+     * PLL_SRC = HSE = 1 */
+    RCC->PLLCFGR |= 0b00001000010000000110000000001000;
+
+    // Now we can enable PLL
+    RCC->CR |= RCC_CR_PLLON;
 }
 
 /* OLD