5
1 Introduction
This file contains coding standards for Portable C code and Architectural Specific C
code. It is meant to be a mechanism by which software can be created that is uniform
in structure and functionality. While each programmer has their own coding style, the
intent of these guidelines is to standardize the following
1. Files
2. Embedded documentation
3. Data types (portable, architecture specific)
4. Naming Conventions
5. Coding syntax
2 File Conventions
This section describes coding standards related to source and header files.
2.1 General Conventions
1. English is the language of choice for variable names, function names,
comments, etc.
2. File content must be kept within 80 columns.
3. Special characters are not to be used.
4. Examples: Tab, page break, etc.
2.2 Layout
1. Loops must be left justified.
2. The basic indentation must be 4 spaces.
3. Single spaces and newlines are the only allowed white space characters.
4. Unix end-of-line character (‘\n’ or ASCII LF (0x0A)) will be used on all files.
5. All source files must contain a header denoting the file name and path. See
the example header file in the appendix for more details.
6. All source files must contain a copyright statement attributing the code to
Texas Instruments. The year in the copyright statement refers the year in
which the code was created.
7. No random blank line pattern must exist in the code. If one (or two) blank lines
are used to space the code, then this convention must be followed throughout
the file.
8. All functions in the file must be alphabetized, except for inline functions that
depend upon other inline functions in the same file. In this situation, the
dependent inline functions should appear at the bottom of the section.