From 39340ea11f06a65c0fb3b91b44556770e5a58ac5 Mon Sep 17 00:00:00 2001 From: Uttam Ambappa Bhavimani Date: Mon, 28 Oct 2024 23:36:10 +0530 Subject: [PATCH] Update main.c Defines variables --- main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.c b/main.c index 23436a4..676702e 100644 --- a/main.c +++ b/main.c @@ -1,2 +1,11 @@ #include #include "tm4c123gh6pm.h" + +#define STCTRL *((volatile uint32_t *) 0xE000E010) // Control and status +#define STRELOAD *((volatile uint32_t *) 0xE000E014) // Reload value +#define STCURRENT *((volatile uint32_t *) 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 CLOCK_HZ 16000000 // Clock frequency of EK-TM4C123GXL +#define SYSTICK_RELOAD_VALUE(us) ((CLOCK_HZ / 1000000) * (us) - 1) // SysTick reload value in microseconds based on clock frequency