SikendeRTOS
RTOS for ARM Cortex M3+ SoCs designed and written from scratch
cpu.c
Go to the documentation of this file.
1
8#include "cpu.h"
9
10
11
15void CLOCK_Init(void)
16{
17 PLL_Init(Bus80MHz); // set processor clock to 50 MHz
18}
19
20
21
26void LED_Init(void)
27{
28 SYSCTL_RCGCGPIO_R |= CLOCK_MASK_PORTF; // Enable Clock
29 while((SYSCTL_PRGPIO_R & CLOCK_MASK_PORTF) != CLOCK_MASK_PORTF){}; // wait for clock to be enabled
30 GPIO_PORTF_LOCK_R = GPIO_LOCK_KEY;// 2a) unlock GPIO Port F Commit Register
31 GPIO_PORTF_CR_R = LEDS; // 2b) enable commit for PF0-PF3
32 GPIO_PORTF_AMSEL_R &= ~LEDS; // 3) disable analog functionality on PF0-PF3
33 GPIO_PORTF_PCTL_R &= ~0x000FFFF;// 4) configure PF0-PF3 as GPIO
34 GPIO_PORTF_DIR_R = LEDS; // 5) make PF0-3 output
35 GPIO_PORTF_AFSEL_R &= ~LEDS; // 6) disable alt funct on PF0-PF3
36 GPIO_PORTF_DEN_R = LEDS; // 7) enable digital I/O on PF0-PF3
37}
38
#define CLOCK_MASK_PORTF
Definition: cpu.h:18
#define LEDS
Definition: cpu.h:22
void PLL_Init(INT32U freq)
Definition: PLL.c:53
#define Bus80MHz
Definition: PLL.h:44
void LED_Init(void)
Initialize ports for blinking LEDs on TM4C123/TM4C129 Development Board example function.
Definition: cpu.c:26
void CLOCK_Init(void)
Initialize clock/PLL of TM4C123 launchpad at 80 MhZ.
Definition: cpu.c:15
#define GPIO_PORTF_DIR_R
Definition: tm4c123gh6pm.h:711
#define GPIO_PORTF_CR_R
Definition: tm4c123gh6pm.h:729
#define SYSCTL_RCGCGPIO_R
#define GPIO_PORTF_AMSEL_R
Definition: tm4c123gh6pm.h:730
#define GPIO_PORTF_AFSEL_R
Definition: tm4c123gh6pm.h:719
#define GPIO_PORTF_LOCK_R
Definition: tm4c123gh6pm.h:728
#define GPIO_LOCK_KEY
#define GPIO_PORTF_PCTL_R
Definition: tm4c123gh6pm.h:731
#define GPIO_PORTF_DEN_R
Definition: tm4c123gh6pm.h:727
#define SYSCTL_PRGPIO_R