summaryrefslogtreecommitdiff
path: root/project_starter_files/Core/Src/systick.c
diff options
context:
space:
mode:
authorgithub-classroom[bot] <66690702+github-classroom[bot]@users.noreply.github.com>2025-08-26 17:03:24 +0000
committerGitHub <noreply@github.com>2025-08-26 17:03:24 +0000
commit0f2ea7deaf0cba2f0ca07f6611c5a9e87d531f5b (patch)
tree66b32e47da7602942f1bf4b7d343367ac408cd5a /project_starter_files/Core/Src/systick.c
download340-repo-Sowgro-0f2ea7deaf0cba2f0ca07f6611c5a9e87d531f5b.tar.gz
340-repo-Sowgro-0f2ea7deaf0cba2f0ca07f6611c5a9e87d531f5b.tar.bz2
340-repo-Sowgro-0f2ea7deaf0cba2f0ca07f6611c5a9e87d531f5b.zip
Initial commit
Diffstat (limited to 'project_starter_files/Core/Src/systick.c')
-rw-r--r--project_starter_files/Core/Src/systick.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/project_starter_files/Core/Src/systick.c b/project_starter_files/Core/Src/systick.c
new file mode 100644
index 0000000..263defd
--- /dev/null
+++ b/project_starter_files/Core/Src/systick.c
@@ -0,0 +1,23 @@
+#include "systick.h"
+
+// This function is to Initialize SysTick registers
+void init_systick()
+{
+ // Use the SysTick global structure pointer to do the following in this
+ // exact order with separate lines for each step:
+ //
+ // Disable SysTick by clearing the CTRL (CSR) register.
+ // Set the LOAD (RVR) to 8 million to give us a 100 milliseconds timer.
+ // Set the clock source bit in the CTRL (CSR) to the internal clock.
+ // Set the enable bit in the CTRL (CSR) to start the timer.
+}
+
+// This fuction is to create delay using SysTick timer counter
+void delay_systick()
+{
+ // Using the SysTick global structure pointer do the following:
+ // Create a for loop that loops 10 times
+ // Inside that for loop check the COUNTFLAG bit in the CTRL (CSR)
+ // register in a loop. When that bit is set exit this inner loop
+ // to do another pass in the outer loop of 10.
+}