systick initialization

This commit is contained in:
Rajput R Vikramsingh Vikramsingh 2024-10-10 19:17:24 +05:30
parent 29f60736f2
commit a309260a54
1 changed files with 9 additions and 0 deletions

9
main.c
View File

@ -1,3 +1,12 @@
#include<stdint.h> #include<stdint.h>
#include<stdbool.h> #include<stdbool.h>
#include"tm4c123gh6pm.h" #include"tm4c123gh6pm.h"
/* Systick memory mapped registers */
#define STCTRL *((volatile long *) 0xE000E010) // control and status
#define STRELOAD *((volatile long *) 0xE000E014) // reload value
#define STCURRENT *((volatile long *) 0xE000E018) // current value
#define ENABLE (1 << 0) // bit 0 of CSR to enable the timer
#define CLKINT (1 << 2) // bit 2 of CSR to specify CPU clock
#define SYS_INTEN (1 << 1) // enable systick interrupt