aboutsummaryrefslogtreecommitdiff
path: root/clocks.s
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-01-19 16:41:29 -0600
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-01-19 16:41:29 -0600
commit261c210c9c4c1e55103a7af31dfcc539c0e0e5cc (patch)
tree71840ab97b84dd3f995ea8900b08c98149feac36 /clocks.s
parent473e52cbe7cbee0333b7d97d91c4bbf95c1b3225 (diff)
Add subroutine for printing hexadecimal word
Diffstat (limited to 'clocks.s')
-rw-r--r--clocks.s31
1 files changed, 0 insertions, 31 deletions
diff --git a/clocks.s b/clocks.s
deleted file mode 100644
index 83bc9ff..0000000
--- a/clocks.s
+++ /dev/null
@@ -1,31 +0,0 @@
-.syntax unified
-.cpu cortex-m0plus
-.thumb
-
-.equ CLOCKS_BASE, 0x40008000
-.equ CLK_REF_CTRL_OFST, 0x30
-.equ CLK_SYS_CTRL_OFST, 0x3c
-.equ CLK_PERI_CTRL_OFST, 0x48
-
-.type setup_clocks, %function
-.global setup_clocks
-
-setup_clocks:
-
- ldr r1, =CLOCKS_BASE
-
- // Reference clock
- movs r0, 0x2 // src = xosc
- str r0, [r1, CLK_REF_CTRL_OFST]
-
- // System clock
- movs r0, 0x0 // src = clk_ref
- str r0, [r1, CLK_SYS_CTRL_OFST]
-
- // Peripheral clock
- movs r0, 1 // set enable
- lsls r0, 11
- adds r0, 0x4 << 5 // src = xosc
- str r0, [r1, CLK_PERI_CTRL_OFST]
-
- bx lr