Functions | Context

General

Functions are provided for two main purposes:

- As sample code demonstrating the use of the peripherals.
- As functions in libraries to be directly incorporated in source code by the user.

Each function will be contained in its own file as described below.
The functions of each peripheral will be combined in libraries per peripheral.

Functions (eg AdcCfg()) will be named as follows:

- 3 character peripheral name (eg Adc).
- 2 or 3 character function abbreviation (eg Cfg).

Source Files

Each file will consist of a full description of the functionality and interface of the function. This will be followed by the actual source code.

Each source file name (eg Adc7024Cfg.s) will be constructed as follows:

- 3 character peripheral name.
- 4 digit part number.
- 2 or 3 character function abbreviation.
- .s type.

Libraries

For the generation of each peripheral's library a separate source file will be created. Such file will consist of a header plus lines to include each function source file for that library. This file will then be assembled and converted into a library file.

Each library file name (eg libAdc7024.a) will be constructed as follows:

- The letters "lib"
- 3 character peripheral name.
- 4 digit part number.
- .a type.

For any library functions in user code the user must select the appropriate library as described for the Compiler setup or for the Assembler setup. Obviously the user must also include the appropriate function prototypes in C code and extern statements etc in assembly code.

Directories/Folders

It is recommended that there should be 3 directories containing Function files with the paths indicated below:

- ADI Functions - *AppP*\Devices\PN\
- User Functions - User defined.
- Standard Functions - *AppP*\Devices\PN\

Where *AppP* is the Application Path and PN is the Part Number (eg 7024 for ADuC7024).

Functions have not yet been written.