EE445M RTOS
Taken at the University of Texas Spring 2015
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
blinky.c
Go to the documentation of this file.
1
/* -*- mode: c; c-basic-offset: 4; -*- */
2
//*****************************************************************************
3
//
4
// blinky.c - Simple example to blink the on-board LED.
5
//
6
// Copyright (c) 2012-2014 Texas Instruments Incorporated. All rights reserved.
7
// Software License Agreement
8
//
9
// Texas Instruments (TI) is supplying this software for use solely and
10
// exclusively on TI's microcontroller products. The software is owned by
11
// TI and/or its suppliers, and is protected under applicable copyright
12
// laws. You may not combine this software with "viral" open-source
13
// software in order to form a larger program.
14
//
15
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
16
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
17
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
19
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
20
// DAMAGES, FOR ANY REASON WHATSOEVER.
21
//
22
// This is part of revision 2.1.0.12573 of the EK-TM4C123GXL Firmware Package.
23
//
24
//*****************************************************************************
25
26
#include <stdint.h>
27
#include "
inc/tm4c123gh6pm.h
"
28
29
//*****************************************************************************
30
//
36
//
37
//*****************************************************************************
38
39
//*****************************************************************************
40
//
41
// Blink the on-board LED.
42
//
43
//*****************************************************************************
44
int
45
main
(
void
)
46
{
47
volatile
uint32_t ui32Loop;
48
49
//
50
// Enable the GPIO port that is used for the on-board LED.
51
//
52
SYSCTL_RCGC2_R
=
SYSCTL_RCGC2_GPIOF
;
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
}
GPIO_PORTF_DEN_R
#define GPIO_PORTF_DEN_R
Definition:
tm4c123fe6pm.h:720
GPIO_PORTF_DATA_R
#define GPIO_PORTF_DATA_R
Definition:
tm4c123fe6pm.h:703
main
int main(void)
Definition:
blinky.c:45
SYSCTL_RCGC2_GPIOF
#define SYSCTL_RCGC2_GPIOF
Definition:
hw_sysctl.h:1319
SYSCTL_RCGC2_R
#define SYSCTL_RCGC2_R
Definition:
tm4c123fe6pm.h:2165
tm4c123gh6pm.h
GPIO_PORTF_DIR_R
#define GPIO_PORTF_DIR_R
Definition:
tm4c123fe6pm.h:704
board-progs
blinky
blinky.c
Generated on Fri Mar 13 2015 21:18:36 for EE445M RTOS by
1.8.9.1