Use the following instructions to add the PTO APIs to a project.
Note: The exact location may vary depending on where C2000Ware_MotorControl_SDK is installed and which other libraries the project is using.
- Include the PTO header file in the application i.e.
{ProjectName}.h
.#include "pto_pulsegen.h"
#include "pto_qepdiv.h"
#include "pto_abs2qep.h"
#include "pto_qeponclb.h"
- In Code Composer Studio (CCS), right click on the project and navigate to Project Properties → Build → C2000 Compiler → Include Options
- Add the header file directory to the '#include search path' (see Figure 8-1)
The path for PTO header files is ${SDK_ROOT}\libraries\position_sensing\pto\include.
Note: ${SDK_ROOT} is a varaible used by CCS to indicate the install location of the SDK. Its definition can be viewed under Project Properties → Resource → Linked Resources.
- Add the compiled library file to the project:
- Right click on the project name in the Project Explorer window
- Navigate to 'Project Properties → Build → C2000 Linker → File Search Path'
- Add the library directory to the 'library search path'
- Add the name of the library to the 'Include library file'
- Click 'Apply and Close'
The PTO compiled library object files are located at: [C2000Ware_MotorControl_SDK]\libraries\position_sensing\pto\lib.
An example is shown in Figure 8-2 and Figure 8-3 show the changes to the linker options that are required to include the PTO APIs compiled object file.
Note: The exact location may vary depending on where C2000Ware_MotorControl_SDK is installed and which other libraries the project is using.