0
1.0kviews
Give the Structure of typical C source program for ARM based processor.
1 Answer
0
0views
| written 7.4 years ago by |
#include “lpc214x.h” //header file that contains all information about LPC2148
/* Global variables – accessible by all functions */
int count, bob;
/* Function definitions */
int function1(char x) //parameter x passed to the function. Function returns an integer value
{
int I, j; // Local (automatic) variable
…....
....…
....… //instructions to implement function
}
/* Main program */
void main (void)
{
Unsigned char sw1;
int k; //declare local variables
/* Initialization section */
...… instructions to initiate variables,
...… I/O parts, devices, function registers //Initialize variables, devices I/O parts
/* Endless loop */
while (1)
{
…. Instructions to be repeated
} //body of program
}
ADD COMMENT
EDIT
Please log in to add an answer.

and 5 others joined a min ago.