EE445M RTOS
Taken at the University of Texas Spring 2015
blinky.c File Reference
#include <stdint.h>
#include "inc/tm4c123gh6pm.h"
Include dependency graph for blinky.c:

Go to the source code of this file.

Functions

int main (void)
 

Function Documentation

int main ( void  )

Definition at line 45 of file blinky.c.

References GPIO_PORTF_DATA_R, GPIO_PORTF_DEN_R, GPIO_PORTF_DIR_R, SYSCTL_RCGC2_GPIOF, and SYSCTL_RCGC2_R.

Referenced by Reset_Handler().

46 {
47  volatile uint32_t ui32Loop;
48 
49  //
50  // Enable the GPIO port that is used for the on-board LED.
51  //
53 
54  //
55  // Do a dummy read to insert a few cycles after enabling the peripheral.
56  //
57  ui32Loop = SYSCTL_RCGC2_R;
58 
59  //
60  // Enable the GPIO pin for the LED (PF3). Set the direction as output, and
61  // enable the GPIO pin for digital function.
62  //
63  GPIO_PORTF_DIR_R = 0x08;
64  GPIO_PORTF_DEN_R = 0x08;
65 
66  //
67  // Loop forever.
68  //
69  while(1)
70  {
71  //
72  // Turn on the LED.
73  //
74  GPIO_PORTF_DATA_R |= 0x08;
75 
76  //
77  // Delay for a bit.
78  //
79  for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
80  {
81  }
82 
83  //
84  // Turn off the LED.
85  //
86  GPIO_PORTF_DATA_R &= ~(0x08);
87 
88  //
89  // Delay for a bit.
90  //
91  for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
92  {
93  }
94  }
95 }
#define GPIO_PORTF_DEN_R
Definition: tm4c123fe6pm.h:720
#define GPIO_PORTF_DATA_R
Definition: tm4c123fe6pm.h:703
#define SYSCTL_RCGC2_GPIOF
Definition: hw_sysctl.h:1319
#define SYSCTL_RCGC2_R
#define GPIO_PORTF_DIR_R
Definition: tm4c123fe6pm.h:704

Here is the caller graph for this function: